Commit 0b2b5576 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] fix support for PIO modes w/o IORDY flow control

hwif->ide_dma_on() was is in the wrong place in the mode tuning helper
and was also called for devices which do not support IORDY flow control
(such as CompactFlash cards).
parent ce1fa0a1
......@@ -355,13 +355,15 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
aec62xx_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
static int aec62xx_irq_timeout (ide_drive_t *drive)
......
......@@ -484,13 +484,15 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
config_chipset_for_pio(drive, 1);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
static int cmd64x_alt_dma_status (struct pci_dev *dev)
......
......@@ -215,17 +215,19 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
#ifndef CONFIG_HPT34X_AUTODMA
return hwif->ide_dma_off_quietly(drive);
#else
return hwif->ide_dma_on(drive);
#endif
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hpt34x_tune_drive(drive, 255);
return hwif->ide_dma_off_quietly(drive);
}
#ifndef CONFIG_HPT34X_AUTODMA
return hwif->ide_dma_off_quietly(drive);
#endif /* CONFIG_HPT34X_AUTODMA */
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/*
......
......@@ -538,13 +538,15 @@ static int hpt366_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hpt3xx_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/*
......
......@@ -227,13 +227,15 @@ static int it8172_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
it8172_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char *name)
......
......@@ -414,13 +414,15 @@ static int pdcnew_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
static int pdcnew_quirkproc (ide_drive_t *drive)
......
......@@ -518,13 +518,15 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
static int pdc202xx_quirkproc (ide_drive_t *drive)
......
......@@ -588,13 +588,15 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hwif->tuneproc(drive, 255);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/**
......
......@@ -484,6 +484,7 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto no_dma_set;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
......@@ -491,7 +492,8 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
// hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/* This can go soon */
......
......@@ -515,13 +515,15 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
config_chipset_for_pio(drive, 1);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/* returns 1 if dma irq issued, 0 otherwise */
......
......@@ -696,13 +696,15 @@ static int sis5513_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
sis5513_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
/* initiates/aborts (U)DMA read/write operations on a drive. */
......
......@@ -301,13 +301,15 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
} else {
goto fast_ata_pio;
}
return hwif->ide_dma_on(drive);
} else if ((id->capability & 8) || (id->field_valid & 2)) {
fast_ata_pio:
no_dma_set:
hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive);
}
return hwif->ide_dma_on(drive);
/* IORDY not supported */
return 0;
}
#endif /* CONFIG_BLK_DEV_IDEDMA */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment