[patch 15/15] aic7xxx: ahd_delay() fix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Denis Vlasenko <vda@xxxxxxxxxxxxx>

ahd_delay() isn't delaying for as long as it should - each time around the
allegedly 1024-usec loop it actually delays for something less than that,
depending upon the value of the incoming arg.

Signed-off-by: Denis Vlasenko <vda@xxxxxxxxxxxxx>
Cc: James Bottomley <James.Bottomley@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/scsi/aic7xxx/aic79xx_osm_o.c |    6 ++++--
 drivers/scsi/aic7xxx/aic7xxx_osm_o.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/aic7xxx/aic79xx_osm_o.c~aic7xxx-ahd_delay-fix drivers/scsi/aic7xxx/aic79xx_osm_o.c
--- devel/drivers/scsi/aic7xxx/aic79xx_osm_o.c~aic7xxx-ahd_delay-fix	2006-04-10 00:20:48.000000000 -0700
+++ devel-akpm/drivers/scsi/aic7xxx/aic79xx_osm_o.c	2006-04-10 00:20:48.000000000 -0700
@@ -28,9 +28,11 @@ ahd_delay(long usec)
 	 * multi-millisecond waits.  Wait at most
 	 * 1024us per call.
 	 */
+	udelay(usec & 1023);
+	usec >>= 10;
 	while (usec > 0) {
-		udelay(usec % 1024);
-		usec -= 1024;
+		udelay(1024);
+		usec--;
 	}
 }
 
diff -puN drivers/scsi/aic7xxx/aic7xxx_osm_o.c~aic7xxx-ahd_delay-fix drivers/scsi/aic7xxx/aic7xxx_osm_o.c
--- devel/drivers/scsi/aic7xxx/aic7xxx_osm_o.c~aic7xxx-ahd_delay-fix	2006-04-10 00:20:48.000000000 -0700
+++ devel-akpm/drivers/scsi/aic7xxx/aic7xxx_osm_o.c	2006-04-10 00:20:48.000000000 -0700
@@ -14,9 +14,11 @@ ahc_delay(long usec)
 	 * multi-millisecond waits.  Wait at most
 	 * 1024us per call.
 	 */
+	udelay(usec & 1023);
+	usec >>= 10;
 	while (usec > 0) {
-		udelay(usec % 1024);
-		usec -= 1024;
+		udelay(1024);
+		usec--;
 	}
 }
 
_
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux