lkml.org 
[lkml]   [2006]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/PATCH] Fixes for ULi5261 (tulip driver)
Pozsar Balazs wrote:
> --- a/drivers/net/tulip/uli526x.c 2006-07-15 21:00:43.000000000 +0200
> +++ a/drivers/net/tulip/uli526x.c 2006-08-18 15:41:00.000000000 +0200
> @@ -515,7 +515,8 @@
> phy_reg_reset = phy_read(db->ioaddr, db->phy_addr, 0, db->chip_id);
> phy_reg_reset = (phy_reg_reset | 0x8000);
> phy_write(db->ioaddr, db->phy_addr, 0, phy_reg_reset, db->chip_id);
> - udelay(500);
> + while (phy_read(db->ioaddr, db->phy_addr, 0, db->chip_id) & 0x8000)
> + udelay(500);

You never want an infinite loop in a driver. If, for example, the
hardware is wedged or removed, registers will return all 1's, leading
this loop to never end.

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-08-19 16:43    [W:0.111 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site