ide: disable DMA in ->ide_dma_check for "no IORDY" case (v2)

If DMA is unsupported ->ide_dma_check should disable DMA.

v2:
* updated for scc_pata
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 2ad1e558
...@@ -214,12 +214,10 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -214,12 +214,10 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
aec62xx_tune_drive(drive, 5); aec62xx_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static int aec62xx_irq_timeout (ide_drive_t *drive) static int aec62xx_irq_timeout (ide_drive_t *drive)
......
...@@ -264,10 +264,9 @@ static int atiixp_dma_check(ide_drive_t *drive) ...@@ -264,10 +264,9 @@ static int atiixp_dma_check(ide_drive_t *drive)
tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0; speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
hwif->speedproc(drive, speed); hwif->speedproc(drive, speed);
return hwif->ide_dma_off_quietly(drive);
} }
/* IORDY not supported */
return 0; return hwif->ide_dma_off_quietly(drive);
} }
/** /**
......
...@@ -479,12 +479,10 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive) ...@@ -479,12 +479,10 @@ static int cmd64x_config_drive_for_dma (ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
config_chipset_for_pio(drive, 1); config_chipset_for_pio(drive, 1);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static int cmd64x_alt_dma_status (struct pci_dev *dev) static int cmd64x_alt_dma_status (struct pci_dev *dev)
......
...@@ -206,10 +206,9 @@ static int cs5535_dma_check(ide_drive_t *drive) ...@@ -206,10 +206,9 @@ static int cs5535_dma_check(ide_drive_t *drive)
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive)) {
speed = ide_get_best_pio_mode(drive, 255, 4, NULL); speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
cs5535_set_drive(drive, speed); cs5535_set_drive(drive, speed);
return hwif->ide_dma_off_quietly(drive);
} }
/* IORDY not supported */
return 0; return hwif->ide_dma_off_quietly(drive);
} }
static u8 __devinit cs5535_cable_detect(struct pci_dev *dev) static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
......
...@@ -120,12 +120,10 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -120,12 +120,10 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
#endif #endif
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
hpt34x_tune_drive(drive, 255); hpt34x_tune_drive(drive, 255);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
/* /*
......
...@@ -743,12 +743,10 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive) ...@@ -743,12 +743,10 @@ static int hpt366_config_drive_xfer_rate(ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
hpt3xx_tune_drive(drive, 255); hpt3xx_tune_drive(drive, 255);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
/* /*
......
...@@ -288,12 +288,10 @@ static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive) ...@@ -288,12 +288,10 @@ static int pdcnew_config_drive_xfer_rate(ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
hwif->tuneproc(drive, 255); hwif->tuneproc(drive, 255);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static int pdcnew_quirkproc(ide_drive_t *drive) static int pdcnew_quirkproc(ide_drive_t *drive)
......
...@@ -329,12 +329,10 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -329,12 +329,10 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
pdc202xx_tune_drive(drive, 255); pdc202xx_tune_drive(drive, 255);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static int pdc202xx_quirkproc (ide_drive_t *drive) static int pdc202xx_quirkproc (ide_drive_t *drive)
......
...@@ -393,14 +393,12 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -393,14 +393,12 @@ static int piix_config_drive_xfer_rate (ide_drive_t *drive)
if (ide_use_dma(drive) && piix_config_drive_for_dma(drive)) if (ide_use_dma(drive) && piix_config_drive_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
/* Find best PIO mode. */ /* Find best PIO mode. */
(void) hwif->speedproc(drive, XFER_PIO_0 + (void) hwif->speedproc(drive, XFER_PIO_0 +
ide_get_best_pio_mode(drive, 255, 4, NULL)); ide_get_best_pio_mode(drive, 255, 4, NULL));
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
/** /**
......
...@@ -322,13 +322,10 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -322,13 +322,10 @@ static int svwks_config_drive_xfer_rate (ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
config_chipset_for_pio(drive); config_chipset_for_pio(drive);
// hwif->tuneproc(drive, 5);
return hwif->ide_dma_off_quietly(drive); return hwif->ide_dma_off_quietly(drive);
}
/* IORDY not supported */
return 0;
} }
static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name) static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const char *name)
......
...@@ -419,12 +419,10 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive) ...@@ -419,12 +419,10 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
config_chipset_for_pio(drive, 1); config_chipset_for_pio(drive, 1);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
/* returns 1 if dma irq issued, 0 otherwise */ /* returns 1 if dma irq issued, 0 otherwise */
......
...@@ -678,12 +678,10 @@ static int sis5513_config_xfer_rate(ide_drive_t *drive) ...@@ -678,12 +678,10 @@ static int sis5513_config_xfer_rate(ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
sis5513_tune_drive(drive, 5); sis5513_tune_drive(drive, 5);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
/* Chip detection and general config */ /* Chip detection and general config */
......
...@@ -186,13 +186,11 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) ...@@ -186,13 +186,11 @@ static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive)
if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive)) if (ide_use_dma(drive) && slc90e66_config_drive_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
(void) hwif->speedproc(drive, XFER_PIO_0 + (void) hwif->speedproc(drive, XFER_PIO_0 +
ide_get_best_pio_mode(drive, 255, 4, NULL)); ide_get_best_pio_mode(drive, 255, 4, NULL));
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif) static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
......
...@@ -190,12 +190,10 @@ static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive) ...@@ -190,12 +190,10 @@ static int tc86c001_config_drive_xfer_rate(ide_drive_t *drive)
if (ide_use_dma(drive) && config_chipset_for_dma(drive)) if (ide_use_dma(drive) && config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
tc86c001_tune_drive(drive, 255); tc86c001_tune_drive(drive, 255);
return hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
/* IORDY not supported */
return 0;
} }
static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
......
...@@ -376,11 +376,10 @@ static int scc_config_drive_for_dma(ide_drive_t *drive) ...@@ -376,11 +376,10 @@ static int scc_config_drive_for_dma(ide_drive_t *drive)
if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive)) if (ide_use_dma(drive) && scc_config_chipset_for_dma(drive))
return hwif->ide_dma_on(drive); return hwif->ide_dma_on(drive);
if (ide_use_fast_pio(drive)) { if (ide_use_fast_pio(drive))
hwif->tuneproc(drive, 4); hwif->tuneproc(drive, 4);
hwif->ide_dma_off_quietly(drive);
} return hwif->ide_dma_off_quietly(drive);
return 1; /* DMA is not supported */
} }
/** /**
......
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