* [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op()
@ 2009-09-21 20:08 Roel Kluin
2009-09-30 14:01 ` Maxime Bizon
0 siblings, 1 reply; 3+ messages in thread
From: Roel Kluin @ 2009-09-21 20:08 UTC (permalink / raw)
To: mbizon, netdev, Andrew Morton
`while (limit-- >= 0)' reaches -2 after the loop upon timeout.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Small chance to occur, probably.
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index 09d2709..ba29dc3 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -90,7 +90,7 @@ static int do_mdio_op(struct bcm_enet_priv *priv, unsigned int data)
if (enet_readl(priv, ENET_IR_REG) & ENET_IR_MII)
break;
udelay(1);
- } while (limit-- >= 0);
+ } while (limit-- > 0);
return (limit < 0) ? 1 : 0;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op()
2009-09-21 20:08 [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op() Roel Kluin
@ 2009-09-30 14:01 ` Maxime Bizon
2009-10-01 3:05 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Maxime Bizon @ 2009-09-30 14:01 UTC (permalink / raw)
To: Roel Kluin; +Cc: netdev, Andrew Morton
On Mon, 2009-09-21 at 22:08 +0200, Roel Kluin wrote:
Hi Roel,
> `while (limit-- >= 0)' reaches -2 after the loop upon timeout.
The 1000us limit was chosen arbitrarily, since mdio access are much
shorter, and was just to prevent CPU lockup in case of hardware bug.
But it looks like a bug, and since you're the second one reporting this,
this should be fixed :)
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Maxime Bizon <mbizon@freebox.fr>
> ---
> Small chance to occur, probably.
>
> diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
> index 09d2709..ba29dc3 100644
> --- a/drivers/net/bcm63xx_enet.c
> +++ b/drivers/net/bcm63xx_enet.c
> @@ -90,7 +90,7 @@ static int do_mdio_op(struct bcm_enet_priv *priv, unsigned int data)
> if (enet_readl(priv, ENET_IR_REG) & ENET_IR_MII)
> break;
> udelay(1);
> - } while (limit-- >= 0);
> + } while (limit-- > 0);
>
> return (limit < 0) ? 1 : 0;
> }
--
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op()
2009-09-30 14:01 ` Maxime Bizon
@ 2009-10-01 3:05 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2009-10-01 3:05 UTC (permalink / raw)
To: mbizon; +Cc: roel.kluin, netdev, akpm
From: Maxime Bizon <mbizon@freebox.fr>
Date: Wed, 30 Sep 2009 16:01:28 +0200
>
> On Mon, 2009-09-21 at 22:08 +0200, Roel Kluin wrote:
>
> Hi Roel,
>
>> `while (limit-- >= 0)' reaches -2 after the loop upon timeout.
>
> The 1000us limit was chosen arbitrarily, since mdio access are much
> shorter, and was just to prevent CPU lockup in case of hardware bug.
>
> But it looks like a bug, and since you're the second one reporting this,
> this should be fixed :)
>
>
>> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
>
> Acked-by: Maxime Bizon <mbizon@freebox.fr>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-01 3:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-21 20:08 [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op() Roel Kluin
2009-09-30 14:01 ` Maxime Bizon
2009-10-01 3:05 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).