Re: [PATCH 1/2] Add hub port switchable when checking port power

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

 



On Sun, 18 Jan 2015, Chechun Kuo wrote:

> In check_port_resume_type, we will check port power status to determine whether the status should change to -ENODEV.
> If all ports power control of the hub are handled at once, the port power status may not represent the real case and cause resume fail.
> At this patch, we add hub_is_port_power_switchable as well as checking the port power.

I don't understand the reason for this patch.

Are you saying that the PORT POWER bit in the port status will be wrong 
(that is, will be 0) if the hub doesn't support power switching?  
According to section 11.24.2.7.1.6 of the USB-2 spec:

	This bit is implemented on all ports whether or not actual
	port power switching devices are present.

So why is this patch needed?  Does it fix any real problems?

Alan Stern

> Signed-off-by: Chechun Kuo <vichy.kuo@xxxxxxxxx>
> ---
>  drivers/usb/core/hub.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index b649fef..a50b257 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2904,7 +2904,8 @@ static int check_port_resume_type(struct usb_device *udev,
>  	}
>  	/* Is the device still present? */
>  	else if (status || port_is_suspended(hub, portstatus) ||
> -			!port_is_power_on(hub, portstatus) ||
> +			(hub_is_port_power_switchable(hub)
> +				&& !port_is_power_on(hub, portstatus)) ||
>  			!(portstatus & USB_PORT_STAT_CONNECTION)) {
>  		if (status >= 0)
>  			status = -ENODEV;
> 

--
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