]> git.neil.brown.name Git - history.git/commitdiff
[ide] fix ide_dump_atapi_status()
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sun, 6 Feb 2005 01:44:27 +0000 (02:44 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>
Sun, 6 Feb 2005 01:44:27 +0000 (02:44 +0100)
From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>

On Fri, 4 Feb 2005, Al Viro wrote:

> BTW, ide-lib.c code that triggers the ICE happens to be completely broken.
> Jens, it's your patch from September 2002 - what used to be
>        if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) {
> became
>        if ((status.all & (status.b.bsy|status.b.check)) == status.b.check) {
> and that's *not* an equivalent transformation.  Fixing it doesn't get rid
> of ICE, but it certainly deserves fixing.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-lib.c

index 181b0b5b4f63e70066dc58cfbd9c12f181a4e0cc..6806d407e9c12ab41250e69daffaccca919dd4d6 100644 (file)
@@ -570,6 +570,7 @@ static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
        atapi_error_t error;
 
        status.all = stat;
+       error.all = 0;
        local_irq_set(flags);
        printk("%s: %s: status=0x%02x { ", drive->name, msg, stat);
        if (status.b.bsy)
@@ -584,7 +585,7 @@ static u8 ide_dump_atapi_status(ide_drive_t *drive, const char *msg, u8 stat)
                if (status.b.check)     printk("Error ");
        }
        printk("}\n");
-       if ((status.all & (status.b.bsy|status.b.check)) == status.b.check) {
+       if (status.b.check && !status.b.bsy) {
                error.all = HWIF(drive)->INB(IDE_ERROR_REG);
                printk("%s: %s: error=0x%02x { ", drive->name, msg, error.all);
                if (error.b.ili)        printk("IllegalLengthIndication ");