From: Roel Kluin <12o3l@tiscali.nl>
To: sonic.zhang@analog.com
Cc: uclinux-dist-devel@blackfin.uclinux.org,
lkml <linux-kernel@vger.kernel.org>
Subject: [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not
Date: Wed, 09 Apr 2008 11:42:39 +0200 [thread overview]
Message-ID: <47FC8F8F.5050200@tiscali.nl> (raw)
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>
---
diff --git a/drivers/ata/pata_bf54x.c b/drivers/ata/pata_bf54x.c
index 7f87f10..4208c49 100644
--- a/drivers/ata/pata_bf54x.c
+++ b/drivers/ata/pata_bf54x.c
@@ -1442,15 +1442,15 @@ static int bfin_reset_controller(struct ata_host *host)
ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) & ~DEV_RST);
msleep(2);
/* Wait on Busy flag to clear */
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);
SSYNC();
return (!count);
}
next reply other threads:[~2008-04-09 9:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 9:42 Roel Kluin [this message]
2008-04-10 7:35 ` [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not Zhang, Sonic
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=47FC8F8F.5050200@tiscali.nl \
--to=12o3l@tiscali.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=sonic.zhang@analog.com \
--cc=uclinux-dist-devel@blackfin.uclinux.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 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.