lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0F1B54C89D5F954D8535DB252AF412FA01C82658@chinexm1.ad.analog.com>
Date:	Thu, 10 Apr 2008 15:35:02 +0800
From:	"Zhang, Sonic" <Sonic.Zhang@...log.com>
To:	"Roel Kluin" <12o3l@...cali.nl>, <sonic.zhang@...log.com>
Cc:	<uclinux-dist-devel@...ckfin.uclinux.org>,
	"lkml" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] blackfin: bfin_reset_controller() busy flag appears cleared when it is not

Acked-by: Sonic Zhang <sonic.zhang@...log.com> 

-----Original Message-----
From: Roel Kluin [mailto:12o3l@...cali.nl] 
Sent: Wednesday, April 09, 2008 5:43 PM
To: sonic.zhang@...log.com
Cc: uclinux-dist-devel@...ckfin.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@...cali.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);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ