Skip to content

Commit 7f58b41

Browse files
johnkeepinggregkh
authored andcommitted
usb: gadget: f_hid: fix SuperSpeed descriptors
When adding dynamic configuration for bInterval, the value was removed from the static SuperSpeed endpoint descriptors but was not set from the configured value in hidg_bind(). Thus at SuperSpeed the interrupt endpoints have bInterval as zero which is not valid per the USB specification. Add the missing setting for SuperSpeed endpoints. Fixes: ea34925 ("usb: gadget: hid: allow dynamic interval configuration via configfs") Cc: stable <stable@kernel.org> Signed-off-by: John Keeping <jkeeping@inmusicbrands.com> Acked-by: Peter Korsgaard <peter@korsgaard.com> Link: https://patch.msgid.link/20260227111540.431521-1-jkeeping@inmusicbrands.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9f6a983 commit 7f58b41

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/usb/gadget/function/f_hid.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,9 +1207,11 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
12071207
if (!hidg->interval_user_set) {
12081208
hidg_fs_in_ep_desc.bInterval = 10;
12091209
hidg_hs_in_ep_desc.bInterval = 4;
1210+
hidg_ss_in_ep_desc.bInterval = 4;
12101211
} else {
12111212
hidg_fs_in_ep_desc.bInterval = hidg->interval;
12121213
hidg_hs_in_ep_desc.bInterval = hidg->interval;
1214+
hidg_ss_in_ep_desc.bInterval = hidg->interval;
12131215
}
12141216

12151217
hidg_ss_out_comp_desc.wBytesPerInterval =
@@ -1239,9 +1241,11 @@ static int hidg_bind(struct usb_configuration *c, struct usb_function *f)
12391241
if (!hidg->interval_user_set) {
12401242
hidg_fs_out_ep_desc.bInterval = 10;
12411243
hidg_hs_out_ep_desc.bInterval = 4;
1244+
hidg_ss_out_ep_desc.bInterval = 4;
12421245
} else {
12431246
hidg_fs_out_ep_desc.bInterval = hidg->interval;
12441247
hidg_hs_out_ep_desc.bInterval = hidg->interval;
1248+
hidg_ss_out_ep_desc.bInterval = hidg->interval;
12451249
}
12461250
status = usb_assign_descriptors(f,
12471251
hidg_fs_descriptors_intout,

0 commit comments

Comments
 (0)