Re: [RFC] USB: Fix persist resume of some USB 2.0 devices

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

 



Please tell your email client to wrap lines of text after 72 columns or 
so.

On Thu, 23 Jul 2015, Vasudevan, Krishna PrasathX K wrote:

> Hi,
> 
> This mail is for RFC regarding the persist resume of some USB 2.0 devices,
> 
> Problem Summary: Problem has been observed for some USB 2.0 devices
> while resuming from sleep. When the USB �persist� feature is enabled
> through sysfs it is expected to retain its previous mount point
> across sleep and resume states, it works fine for most of the USB 2.0
> mass storage devices, but for some USB 2.0 pendrives such as
> (Transcend Jet flash 16 GB & Alcor micro corporation) it seems to
> fail and re-enumeration happens resulting in creation of new device
> data structure. This problem seems to be similar to the problem faced
> with USB 3.0 devices which is mentioned in below link
> 
> http://marc.info/?l=linux-usb&m=140566728011240&w=2
> 
> 
> 
> In the above mentioned link the problem is observed with USB 3.0
> devices, but in this case it is observed with USB 2.0 mass storage
> devices.While resuming from sleep, a USB disconnect message and re
> enumeration messages are seen resulting in the reset of �persist �
> variable in sysfs.

The link above refers to a problem involving link training.  USB-2.0 
devices don't perform link training in the same way as SuperSpeed 
devices, so they don't suffer from the same problem.

> In the above mentioned link a fix is proposed and that patch was
> merged in mainline kernel, but the patch restricts the timeout only
> to USB 3.0 devices. I am not sure why it was restricted to USB 3.0
> devices, but the same issue seems to appear for USB 2.0 devices too.

No, it isn't the same problem.  It may be a similar problem, but it 
can't be the same, for the reason mentioned above.

> The below patch removes the restriction for USB 3.0 devices and makes
> the time out applicable to all USB devices.
> 
> Signed-off-by: vasudevan,krishna prasath <krishna.prasathx.k.vasudevan@xxxxxxxxx>
> 
> ---
> 
>  drivers/usb/core/hub.c |    2 +-
> 
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> 
> index d2bd9d7..b2b709d 100644
> 
> --- a/drivers/usb/core/hub.c
> 
> +++ b/drivers/usb/core/hub.c
> 
> @@ -3320,7 +3320,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
> 
> 
> 
>                clear_bit(port1, hub->busy_bits);
> 
> 
> 
> -              if (udev->persist_enabled && hub_is_superspeed(hub->hdev))
> 
> +             if (udev->persist_enabled)
> 
>                                status = wait_for_ss_port_enable(udev, hub, &port1, &portchange,
> 
>                                                              &portstatus);

If you are going to do this then you also need to rename the
wait_for_ss_port_enable function and update the comment preceding the
function's definition.  It now applies to all ports, not just to
SuperSpeed (SS) ports.

> RESULT:
> 
> This patch has been tested with USB 2.0 devices(Transcend & Alcor
> micro corp.) that were facing this issue and after applying this
> patch, both the USB 2.0 devices seems to work fine without any issues
> for all tested sleep-resume cycles .

Please make this changes before you resubmit the patch.

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