On Fri, 31 Jan 2014, Dan Williams wrote:

> The port pm_runtime implementation unconditionally clears FEAT_C_ENABLE
> after clearing PORT_POWER, but the bit is reserved on usb3 hub ports.
> We expect khubd to be suspended at this time so we need to clear any
> errors for usb2 ports.

I'm not sure what you meant in that last sentence.  This is a _runtime_
suspend routine, not system suspend.  Therefore khubd will most
certainly be active.  We need to clear the C_ENABLE feature (for
non-SuperSpeed hubs) so that khubd won't see it and do away with the
attached device.

> --- a/drivers/usb/core/port.c
> +++ b/drivers/usb/core/port.c
> @@ -151,7 +151,8 @@ static int usb_port_runtime_suspend(struct device *dev)
>       set_bit(port1, hub->busy_bits);
>       retval = usb_hub_set_port_power(hdev, hub, port1, false);
>       usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_CONNECTION);
> -     usb_clear_port_feature(hdev, port1,     USB_PORT_FEAT_C_ENABLE);
> +     if (!hub_is_superspeed(hdev))
> +             usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE);
>       clear_bit(port1, hub->busy_bits);
>       usb_autopm_put_interface(intf);

Alan Stern

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

Reply via email to