Thread (7 messages) flat view 7 messages, 3 authors, 2021-07-28

Re: [PATCH] usb: gadget: f_hid: idle uses the highest byte for duration

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2021-07-28 06:25:40
Also in: lkml

On Tue, Jul 27, 2021 at 09:58:00PM +0300, Maxim Devaev wrote:
quoted hunk ↗ jump to hunk
SET_IDLE value must be shifted 8 bits to the right to get duration.
This confirmed by USBCV test.

Signed-off-by: Maxim Devaev <redacted>
---
 drivers/usb/gadget/function/f_hid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_hid.c b/drivers/usb/gadget/function/f_hid.c
index 8d50c8b12..bb476e121 100644
--- 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_function *f,
 		  | HID_REQ_SET_IDLE):
 		VDBG(cdev, "set_idle\n");
 		length = 0;
-		hidg->idle = value;
+		hidg->idle = value >> 8;
 		goto respond;
 		break;
 
-- 
2.32.0
You forgot to mention what commit this fixes up:

Fixes: afcff6dc690e ("usb: gadget: f_hid: added GET_IDLE and SET_IDLE handlers")

I've added it to the patch now, but try to remember it next time.

thanks,

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