mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2] usb: storage: retry for up to 10s on lengthy HDD spin up
Date: Fri, 7 May 2021 10:09:45 +0200	[thread overview]
Message-ID: <20210507080945.GT19819@pengutronix.de> (raw)
In-Reply-To: <20210416172646.26834-1-a.fatoum@pengutronix.de>

On Fri, Apr 16, 2021 at 07:26:46PM +0200, Ahmad Fatoum wrote:
> Some USB disks take notoriously long to spin up. They are seen by a bus
> scan, but they report ready only after a few seconds have passed. This
> is not a problem if vbus is enabled early on, so devices have had a
> chance to spin up. If vbus is first enabled as part of the usb scan,
> not enough time might have passed for the USB disk to be usable.
> 
> This issue was observed on an i.MX6QP with following topology:
> 
>   usb: USB: scanning bus for devices...
>   usb: 5 USB Device(s) found
>     1 ID 0000:0000
>     |  u-boot EHCI Host Controller
>     |
>     +-2 ID 0424:2517
>     |
>     +-5 ID 1058:2621
>     |    Western Digital Elements 2621
>     ...
> 
> Unplugging and replugging the USB disk and doing a second usb scan
> made the unit ready test succeed. Increasing the retry count
> during initialization has negative consequences for other cases,
> like when a device is unplugged while being probed (which already
> takes way too long).
> 
> Instead, just for the case of a detected USB mass storage device that
> couldn't get ready initially: retry for 10s at initialization time
> before giving up.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> v1 -> v2:
>   - don't increase retry count, instead just check time and don't
>     loop longer than 10s at init time.
> ---
>  drivers/usb/storage/usb.c | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)

Applied, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


      reply	other threads:[~2021-05-07  8:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 17:26 Ahmad Fatoum
2021-05-07  8:09 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210507080945.GT19819@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox