* [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not
@ 2008-04-09 9:42 Roel Kluin
2008-04-10 7:35 ` Zhang, Sonic
0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2008-04-09 9:42 UTC (permalink / raw)
To: sonic.zhang; +Cc: uclinux-dist-devel, lkml
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);
}
^ permalink raw reply related [flat|nested] 2+ messages in thread* RE: [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not
2008-04-09 9:42 [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not Roel Kluin
@ 2008-04-10 7:35 ` Zhang, Sonic
0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Sonic @ 2008-04-10 7:35 UTC (permalink / raw)
To: Roel Kluin, sonic.zhang; +Cc: uclinux-dist-devel, lkml
Acked-by: Sonic Zhang <sonic.zhang@analog.com>
-----Original Message-----
From: Roel Kluin [mailto:12o3l@tiscali.nl]
Sent: Wednesday, April 09, 2008 5:43 PM
To: sonic.zhang@analog.com
Cc: uclinux-dist-devel@blackfin.uclinux.org; lkml
Subject: [PATCH] blackfin: bfin_reset_controller() busy flag appears
cleared when it is not
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);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-04-10 7:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-09 9:42 [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not Roel Kluin
2008-04-10 7:35 ` Zhang, Sonic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox