Skip to content

Commit

Permalink
sgiioc4: sgiioc4_read_status drive busy check fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergei Shtylylov authored and Bartlomiej Zolnierkiewicz committed Oct 13, 2008
1 parent a447c09 commit aa95f0e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/ide/pci/sgiioc4.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2003-2006 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (C) 2008 MontaVista Software, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License
Expand Down Expand Up @@ -150,7 +151,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
int count = 0;

stat = sgiioc4_read_status(hwif);
while ((stat & 0x80) && (count++ < 100)) {
while ((stat & ATA_BUSY) && (count++ < 100)) {
udelay(1);
stat = sgiioc4_read_status(hwif);
}
Expand Down Expand Up @@ -310,7 +311,7 @@ static u8 sgiioc4_read_status(ide_hwif_t *hwif)
u8 reg = (u8) readb((void __iomem *) port);

if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */
if (reg & 0x51) { /* Not busy...check for interrupt */
if (!(reg & ATA_BUSY)) { /* Not busy... check for interrupt */
unsigned long other_ir = port - 0x110;
unsigned int intr_reg = (u32) readl((void __iomem *) other_ir);

Expand Down

0 comments on commit aa95f0e

Please sign in to comment.