lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YKIwIwx+nLyX/9LG@kroah.com>
Date:   Mon, 17 May 2021 10:58:11 +0200
From:   Greg KH <gregkh@...uxfoundation.org>
To:     Qiang Ma <maqianga@...ontech.com>
Cc:     jikos@...nel.org, benjamin.tissoires@...hat.com,
        linux-usb@...r.kernel.org, linux-input@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: usbhid: enable remote wakeup for mouse

On Mon, May 17, 2021 at 02:01:45PM +0800, Qiang Ma wrote:
> This patch enables remote wakeup by default for USB mouse
> devices.  Mouse in general are supposed to be wakeup devices, but
> the correct place to enable it depends on the device's bus; no single
> approach will work for all mouse devices.  In particular, this
> covers only USB mouse (and then only those supporting the boot
> protocol).
> 
> Signed-off-by: Qiang Ma <maqianga@...ontech.com>

Based on hardware testing, I do not think we can do this as no other
operating system does this, right?  It's not a requirement of the USB
specification to support this, so we can not enforce it either.


> ---
>  drivers/hid/usbhid/hid-core.c | 12 +++++++-----
>  drivers/hid/usbhid/usbmouse.c |  1 +
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 86257ce6d619..592aa57a97f5 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -1186,11 +1186,13 @@ static int usbhid_start(struct hid_device *hid)
>  	 * In addition, enable remote wakeup by default for all keyboard
>  	 * devices supporting the boot protocol.
>  	 */
> -	if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT &&
> -			interface->desc.bInterfaceProtocol ==
> -				USB_INTERFACE_PROTOCOL_KEYBOARD) {
> -		usbhid_set_leds(hid);
> -		device_set_wakeup_enable(&dev->dev, 1);
> +	if (interface->desc.bInterfaceSubClass == USB_INTERFACE_SUBCLASS_BOOT) {
> +		if (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD ||
> +			interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_MOUSE) {
> +			if (interface->desc.bInterfaceProtocol == USB_INTERFACE_PROTOCOL_KEYBOARD)
> +				usbhid_set_leds(hid);
> +			device_set_wakeup_enable(&dev->dev, 1);
> +		}
>  	}
>  
>  	mutex_unlock(&usbhid->mutex);
> diff --git a/drivers/hid/usbhid/usbmouse.c b/drivers/hid/usbhid/usbmouse.c
> index 073127e65ac1..cf785369a5ed 100644
> --- a/drivers/hid/usbhid/usbmouse.c
> +++ b/drivers/hid/usbhid/usbmouse.c
> @@ -188,6 +188,7 @@ static int usb_mouse_probe(struct usb_interface *intf, const struct usb_device_i
>  		goto fail3;
>  
>  	usb_set_intfdata(intf, mouse);
> +	device_set_wakeup_enable(&dev->dev, 1);
>  	return 0;
>  
>  fail3:	
> -- 
> 2.20.1

How many different devices did you test this on?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ