diff mbox

[U-Boot,1/3] AHCI: Increase link timeout to 200ms

Message ID 1405712321-12334-1-git-send-email-ijc@hellion.org.uk
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Ian Campbell July 18, 2014, 7:38 p.m. UTC
In 73545f75b66d "ahci: wait longer for link" I increased the
timeout to 40ms based on the observed behaviour of a WD disk on a
Cubietruck. Since then Karsten Merker and myself have both
observed timeouts with HGST disks (Karsten on Cubietruck, me on
Cubieboard2). Increasing the timeout to ~175ms fixes this, so go
to 200ms for a bit of headroom.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Cc: Karsten Merker <merker@debian.org>
---
 drivers/block/ahci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede July 19, 2014, 12:33 p.m. UTC | #1
Hi,

On 07/18/2014 09:38 PM, Ian Campbell wrote:
> In 73545f75b66d "ahci: wait longer for link" I increased the
> timeout to 40ms based on the observed behaviour of a WD disk on a
> Cubietruck. Since then Karsten Merker and myself have both
> observed timeouts with HGST disks (Karsten on Cubietruck, me on
> Cubieboard2). Increasing the timeout to ~175ms fixes this, so go
> to 200ms for a bit of headroom.
>
> Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> Cc: Karsten Merker <merker@debian.org>

Looks good to me:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/block/ahci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
> index c8f6573..4df8046 100644
> --- a/drivers/block/ahci.c
> +++ b/drivers/block/ahci.c
> @@ -41,7 +41,7 @@ u16 *ataid[AHCI_MAX_PORTS];
>   #define WAIT_MS_SPINUP	20000
>   #define WAIT_MS_DATAIO	5000
>   #define WAIT_MS_FLUSH	5000
> -#define WAIT_MS_LINKUP	40
> +#define WAIT_MS_LINKUP	200
>
>   static inline u32 ahci_port_base(u32 base, u32 port)
>   {
>
Wolfgang Denk July 19, 2014, 11:22 p.m. UTC | #2
Dear Ian Campbell,

In message <1405712321-12334-1-git-send-email-ijc@hellion.org.uk> you wrote:
> In 73545f75b66d "ahci: wait longer for link" I increased the
> timeout to 40ms based on the observed behaviour of a WD disk on a
> Cubietruck. Since then Karsten Merker and myself have both
> observed timeouts with HGST disks (Karsten on Cubietruck, me on
> Cubieboard2). Increasing the timeout to ~175ms fixes this, so go
> to 200ms for a bit of headroom.

Is there not some specification anywhere which defines a maximum time that
is allowed for the link to come up?


>  #define WAIT_MS_SPINUP	20000
>  #define WAIT_MS_DATAIO	5000
>  #define WAIT_MS_FLUSH	5000
> -#define WAIT_MS_LINKUP	40
> +#define WAIT_MS_LINKUP	200

BTW:  All these names are just horrible from a name space point of view :-(


Best regards,

Wolfgang Denk
Ian Campbell July 20, 2014, 7:06 a.m. UTC | #3
On Sun, 2014-07-20 at 01:22 +0200, Wolfgang Denk wrote:
> Dear Ian Campbell,
> 
> In message <1405712321-12334-1-git-send-email-ijc@hellion.org.uk> you wrote:
> > In 73545f75b66d "ahci: wait longer for link" I increased the
> > timeout to 40ms based on the observed behaviour of a WD disk on a
> > Cubietruck. Since then Karsten Merker and myself have both
> > observed timeouts with HGST disks (Karsten on Cubietruck, me on
> > Cubieboard2). Increasing the timeout to ~175ms fixes this, so go
> > to 200ms for a bit of headroom.
> 
> Is there not some specification anywhere which defines a maximum time that
> is allowed for the link to come up?

I did have a look way back when I originally wrote the patch and if it
exists I can't find it.

> >  #define WAIT_MS_SPINUP	20000
> >  #define WAIT_MS_DATAIO	5000
> >  #define WAIT_MS_FLUSH	5000
> > -#define WAIT_MS_LINKUP	40
> > +#define WAIT_MS_LINKUP	200
> 
> BTW:  All these names are just horrible from a name space point of view :-(

I suppose their saving grace is at least they are only in a .c file.

Ian.
Tom Rini July 22, 2014, 7:24 p.m. UTC | #4
On Fri, Jul 18, 2014 at 08:38:39PM +0100, Ian Campbell wrote:

> In 73545f75b66d "ahci: wait longer for link" I increased the
> timeout to 40ms based on the observed behaviour of a WD disk on a
> Cubietruck. Since then Karsten Merker and myself have both
> observed timeouts with HGST disks (Karsten on Cubietruck, me on
> Cubieboard2). Increasing the timeout to ~175ms fixes this, so go
> to 200ms for a bit of headroom.
> 
> Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
> Cc: Karsten Merker <merker@debian.org>
> Acked-by: Hans de Goede <hdegoede@redhat.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/drivers/block/ahci.c b/drivers/block/ahci.c
index c8f6573..4df8046 100644
--- a/drivers/block/ahci.c
+++ b/drivers/block/ahci.c
@@ -41,7 +41,7 @@  u16 *ataid[AHCI_MAX_PORTS];
 #define WAIT_MS_SPINUP	20000
 #define WAIT_MS_DATAIO	5000
 #define WAIT_MS_FLUSH	5000
-#define WAIT_MS_LINKUP	40
+#define WAIT_MS_LINKUP	200
 
 static inline u32 ahci_port_base(u32 base, u32 port)
 {