aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 8c9890414eb2..dc6af24a97d9 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -638,19 +638,22 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
638{ 638{
639 struct request *rq = HWGROUP(drive)->rq; 639 struct request *rq = HWGROUP(drive)->rq;
640 ide_hwif_t *hwif = HWIF(drive); 640 ide_hwif_t *hwif = HWIF(drive);
641 u8 *args = (u8 *) rq->buffer; 641 u8 *args = (u8 *)rq->buffer, pio_in = (args && args[3]) ? 1 : 0, stat;
642 u8 stat = hwif->INB(IDE_STATUS_REG);
643 642
644 local_irq_enable_in_hardirq(); 643 if (pio_in) {
645 if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
646 (stat & DRQ_STAT) && args && args[3]) {
647 u8 io_32bit = drive->io_32bit; 644 u8 io_32bit = drive->io_32bit;
645 stat = hwif->INB(IDE_STATUS_REG);
646 if ((stat & DRQ_STAT) == 0)
647 goto out;
648 drive->io_32bit = 0; 648 drive->io_32bit = 0;
649 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); 649 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
650 drive->io_32bit = io_32bit; 650 drive->io_32bit = io_32bit;
651 stat = wait_drive_not_busy(drive); 651 stat = wait_drive_not_busy(drive);
652 } else {
653 local_irq_enable_in_hardirq();
654 stat = hwif->INB(IDE_STATUS_REG);
652 } 655 }
653 656out:
654 if (!OK_STAT(stat, READY_STAT, BAD_STAT)) 657 if (!OK_STAT(stat, READY_STAT, BAD_STAT))
655 return ide_error(drive, "drive_cmd", stat); 658 return ide_error(drive, "drive_cmd", stat);
656 /* calls ide_end_drive_cmd */ 659 /* calls ide_end_drive_cmd */