public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Pozsar Balazs <pozsy@uhulinux.hu>
Cc: Valerie Henson <val_henson@linux.intel.com>,
	Prakash Punnoor <prakash@punnoor.de>, Jiri Benc <jbenc@suse.cz>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [RFC/PATCH] Fixes for ULi5261 (tulip driver)
Date: Sat, 19 Aug 2006 10:36:17 -0400	[thread overview]
Message-ID: <44E721E1.2030203@pobox.com> (raw)
In-Reply-To: <20060819061507.GB8571@ojjektum.uhulinux.hu>

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



  reply	other threads:[~2006-08-19 14:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 10:49 [RFC/PATCH] Fixes for ULi5261 (tulip driver) Jiri Benc
2006-08-15  9:25 ` Pozsar Balazs
2006-08-16 17:11   ` Jiri Benc
2006-08-16 17:43     ` Pozsar Balazs
2006-08-16 18:02       ` Prakash Punnoor
2006-08-16 19:53         ` Pozsar Balazs
2006-08-19  0:16           ` Valerie Henson
2006-08-19  6:15             ` Pozsar Balazs
2006-08-19 14:36               ` Jeff Garzik [this message]
2006-08-21  9:03                 ` Pozsar Balazs
2006-08-23  6:28                   ` Valerie Henson
2006-08-23  9:19                     ` Pozsar Balazs
2006-08-23 16:56                       ` Valerie Henson
2006-08-23 23:27                         ` Nigel Cunningham
2006-08-24  0:14                         ` Nigel Cunningham
2006-08-23 16:59             ` Prakash Punnoor
2006-08-24 17:23               ` Valerie Henson
2006-08-28 11:40                 ` Prakash Punnoor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44E721E1.2030203@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=jbenc@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pozsy@uhulinux.hu \
    --cc=prakash@punnoor.de \
    --cc=val_henson@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox