diff options
author | Sergei Shtylylov <sshtylyov@ru.mvista.com> | 2008-10-13 15:39:29 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:29 -0400 |
commit | aa95f0e76571dc1b067d2839c11f2e5589d063d7 (patch) | |
tree | 4e106674c661c647faaaa094fb18886204844df0 /drivers/ide/pci | |
parent | a447c0932445f92ce6f4c1bd020f62c5097a7842 (diff) |
sgiioc4: sgiioc4_read_status drive busy check fix
Fix the drive non-busy criterion used by sgiioc4_read_status(): neither of the
bits it expects to be set guarantees that the drive is not busy (and might be
interrupting), only the BSY bit itself being zero gurantees that.
While at it, use ATA_BUSY instead of hardcoded value everywhere...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: jeremy@sgi.com
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci')
-rw-r--r-- | drivers/ide/pci/sgiioc4.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c index 1017fb4f6317..12ad4ca4b037 100644 --- a/drivers/ide/pci/sgiioc4.c +++ b/drivers/ide/pci/sgiioc4.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2003-2006 Silicon Graphics, Inc. All Rights Reserved. | 2 | * Copyright (c) 2003-2006 Silicon Graphics, Inc. All Rights Reserved. |
3 | * Copyright (C) 2008 MontaVista Software, Inc. | ||
3 | * | 4 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms of version 2 of the GNU General Public License | 6 | * under the terms of version 2 of the GNU General Public License |
@@ -150,7 +151,7 @@ sgiioc4_clearirq(ide_drive_t * drive) | |||
150 | int count = 0; | 151 | int count = 0; |
151 | 152 | ||
152 | stat = sgiioc4_read_status(hwif); | 153 | stat = sgiioc4_read_status(hwif); |
153 | while ((stat & 0x80) && (count++ < 100)) { | 154 | while ((stat & ATA_BUSY) && (count++ < 100)) { |
154 | udelay(1); | 155 | udelay(1); |
155 | stat = sgiioc4_read_status(hwif); | 156 | stat = sgiioc4_read_status(hwif); |
156 | } | 157 | } |
@@ -310,7 +311,7 @@ static u8 sgiioc4_read_status(ide_hwif_t *hwif) | |||
310 | u8 reg = (u8) readb((void __iomem *) port); | 311 | u8 reg = (u8) readb((void __iomem *) port); |
311 | 312 | ||
312 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ | 313 | if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ |
313 | if (reg & 0x51) { /* Not busy...check for interrupt */ | 314 | if (!(reg & ATA_BUSY)) { /* Not busy... check for interrupt */ |
314 | unsigned long other_ir = port - 0x110; | 315 | unsigned long other_ir = port - 0x110; |
315 | unsigned int intr_reg = (u32) readl((void __iomem *) other_ir); | 316 | unsigned int intr_reg = (u32) readl((void __iomem *) other_ir); |
316 | 317 | ||