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.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index c89f0d3058e9..db22d1ff4e55 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -340,6 +340,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
340 if (args) { 340 if (args) {
341 args[0] = stat; 341 args[0] = stat;
342 args[1] = err; 342 args[1] = err;
343 /* be sure we're looking at the low order bits */
344 hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
343 args[2] = hwif->INB(IDE_NSECTOR_REG); 345 args[2] = hwif->INB(IDE_NSECTOR_REG);
344 args[3] = hwif->INB(IDE_SECTOR_REG); 346 args[3] = hwif->INB(IDE_SECTOR_REG);
345 args[4] = hwif->INB(IDE_LCYL_REG); 347 args[4] = hwif->INB(IDE_LCYL_REG);
@@ -654,7 +656,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
654 int retries = 10; 656 int retries = 10;
655 657
656 local_irq_enable_in_hardirq(); 658 local_irq_enable_in_hardirq();
657 if ((stat & DRQ_STAT) && args && args[3]) { 659 if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
660 (stat & DRQ_STAT) && args && args[3]) {
658 u8 io_32bit = drive->io_32bit; 661 u8 io_32bit = drive->io_32bit;
659 drive->io_32bit = 0; 662 drive->io_32bit = 0;
660 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); 663 hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
@@ -882,7 +885,6 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
882 return do_rw_taskfile(drive, args); 885 return do_rw_taskfile(drive, args);
883 } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { 886 } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) {
884 u8 *args = rq->buffer; 887 u8 *args = rq->buffer;
885 u8 sel;
886 888
887 if (!args) 889 if (!args)
888 goto done; 890 goto done;
@@ -900,10 +902,7 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive,
900 hwif->OUTB(args[3], IDE_SECTOR_REG); 902 hwif->OUTB(args[3], IDE_SECTOR_REG);
901 hwif->OUTB(args[4], IDE_LCYL_REG); 903 hwif->OUTB(args[4], IDE_LCYL_REG);
902 hwif->OUTB(args[5], IDE_HCYL_REG); 904 hwif->OUTB(args[5], IDE_HCYL_REG);
903 sel = (args[6] & ~0x10); 905 hwif->OUTB((args[6] & 0xEF)|drive->select.all, IDE_SELECT_REG);
904 if (drive->select.b.unit)
905 sel |= 0x10;
906 hwif->OUTB(sel, IDE_SELECT_REG);
907 ide_cmd(drive, args[0], args[2], &drive_cmd_intr); 906 ide_cmd(drive, args[0], args[2], &drive_cmd_intr);
908 return ide_started; 907 return ide_started;
909 } else if (rq->cmd_type == REQ_TYPE_ATA_CMD) { 908 } else if (rq->cmd_type == REQ_TYPE_ATA_CMD) {