From 0b2b5576f3190b178aacbe63319c5bca116a746a Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 15 Oct 2003 02:25:24 -0700 Subject: [PATCH] [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). --- drivers/ide/pci/aec62xx.c | 4 +++- drivers/ide/pci/cmd64x.c | 4 +++- drivers/ide/pci/hpt34x.c | 12 +++++++----- drivers/ide/pci/hpt366.c | 4 +++- drivers/ide/pci/it8172.c | 4 +++- drivers/ide/pci/pdc202xx_new.c | 4 +++- drivers/ide/pci/pdc202xx_old.c | 4 +++- drivers/ide/pci/piix.c | 4 +++- drivers/ide/pci/serverworks.c | 4 +++- drivers/ide/pci/siimage.c | 4 +++- drivers/ide/pci/sis5513.c | 4 +++- drivers/ide/pci/slc90e66.c | 4 +++- 12 files changed, 40 insertions(+), 16 deletions(-) diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index 9b67e7897fc43..2b8fe041babed 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c @@ -355,13 +355,15 @@ try_dma_modes: } 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) diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 4559feb89ebca..99a80803712be 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c @@ -484,13 +484,15 @@ try_dma_modes: } 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) diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index b43ed1a60630f..f4da1f9a2bfd9 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c @@ -215,17 +215,19 @@ try_dma_modes: } 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; } /* diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 6d36d39192dc7..4924eebca1e71 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c @@ -538,13 +538,15 @@ try_dma_modes: } 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; } /* diff --git a/drivers/ide/pci/it8172.c b/drivers/ide/pci/it8172.c index 6b86cd0338222..525abe5f201d3 100644 --- a/drivers/ide/pci/it8172.c +++ b/drivers/ide/pci/it8172.c @@ -227,13 +227,15 @@ try_dma_modes: } 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) diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c index 7c60301aa938b..998c3f9929710 100644 --- a/drivers/ide/pci/pdc202xx_new.c +++ b/drivers/ide/pci/pdc202xx_new.c @@ -414,13 +414,15 @@ try_dma_modes: } 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) diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 3ab58903e6a01..51c59cec96b0c 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c @@ -518,13 +518,15 @@ try_dma_modes: } 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) diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 3ed1a33ab88a7..e8679d9cab46b 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c @@ -588,13 +588,15 @@ try_dma_modes: } 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; } /** diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index 513a0c5651d05..66b8d9b4f5fbf 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c @@ -484,6 +484,7 @@ try_dma_modes: } 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 @@ 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; } /* This can go soon */ diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c index 7f59c39beea09..9f56898c23f1c 100644 --- a/drivers/ide/pci/siimage.c +++ b/drivers/ide/pci/siimage.c @@ -515,13 +515,15 @@ try_dma_modes: } 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 */ diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 654bad2ce4ee7..3068287aefb62 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c @@ -696,13 +696,15 @@ try_dma_modes: } 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. */ diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index ae96a90fcc6f3..1f01228f5bb58 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c @@ -301,13 +301,15 @@ try_dma_modes: } 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 */ -- 2.53.0