aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 0a3a5068f04..a15f1e1cb97 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -792,9 +792,9 @@ int ide_driveid_update(ide_drive_t *drive)
792int ide_config_drive_speed(ide_drive_t *drive, u8 speed) 792int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
793{ 793{
794 ide_hwif_t *hwif = drive->hwif; 794 ide_hwif_t *hwif = drive->hwif;
795 struct ide_io_ports *io_ports = &hwif->io_ports;
796 int error = 0; 795 int error = 0;
797 u8 stat; 796 u8 stat;
797 ide_task_t task;
798 798
799#ifdef CONFIG_BLK_DEV_IDEDMA 799#ifdef CONFIG_BLK_DEV_IDEDMA
800 if (hwif->dma_ops) /* check if host supports DMA */ 800 if (hwif->dma_ops) /* check if host supports DMA */
@@ -828,9 +828,16 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
828 SELECT_MASK(drive, 0); 828 SELECT_MASK(drive, 0);
829 udelay(1); 829 udelay(1);
830 hwif->set_irq(hwif, 0); 830 hwif->set_irq(hwif, 0);
831 hwif->OUTB(SETFEATURES_XFER, io_ports->feature_addr); 831
832 hwif->OUTB(speed, io_ports->nsect_addr); 832 memset(&task, 0, sizeof(task));
833 task.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT;
834 task.tf.feature = SETFEATURES_XFER;
835 task.tf.nsect = speed;
836
837 hwif->tf_load(drive, &task);
838
833 hwif->exec_command(hwif, WIN_SETFEATURES); 839 hwif->exec_command(hwif, WIN_SETFEATURES);
840
834 if (drive->quirk_list == 2) 841 if (drive->quirk_list == 2)
835 hwif->set_irq(hwif, 1); 842 hwif->set_irq(hwif, 1);
836 843