hpt34x: fix CONFIG_HPT34X_AUTODMA=n handling
PATCH 4/11 hpt34x: fix CONFIG_HPT34X_AUTODMA=n handling
Programming DMA mode may destroy current PIO mode setting so if CONFIG_HPT34X_AUTODMA=n (the default case) make ide_tune_dma() fail early by disabling all host DMA masks and re-tune PIO mode.
This fix doesn't help with the driver being broken but is needed for some other changes.
Signed-off-by Bartlomiej Zolnierkiewicz <[email protected]>
--- drivers/ide/pci/hpt34x.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ide/pci/hpt34x.c +2 -4
@@ -85,11 +85,7 @@ static int hpt34x_config_drive_xfer_rate drive->init_speed =0 ;if (ide_tune_dma (drive)) -#ifndef CONFIG_HPT34X_AUTODMA return -1 ; -#else -return 0 ; -#endif if (ide_use_fast_pio (drive))ide_set_max_pio (drive);
@@ -157,9 +153,11 @@ static void __devinit init_hwif_hpt34x(iif (!hwif->dma_base)return ; +#ifdef CONFIG_HPT34X_AUTODMA hwif->ultra_mask =0x07 ; hwif->mwdma_mask =0x07 ; hwif->swdma_mask =0x07 ; +#endif hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate;if (!noautodma)