aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:12 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:12 -0500
commit4d977e43d8ae758434e603cf2455d955f71c77c4 (patch)
treeef8f0922ba6e75d270d111dc78b3644321cb6c11 /drivers/ide
parent18a056feccabdfa9764016a615121b194828bc72 (diff)
ide: check BUSY and ERROR status bits before reading data in drive_cmd_intr()
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/ide-io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index dc6af24a97d9..ce8ab1085936 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -643,8 +643,13 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
643 if (pio_in) { 643 if (pio_in) {
644 u8 io_32bit = drive->io_32bit; 644 u8 io_32bit = drive->io_32bit;
645 stat = hwif->INB(IDE_STATUS_REG); 645 stat = hwif->INB(IDE_STATUS_REG);
646 if ((stat & DRQ_STAT) == 0) 646 if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
647 goto out; 647 if (stat & (ERR_STAT | DRQ_STAT))
648 return ide_error(drive, __FUNCTION__, stat);
649 ide_set_handler(drive, &drive_cmd_intr, WAIT_WORSTCASE,
650 NULL);
651 return ide_started;
652 }
648 drive->io_32bit = 0; 653 drive->io_32bit = 0;
649 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); 654 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
650 drive->io_32bit = io_32bit; 655 drive->io_32bit = io_32bit;
@@ -653,7 +658,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
653 local_irq_enable_in_hardirq(); 658 local_irq_enable_in_hardirq();
654 stat = hwif->INB(IDE_STATUS_REG); 659 stat = hwif->INB(IDE_STATUS_REG);
655 } 660 }
656out: 661
657 if (!OK_STAT(stat, READY_STAT, BAD_STAT)) 662 if (!OK_STAT(stat, READY_STAT, BAD_STAT))
658 return ide_error(drive, "drive_cmd", stat); 663 return ide_error(drive, "drive_cmd", stat);
659 /* calls ide_end_drive_cmd */ 664 /* calls ide_end_drive_cmd */