Thread (159 messages) flat view 159 messages, 11 authors, 2021-08-19
STALE1831d

[PATCH 5.10 069/135] usb: gadget: f_hid: idle uses the highest byte for duration

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-08-10 17:46:28
Also in: lkml

From: Maxim Devaev <redacted>

commit fa20bada3f934e3b3e4af4c77e5b518cd5a282e5 upstream.

SET_IDLE value must be shifted 8 bits to the right to get duration.
This confirmed by USBCV test.

Fixes: afcff6dc690e ("usb: gadget: f_hid: added GET_IDLE and SET_IDLE handlers")
Cc: stable <redacted>
Signed-off-by: Maxim Devaev <redacted>
Link: https://lore.kernel.org/r/20210727185800.43796-1-mdevaev@gmail.com (local)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/usb/gadget/function/f_hid.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/gadget/function/f_hid.c
+++ b/drivers/usb/gadget/function/f_hid.c
@@ -573,7 +573,7 @@ static int hidg_setup(struct usb_functio
 		  | HID_REQ_SET_IDLE):
 		VDBG(cdev, "set_idle\n");
 		length = 0;
-		hidg->idle = value;
+		hidg->idle = value >> 8;
 		goto respond;
 		break;
 

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help