Re: [PATCH] USB: don't disable the ports when type == HUB_RESUME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 14 Apr 2009, Eric Miao wrote:

> From: Yong Yao <yaoyong@xxxxxxxxxxx>
> 
> The condition not to disable the ports when type == HUB_RESUME in
> hub_activate() looks to be incorrect.

This comment isn't very helpful.  What's wrong with the condition?

> Signed-off-by: Yong Yao <yaoyong@xxxxxxxxxxx>
> Signed-off-by: Eric Miao <eric.miao@xxxxxxxxxxx>
> ---
>  drivers/usb/core/hub.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index b19cbfc..556b7bb 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -688,8 +688,8 @@ static void hub_activate(struct usb_hub *hub, enum
> hub_activation_type type)
>  		 * Unconnected ports should likewise be disabled (paranoia),
>  		 * and so should ports for which we have no usb_device.
>  		 */
> -		if ((portstatus & USB_PORT_STAT_ENABLE) && (
> -				type != HUB_RESUME ||
> +		if ((portstatus & USB_PORT_STAT_ENABLE) &&
> +				(type != HUB_RESUME) && (
>  				!(portstatus & USB_PORT_STAT_CONNECTION) ||
>  				!udev ||
>  				udev->state == USB_STATE_NOTATTACHED)) {

This is wrong.  You have changed the logic so that the port will remain
enabled after a HUB_RESUME, even if we don't have a corresponding
usb_device structure or the usb_device is in the NOTATTACHED state.

NAK.

Alan Stern

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux