linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Wu <cooloney@kernel.org>
To: jgarzik@pobox.com, linux-ide@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Roel Kluin <12o3l@tiscali.nl>, Bryan Wu <cooloney@kernel.org>
Subject: [PATCH 1/3] [libata/BF54x]: decrease count first.
Date: Fri, 25 Apr 2008 11:37:54 +0800	[thread overview]
Message-ID: <1209094676-20360-2-git-send-email-cooloney@kernel.org> (raw)
In-Reply-To: <1209094676-20360-1-git-send-email-cooloney@kernel.org>

From: Roel Kluin <12o3l@tiscali.nl>

When count reaches 0 the postfix decrement still subtracts (to -1), so
bfin_reset_controller() returns as if the busy flag was cleared while it was not.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 drivers/ata/pata_bf54x.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 0a5ad98..f334ba5 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1417,7 +1417,7 @@ static int bfin_reset_controller(struct ata_host *host)
 	count = 10000000;
 	do {
 		status = read_atapi_register(base, ATA_REG_STATUS);
-	} while (count-- && (status & ATA_BUSY));
+	} while (--count && (status & ATA_BUSY));
 
 	/* Enable only ATAPI Device interrupt */
 	ATAPI_SET_INT_MASK(base, 1);
-- 
1.5.5

  reply	other threads:[~2008-04-25  3:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-25  3:37 [PATCH 0/3] [libata/BF54x]: bug fixing and updates Bryan Wu
2008-04-25  3:37 ` Bryan Wu [this message]
2008-04-25  3:37 ` [PATCH 2/3] [libata/BF54x]: Fix bug - Implement bfin ata interrupt handler to avoid "irq 68 nobody cared" Bryan Wu
2008-04-25  5:17   ` Jeff Garzik
2008-04-25  6:27     ` Bryan Wu
2008-04-25  3:37 ` [PATCH 3/3] [libata/BF54x]: Fix compling failure bug - change variable's name according to API update Bryan Wu
2008-04-25  5:20   ` Jeff Garzik

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=1209094676-20360-2-git-send-email-cooloney@kernel.org \
    --to=cooloney@kernel.org \
    --cc=12o3l@tiscali.nl \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).