[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-usb
Subject:    Re: [PATCH] hub: handle claim of enabled remote wakeup after reset
From:       Alan Stern <stern () rowland ! harvard ! edu>
Date:       2012-11-29 17:46:42
Message-ID: Pine.LNX.4.44L0.1211291244150.1535-100000 () iolanthe ! rowland ! org
[Download RAW message or body]

On Thu, 29 Nov 2012, Oliver Neukum wrote:

> Some touchscreens have buggy firmware which claims
> remote wakeup to be enabled after a reset. They nevertheless
> crash if the feature is cleared by the host.
> Add a check for reset resume before checking for
> an enabled remote wakeup feature. On compliant
> devices the feature must be cleared after a reset anyway.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.de>
> ---
>  drivers/usb/core/hub.c |   10 ++++++++--
>  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 1af04bd..ded05b0 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2899,7 +2899,7 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
>  static int finish_port_resume(struct usb_device *udev)
>  {
>  	int	status = 0;
> -	u16	devstatus;
> +	u16	devstatus = 0;

What's the reason for this change?

>  	/* caller owns the udev device lock */
>  	dev_dbg(&udev->dev, "%s\n",
> @@ -2944,7 +2944,13 @@ static int finish_port_resume(struct usb_device *udev)
>  	if (status) {
>  		dev_dbg(&udev->dev, "gone after usb resume? status %d\n",
>  				status);
> -	} else if (udev->actconfig) {
> +	/*
> +	 * There are a few quirky devices which violate the standard
> +	 * by claiming to have remote wakeup enabled after a reset,
> +	 * which crash if the feature is cleared, hence check for
> +	 * udev->reset_resume
> +	 */
> +	} else if (udev->actconfig && !udev->reset_resume) {
>  		le16_to_cpus(&devstatus);
>  		if (devstatus & (1 << USB_DEVICE_REMOTE_WAKEUP)) {
>  			status = usb_control_msg(udev,

Apart from that hunk,

Acked-by: Alan Stern <stern@rowland.harvard.edu>

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic