[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1254319288.1627.758.camel@sakura.staff.proxad.net>
Date: Wed, 30 Sep 2009 16:01:28 +0200
From: Maxime Bizon <mbizon@...ebox.fr>
To: Roel Kluin <roel.kluin@...il.com>
Cc: netdev@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] bcm63xx_enet: timeout off by one in do_mdio_op()
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@...il.com>
Acked-by: Maxime Bizon <mbizon@...ebox.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists