lkml.org 
[lkml]   [2016]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 6/6] net: pch_gbe: Allow longer for resets
Date
From: Paul Burton
> Sent: 03 February 2016 12:03
> Resets of the EG20T MAC on the MIPS Boston development board take longer
> than the 1000 loops that pch_gbe_wait_clr_bit was performing. Bump up
> the number of loops.
...
> diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-
> semi/pch_gbe/pch_gbe_main.c
> index 00ef83c..87994d2 100644
> --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
> @@ -321,7 +321,7 @@ static void pch_gbe_wait_clr_bit(void *reg, u32 bit)
> u32 tmp;
>
> /* wait busy */
> - tmp = 1000;
> + tmp = 10000;
> while ((ioread32(reg) & bit) && --tmp)
> cpu_relax();
> if (!tmp)

Why not sleep for (say) 100us ?
That'll stop the loop depending on the cpu speed.

David

\
 
 \ /
  Last update: 2016-02-03 18:21    [W:0.068 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site