All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: Nishant Kamat <nskamat@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 6/7] NET: SMC911X: Fix timeout handling
Date: Fri, 2 May 2008 16:20:05 -0700	[thread overview]
Message-ID: <20080502232005.GA8981@atomide.com> (raw)
In-Reply-To: <1209727441-4312-7-git-send-email-nskamat@ti.com>

* Nishant Kamat <nskamat@ti.com> [080502 04:26]:
> Due to incorrect decrement operation in the loop, the timeout
> value would never be zero in case of hardware error. This patch
> fixes the decrement operation.

And this too.

Tony


> Signed-off-by: Nishant Kamat <nskamat@ti.com>
> ---
>  drivers/net/smc911x.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
> index 14a0e3a..e5afcf2 100644
> --- a/drivers/net/smc911x.c
> +++ b/drivers/net/smc911x.c
> @@ -243,7 +243,7 @@ static void smc911x_reset(struct net_device *dev)
>  		do {
>  			udelay(10);
>  			reg = SMC_GET_PMT_CTRL() & PMT_CTRL_READY_;
> -		} while ( timeout-- && !reg);
> +		} while (--timeout && !reg);
>  		if (timeout == 0) {
>  			PRINTK("%s: smc911x_reset timeout waiting for PM restore\n", dev->name);
>  			return;
> @@ -267,7 +267,7 @@ static void smc911x_reset(struct net_device *dev)
>  				resets++;
>  				break;
>  			}
> -		} while ( timeout-- && (reg & HW_CFG_SRST_));
> +		} while (--timeout && (reg & HW_CFG_SRST_));
>  	}
>  	if (timeout == 0) {
>  		PRINTK("%s: smc911x_reset timeout waiting for reset\n", dev->name);
> @@ -276,7 +276,7 @@ static void smc911x_reset(struct net_device *dev)
>  
>  	/* make sure EEPROM has finished loading before setting GPIO_CFG */
>  	timeout=1000;
> -	while ( timeout-- && (SMC_GET_E2P_CMD() & E2P_CMD_EPC_BUSY_)) {
> +	while (--timeout && (SMC_GET_E2P_CMD() & E2P_CMD_EPC_BUSY_)) {
>  		udelay(10);
>  	}
>  	if (timeout == 0){
> @@ -413,7 +413,7 @@ static inline void smc911x_drop_pkt(struct net_device *dev)
>  		do {
>  			udelay(10);
>  			reg = SMC_GET_RX_DP_CTRL() & RX_DP_CTRL_FFWD_BUSY_;
> -		} while ( timeout-- && reg);
> +		} while (--timeout && reg);
>  		if (timeout == 0) {
>  			PRINTK("%s: timeout waiting for RX fast forward\n", dev->name);
>  		}
> -- 
> 1.5.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-05-02 23:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 11:23 [PATCH 0/7] Support for OMAP3430 LDP (Zoom) Nishant Kamat
2008-05-02 11:23 ` [PATCH 1/7] ARM: OMAP: Add basic board support for OMAP LDP Nishant Kamat
2008-05-02 11:23   ` [PATCH 2/7] ARM: OMAP: Add default kernel config " Nishant Kamat
2008-05-02 11:23     ` [PATCH 3/7] ARM: OMAP: Add NAND flash support " Nishant Kamat
2008-05-02 11:23       ` [PATCH 4/7] NET: SMC911X: Driver works for SMC9211 too Nishant Kamat
2008-05-02 11:23         ` [PATCH 5/7] NET: SMC911X: Add support for OMAP LDP platform Nishant Kamat
2008-05-02 11:24           ` [PATCH 6/7] NET: SMC911X: Fix timeout handling Nishant Kamat
2008-05-02 11:24             ` [PATCH 7/7] ARM: OMAP: Add ethernet support for OMAP LDP Nishant Kamat
2008-05-02 23:20             ` Tony Lindgren [this message]
2008-05-02 18:09           ` [PATCH 5/7] NET: SMC911X: Add support for OMAP LDP platform Steve Sakoman
2008-05-02 23:19           ` Tony Lindgren
2008-05-02 23:19         ` [PATCH 4/7] NET: SMC911X: Driver works for SMC9211 too Tony Lindgren
2008-05-02 11:31   ` [PATCH 1/7] ARM: OMAP: Add basic board support for OMAP LDP Felipe Balbi
2008-05-02 11:44     ` Kamat, Nishant
2008-05-02 12:13       ` Felipe Balbi
2008-05-02 23:18   ` Tony Lindgren

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=20080502232005.GA8981@atomide.com \
    --to=tony@atomide.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nskamat@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.