ide: remove hwif->autodma and drive->autodma
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Tue, 16 Oct 2007 20:29:58 +0000 (22:29 +0200)
* hpt34x.c: disable DMA masks for HPT345
  (hwif->autodma is zero so DMA won't be enabled anyway).

* trm290.c: disable IDE_HFLAG_TRUST_BIOS_FOR_DMA flag
  (hwif->autodma is zero so DMA won't be enabled anyway).

* Check noautodma global variable instead of drive->autodma in ide_tune_dma().

  This fixes handling of "ide=nodma" kernel parameter for icside, ide-cris,
  au1xxx-ide, pmac, it821x, jmicron, sgiioc4 and siimage host drivers.

* Remove hwif->autodma (it was not checked by IDE core code anyway) and
  drive->autodma (was set by all host drivers - except HPT345/TRM290 special
  cases - unless "ide=nodma" was used).

While at it:
- remove needless printk() from icside.c
- remove stale FIXME/comment from ide-probe.c
- don't force DMA off if PCI bus-mastering had to be enabled in setup-pci.c
  (this setting was always later over-ridden by host drivers anyway)

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
41 files changed:
drivers/ide/arm/icside.c
drivers/ide/cris/ide-cris.c
drivers/ide/ide-dma.c
drivers/ide/ide-probe.c
drivers/ide/ide.c
drivers/ide/mips/au1xxx-ide.c
drivers/ide/pci/aec62xx.c
drivers/ide/pci/alim15x3.c
drivers/ide/pci/amd74xx.c
drivers/ide/pci/atiixp.c
drivers/ide/pci/cmd64x.c
drivers/ide/pci/cs5520.c
drivers/ide/pci/cs5530.c
drivers/ide/pci/cs5535.c
drivers/ide/pci/cy82c693.c
drivers/ide/pci/generic.c
drivers/ide/pci/hpt34x.c
drivers/ide/pci/hpt366.c
drivers/ide/pci/it8213.c
drivers/ide/pci/it821x.c
drivers/ide/pci/jmicron.c
drivers/ide/pci/ns87415.c
drivers/ide/pci/opti621.c
drivers/ide/pci/pdc202xx_new.c
drivers/ide/pci/pdc202xx_old.c
drivers/ide/pci/piix.c
drivers/ide/pci/sc1200.c
drivers/ide/pci/scc_pata.c
drivers/ide/pci/serverworks.c
drivers/ide/pci/sgiioc4.c
drivers/ide/pci/siimage.c
drivers/ide/pci/sis5513.c
drivers/ide/pci/sl82c105.c
drivers/ide/pci/slc90e66.c
drivers/ide/pci/tc86c001.c
drivers/ide/pci/triflex.c
drivers/ide/pci/trm290.c
drivers/ide/pci/via82cxxx.c
drivers/ide/ppc/pmac.c
drivers/ide/setup-pci.c
include/linux/ide.h

index 0c6ce2faf8f504fc29dde8ae680eb8ea80bcc9ff..e4875cef78bbad6e229eb1fd5315f60ab4b32a7e 100644 (file)
@@ -415,8 +415,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)
 
 static void icside_dma_init(ide_hwif_t *hwif)
 {
-       printk("    %s: SG-DMA", hwif->name);
-
        hwif->atapi_dma         = 1;
        hwif->mwdma_mask        = 7; /* MW0..2 */
        hwif->swdma_mask        = 7; /* SW0..2 */
@@ -424,7 +422,6 @@ static void icside_dma_init(ide_hwif_t *hwif)
        hwif->dmatable_cpu      = NULL;
        hwif->dmatable_dma      = 0;
        hwif->set_dma_mode      = icside_set_dma_mode;
-       hwif->autodma           = 1;
 
        hwif->dma_host_off      = icside_dma_host_off;
        hwif->dma_off_quietly   = icside_dma_off_quietly;
@@ -437,11 +434,6 @@ static void icside_dma_init(ide_hwif_t *hwif)
        hwif->ide_dma_test_irq  = icside_dma_test_irq;
        hwif->dma_timeout       = icside_dma_timeout;
        hwif->dma_lost_irq      = icside_dma_lost_irq;
-
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
-
-       printk(" capable%s\n", hwif->autodma ? ", auto-enable" : "");
 }
 #else
 #define icside_dma_init(hwif)  (0)
index 1ee078d43dbfbe34b68a7bbe26d613f51327c3d5..06c75f18eb8826e931336ab2b3929f29c312ef91 100644 (file)
@@ -810,9 +810,6 @@ init_e100_ide (void)
                hwif->drives[1].autotune = 1;
                hwif->ultra_mask = cris_ultra_mask;
                hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */
-               hwif->autodma = 1;
-               hwif->drives[0].autodma = 1;
-               hwif->drives[1].autodma = 1;
        }
 
        /* Reset pulse */
index 8ff9de599bf1c635ea8a9e67d7e261e936922028..45fa1ef29d2cbd57a260c23026571ea35919009a 100644 (file)
@@ -759,7 +759,7 @@ static int ide_tune_dma(ide_drive_t *drive)
 {
        u8 speed;
 
-       if ((drive->id->capability & 1) == 0 || drive->autodma == 0)
+       if (noautodma || (drive->id->capability & 1) == 0)
                return 0;
 
        /* consult the list of known "bad" drives */
index c2d69d2d304411fc6af7ab509c27202e74436ff2..41e7a4229fc4fc9c96fc8c30412945d04180ace6 100644 (file)
@@ -835,15 +835,6 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 
                        drive->nice1 = 1;
 
-                       /*
-                        * MAJOR HACK BARF :-/
-                        *
-                        * FIXME: chipsets own this cruft!
-                        */
-                       /*
-                        * Move here to prevent module loading clashing.
-                        */
-       //              drive->autodma = hwif->autodma;
                        if (hwif->ide_dma_on) {
                                /*
                                 * Force DMAing for the beginning of the check.
index 02336595144a65a1af9cffaf166af151f7cd8fe0..27c4fe250701b0c8c234bd6db94af8cd629e8250 100644 (file)
@@ -458,7 +458,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
        hwif->select_data               = tmp_hwif->select_data;
        hwif->extra_base                = tmp_hwif->extra_base;
        hwif->extra_ports               = tmp_hwif->extra_ports;
-       hwif->autodma                   = tmp_hwif->autodma;
 
        hwif->hwif_data                 = tmp_hwif->hwif_data;
 }
index cd00081fb278602c06962e575ed2791f63d90c79..47c035a550e343e9a3515055f52bfa5cd35ca47e 100644 (file)
@@ -700,19 +700,14 @@ static int au_ide_probe(struct device *dev)
        hwif->dma_lost_irq              = &auide_dma_lost_irq;
        hwif->ide_dma_on                = &auide_dma_on;
 
-       hwif->autodma                   = 1;
-       hwif->drives[0].autodma         = hwif->autodma;
-       hwif->drives[1].autodma         = hwif->autodma;
        hwif->atapi_dma                 = 1;
 
 #else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
-       hwif->autodma                   = 0;
        hwif->channel                   = 0;
        hwif->hold                      = 1;
        hwif->select_data               = 0;    /* no chipset-specific code */
        hwif->config_data               = 0;    /* no chipset-specific code */
 
-       hwif->drives[0].autodma         = 0;
        hwif->drives[0].autotune        = 1;    /* 1=autotune, 2=noautotune, 0=default */
 #endif
        hwif->drives[0].no_io_32bit     = 1;   
index df1be18cb4746dd38bb7451e38158772481dc166..3a4c2c26a77e1da218de133db363f7c84e92a53b 100644 (file)
@@ -218,10 +218,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
 
                hwif->cbl = (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
        }
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static int __devinit init_setup_aec62xx(struct pci_dev *dev, ide_pci_device_t *d)
index 0ef7703b036f9494ce75e003bfac827826ec1d83..31d4e50647d5881bbc3b274e0d9e0f59b9338554 100644 (file)
@@ -660,7 +660,6 @@ static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif)
  
 static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
        hwif->set_pio_mode = &ali_set_pio_mode;
        hwif->set_dma_mode = &ali_set_dma_mode;
        hwif->udma_filter = &ali_udma_filter;
@@ -699,12 +698,6 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_ali15x3(hwif);
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 /**
index 669951d8a20d7994bd3a8edcece1ab2550d5644c..c7b3a5650259a9d713dea7a200aa1c30cfc50ebe 100644 (file)
@@ -376,8 +376,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
        if (hwif->irq == 0) /* 0 is bogus but will do for now */
                hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel);
 
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &amd_set_pio_mode;
        hwif->set_dma_mode = &amd_set_drive;
 
@@ -404,11 +402,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
                else
                        hwif->cbl = ATA_CBL_PATA40;
        }
-
-        if (!noautodma)
-                hwif->autodma = 1;
-        hwif->drives[0].autodma = hwif->autodma;
-        hwif->drives[1].autodma = hwif->autodma;
 }
 
 #define DECLARE_AMD_DEV(name_str)                                      \
index 2466e0a04e44cb9299c0e38da5ff7a4743fe805b..446900da1329a6af1eb92e70f66959386947ad4c 100644 (file)
@@ -175,7 +175,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        if (!hwif->irq)
                hwif->irq = ch ? 15 : 14;
 
-       hwif->autodma = 0;
        hwif->set_pio_mode = &atiixp_set_pio_mode;
        hwif->set_dma_mode = &atiixp_set_dma_mode;
        hwif->drives[0].autotune = 1;
@@ -197,12 +196,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 
        hwif->dma_host_on = &atiixp_dma_host_on;
        hwif->dma_host_off = &atiixp_dma_host_off;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[1].autodma = hwif->autodma;
-       hwif->drives[0].autodma = hwif->autodma;
 }
 
 
index 8c6cdb44f00ce8b14af10b8c5c6f4eab0236d384..f3d3bde8daba7596436de42b00df10de31fd32df 100644 (file)
@@ -559,10 +559,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
                hwif->ide_dma_test_irq  = &cmd64x_ide_dma_test_irq;
                break;
        }
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static int __devinit init_setup_cmd64x(struct pci_dev *dev, ide_pci_device_t *d)
index 6ea6465f49c7381f126090e19c9e80a285db30a2..a8bf4940ca9c3941461b1c6c4bdc2c73a793d8fe 100644 (file)
@@ -146,12 +146,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
        hwif->ultra_mask = 0;
        hwif->swdma_mask = 0;
        hwif->mwdma_mask = 0;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 #define DECLARE_CS_DEV(name_str)                               \
index ef51bbfd2cba2b884677d7f26fe545749b5d8131..0d23b8aabe9ca4989a453a274ef313c4750f2aca 100644 (file)
@@ -244,7 +244,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
 {
        unsigned long basereg;
        u32 d0_timings;
-       hwif->autodma = 0;
 
        if (hwif->mate)
                hwif->serialized = hwif->mate->serialized = 1;
@@ -270,11 +269,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
        hwif->mwdma_mask = 0x07;
 
        hwif->udma_filter = cs5530_udma_filter;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t cs5530_chipset __devinitdata = {
index 5ddd4c546ead79f728d8c8b5137d79c8e3426a0c..e4891a16afeff3f076700c1d9d506b657a747d71 100644 (file)
@@ -177,8 +177,6 @@ static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
  */
 static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &cs5535_set_pio_mode;
        hwif->set_dma_mode = &cs5535_set_dma_mode;
 
@@ -192,11 +190,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
        hwif->mwdma_mask = 0x07;
 
        hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t cs5535_chipset __devinitdata = {
index 31850836ff7eba4b883d0f7bd6652bb331b2904c..c498ecfd7fcb35d9f813fa510adff7b39ecfc909 100644 (file)
@@ -428,8 +428,6 @@ static unsigned int __devinit init_chipset_cy82c693(struct pci_dev *dev, const c
  */
 static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
-
        hwif->chipset = ide_cy82c693;
        hwif->set_pio_mode = &cy82c693_set_pio_mode;
 
@@ -444,10 +442,6 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
        hwif->swdma_mask = 0x04;
 
        hwif->ide_dma_on = &cy82c693_ide_dma_on;
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static __devinitdata ide_hwif_t *primary;
index fef945f86082fa759b02d59298cdb52cf2edb0ca..cce6311b02df73660eb3bb697ab11c7a377bc556 100644 (file)
@@ -73,11 +73,6 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 #if 0
index 88472e5a3ec7a3f43ff02685701ed80483de8496..44ac0e2f7a09cdd8f3fca871ec13712c94c8c619 100644 (file)
@@ -127,8 +127,6 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 {
        u16 pcicmd = 0;
 
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &hpt34x_set_pio_mode;
        hwif->set_dma_mode = &hpt34x_set_mode;
 
@@ -141,15 +139,13 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
                return;
 
 #ifdef CONFIG_HPT34X_AUTODMA
+       if ((pcicmd & PCI_COMMAND_MEMORY) == 0)
+               return;
+
        hwif->ultra_mask = 0x07;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
 #endif
-
-       if (!noautodma)
-               hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t hpt34x_chipset __devinitdata = {
index 6b0daea5abb88f74f6a0cbca117ae436a54aa748..fcb21ddab2cc6d69415147a9fcb742f33b8e02a4 100644 (file)
@@ -1345,10 +1345,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
                hwif->dma_timeout       = &hpt370_dma_timeout;
        } else
                hwif->dma_lost_irq      = &hpt366_dma_lost_irq;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
index 5822d2641959432ab28653c7fbcbe31a286100b8..24a71d03744a35bb88d3e68f30c15a4a972ebd93 100644 (file)
@@ -170,8 +170,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
        hwif->set_dma_mode = &it8213_set_dma_mode;
        hwif->set_pio_mode = &it8213_set_pio_mode;
 
-       hwif->autodma = 0;
-
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
@@ -187,16 +185,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
-
-       /*
-        *      The BIOS often doesn't set up DMA on this controller
-        *      so we always do it.
-        */
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 
index 752a142ca89b31f1ea99aeb300798e94519b5726..f3391a8698ac65fed5d55afd258e18f65a1048a5 100644 (file)
@@ -537,10 +537,11 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
        struct it821x_dev *idev = kzalloc(sizeof(struct it821x_dev), GFP_KERNEL);
        u8 conf;
 
-       if(idev == NULL) {
+       if (idev == NULL) {
                printk(KERN_ERR "it821x: out of memory, falling back to legacy behaviour.\n");
-               goto fallback;
+               return;
        }
+
        ide_set_hwifdata(hwif, idev);
 
        hwif->atapi_dma = 1;
@@ -589,27 +590,14 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
-       if (!hwif->dma_base)
-               goto fallback;
+       if (hwif->dma_base == 0)
+               return;
 
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_it821x(hwif);
-
-       /*
-        *      The BIOS often doesn't set up DMA on this controller
-        *      so we always do it.
-        */
-
-       hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
-       return;
-fallback:
-       hwif->autodma = 0;
-       return;
 }
 
 static void __devinit it8212_disable_raid(struct pci_dev *dev)
index e4a4f1fb5be79ea163f204ea3941c2b3bff92dd6..bb893ffcc987f646e5ad651249cb44388a9fb542 100644 (file)
@@ -114,8 +114,8 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
-       if (!hwif->dma_base)
-               goto fallback;
+       if (hwif->dma_base == 0)
+               return;
 
        hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x7f;
@@ -123,14 +123,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_jmicron(hwif);
-
-       hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
-       return;
-fallback:
-       hwif->autodma = 0;
-       return;
 }
 
 static ide_pci_device_t jmicron_chipset __devinitdata = {
index 726f67cc85d0edc93660c2ab48235f4cc2055a2f..a8cd50ab62fb5ed2216d52a0e7e0f3320cc28b73 100644 (file)
@@ -197,7 +197,6 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
        u8 stat;
 #endif
 
-       hwif->autodma = 0;
        hwif->selectproc = &ns87415_selectproc;
 
        /*
@@ -259,11 +258,6 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
        outb(0x60, hwif->dma_status);
        hwif->dma_setup = &ns87415_ide_dma_setup;
        hwif->ide_dma_end = &ns87415_ide_dma_end;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t ns87415_chipset __devinitdata = {
index aa8b6c510d2e975cde8dd0e0ebcd2ca2c9fc3f74..250662ea18ad837b608a6272249cb638c4f8fabb 100644 (file)
@@ -328,7 +328,6 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
  */
 static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
        hwif->drives[0].drive_data = PIO_DONT_KNOW;
        hwif->drives[1].drive_data = PIO_DONT_KNOW;
 
@@ -340,11 +339,6 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
        hwif->atapi_dma = 1;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t opti621_chipsets[] __devinitdata = {
index d1087cc83f1289ab09882156cf954f3cd9a8ca31..8704b6f33312636034d0a6a33cbdffe1df3fea62 100644 (file)
@@ -469,8 +469,6 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
 
 static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &pdcnew_set_pio_mode;
        hwif->set_dma_mode = &pdcnew_set_mode;
 
@@ -491,10 +489,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = pdcnew_cable_detect(hwif);
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static int __devinit init_setup_pdcnew(struct pci_dev *dev, ide_pci_device_t *d)
index 21b41436ae4a3198c833732470e1eb9faeb6632e..e1d2337a9f1d563af10b1a4253495997d6a7adac 100644 (file)
@@ -312,8 +312,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
            (dev->device == PCI_DEVICE_ID_PROMISE_20265))
                hwif->rqsize = 256;
 
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &pdc202xx_set_pio_mode;
        hwif->set_dma_mode = &pdc202xx_set_mode;
 
@@ -345,10 +343,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
                hwif->ide_dma_end = &pdc202xx_old_ide_dma_end;
        } 
        hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static void __devinit init_dma_pdc202xx(ide_hwif_t *hwif, unsigned long dmabase)
index c50ae3ab2e646a7c92a20879ab33c14afd572b67..a8dd0c0add351890dadfc5659ff2270d3f8b3b5a 100644 (file)
@@ -384,8 +384,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
                return;
        }
 
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &piix_set_pio_mode;
        hwif->set_dma_mode = &piix_set_dma_mode;
 
@@ -412,12 +410,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
 
        if (no_piix_dma)
                hwif->ultra_mask = hwif->mwdma_mask = hwif->swdma_mask = 0;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[1].autodma = hwif->autodma;
-       hwif->drives[0].autodma = hwif->autodma;
 }
 
 #define DECLARE_PIIX_DEV(name_str, udma) \
index 29945b99161e7950ca21133d69f658efd88aa2d3..54c5c98a2e2655f32b32b4b0fa3335f8ac3df1c7 100644 (file)
@@ -364,7 +364,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
 {
        if (hwif->mate)
                hwif->serialized = hwif->mate->serialized = 1;
-       hwif->autodma = 0;
 
        hwif->set_pio_mode = &sc1200_set_pio_mode;
        hwif->set_dma_mode = &sc1200_set_dma_mode;
@@ -378,15 +377,9 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
        hwif->udma_filter = sc1200_udma_filter;
        hwif->ide_dma_end   = &sc1200_ide_dma_end;
 
-       if (!noautodma)
-               hwif->autodma = 1;
-
         hwif->atapi_dma = 1;
         hwif->ultra_mask = 0x07;
         hwif->mwdma_mask = 0x07;
-
-        hwif->drives[0].autodma = hwif->autodma;
-        hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t sc1200_chipset __devinitdata = {
index 0a66991063ebdd5e8c05de69b15550b9fb9da320..bd4c1d3070e4961c7fee4cb20337a0d1ff8a729e 100644 (file)
@@ -697,12 +697,6 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
 
        /* we support 80c cable only. */
        hwif->cbl = ATA_CBL_PATA80;
-
-       hwif->autodma = 0;
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 #define DECLARE_SCC_DEV(name_str)                      \
index e4208e3d9901ced209e660fff3dc3c4efb6df4cc..d3ffc52e22aff340ee55e71c4a6a9fda91472e10 100644 (file)
@@ -374,8 +374,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
 
        hwif->mwdma_mask = 0x07;
 
-       hwif->autodma = 0;
-
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
 
@@ -386,10 +384,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
                if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                        hwif->cbl = ata66_svwks(hwif);
        }
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[0].autodma = hwif->drives[1].autodma = 1;
 }
 
 static int __devinit init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d)
index 210f32d1e93cd6fc7c2351913ba47eae0350801c..9a9474f534e5e8a7676236c8c8c67d87e187f7d8 100644 (file)
@@ -674,12 +674,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
        /* Initializing chipset IRQ Registers */
        writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
 
-       hwif->autodma = 0;
-
-       if (dma_base && ide_dma_sgiioc4(hwif, dma_base) == 0) {
-               hwif->autodma = 1;
-               hwif->drives[1].autodma = hwif->drives[0].autodma = 1;
-       } else
+       if (dma_base == 0 || ide_dma_sgiioc4(hwif, dma_base))
                printk(KERN_INFO "%s: %s Bus-Master DMA disabled\n",
                                 hwif->name, DRV_NAME);
 
index cc1706798a14f53b4230f0ea0eacecbbfe176fa9..85d0afd00e660e828744d88808d829e6eda1c431 100644 (file)
@@ -873,8 +873,6 @@ static u8 __devinit ata66_siimage(ide_hwif_t *hwif)
 
 static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
 {
-       hwif->autodma = 0;
-       
        hwif->resetproc = &siimage_reset;
        hwif->set_pio_mode = &sil_set_pio_mode;
        hwif->set_dma_mode = &sil_set_dma_mode;
@@ -912,15 +910,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
        } else {
                hwif->ide_dma_test_irq = & siimage_io_ide_dma_test_irq;
        }
-       
-       /*
-        *      The BIOS often doesn't set up DMA on this controller
-        *      so we always do it.
-        */
-
-       hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 #define DECLARE_SII_DEV(name_str)                      \
index 729ee86e75cc5a599816c7e2f6d60580488226f5..d758865f06bea78002d968cf36fdf8eed29c0114 100644 (file)
@@ -811,8 +811,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
 {
        u8 udma_rates[] = { 0x00, 0x00, 0x07, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f };
 
-       hwif->autodma = 0;
-
        if (!hwif->irq)
                hwif->irq = hwif->channel ? 15 : 14;
 
@@ -835,12 +833,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_sis5513(hwif);
-
-       if (!noautodma)
-               hwif->autodma = 1;
-
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t sis5513_chipset __devinitdata = {
index 92726292af32744746dc0731d068bc8bc0e8f79f..771efb8884c8d37eec36e5fb79a7fb1a416246c2 100644 (file)
@@ -397,10 +397,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
        hwif->dma_start                 = &sl82c105_dma_start;
        hwif->dma_timeout               = &sl82c105_dma_timeout;
 
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
-
        if (hwif->mate)
                hwif->serialized = hwif->mate->serialized = 1;
 }
index 3e6ed73feb6ceaaa7ff1aa37d9d4d7224a710dd1..fa8df6d43832b11ebd0686f1d51a52ab6253db07 100644 (file)
@@ -133,8 +133,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
        u8 reg47 = 0;
        u8 mask = hwif->channel ? 0x01 : 0x02;  /* bit0:Primary */
 
-       hwif->autodma = 0;
-
        if (!hwif->irq)
                hwif->irq = hwif->channel ? 15 : 14;
 
@@ -157,11 +155,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                /* bit[0(1)]: 0:80, 1:40 */
                hwif->cbl = (reg47 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t slc90e66_chipset __devinitdata = {
index 01360ee813e1f7627566a4d364caa8117013ad8c..de62db576adcf50647d815c8cfc0f66b88dc6b89 100644 (file)
@@ -212,10 +212,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
                scr1 = hwif->INW(sc_base + 0x00);
                hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
        }
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma;
 }
 
 static unsigned int __devinit init_chipset_tc86c001(struct pci_dev *dev,
index 9bedeae30c4ae8fcd5a57c0c8db52ea96a28cada..4075c907f05cf4bea497cb017786919c56979ba9 100644 (file)
@@ -107,11 +107,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
        hwif->atapi_dma  = 1;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
-       
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t triflex_device __devinitdata = {
index 88174488c8864c9cc88bd3fec390ed2eafd97c27..e3d943ada7b0d5be11743c2f426eb10de88f6174 100644 (file)
@@ -292,9 +292,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
        hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
 
        hwif->selectproc = &trm290_selectproc;
-       hwif->autodma = 0;              /* play it safe for now */
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 #if 1
        {
        /*
@@ -329,7 +326,9 @@ static ide_pci_device_t trm290_chipset __devinitdata = {
        .init_hwif      = init_hwif_trm290,
        .autodma        = NOAUTODMA,
        .bootable       = ON_BOARD,
+#if 0 /* play it safe for now */
        .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
+#endif
 };
 
 static int __devinit trm290_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 5f13f3a23f15823194dfcbce57651882d74f1c33..bf9957fe21a80b84357157fda46d10ac8e7e42c8 100644 (file)
@@ -425,8 +425,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
        struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
        int i;
 
-       hwif->autodma = 0;
-
        hwif->set_pio_mode = &via_set_pio_mode;
        hwif->set_dma_mode = &via_set_drive;
 
@@ -454,11 +452,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = via82cxxx_cable_detect(hwif);
-
-       if (!noautodma)
-               hwif->autodma = 1;
-       hwif->drives[0].autodma = hwif->autodma;
-       hwif->drives[1].autodma = hwif->autodma;
 }
 
 static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
index 182f9a6a8a2772014c2e11b5bfde2180cbda1c55..1d25a3433008699dca36c172d610fff87d278033 100644 (file)
@@ -1804,9 +1804,6 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
                        hwif->swdma_mask = 0x00;
                        break;
        }
-
-       hwif->autodma = 1;
-       hwif->drives[1].autodma = hwif->drives[0].autodma = hwif->autodma;
 }
 
 #endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */
index f620da42e157a7cb6cc4ffacbb6299e2c52ee5f6..3d101f73f9108399ba093e7a0ae4e3fdfdc6331b 100644 (file)
@@ -438,8 +438,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi
                         * Set up BM-DMA capability
                         * (PnP BIOS should have done this)
                         */
-                       /* default DMA off if we had to configure it here */
-                       hwif->autodma = 0;
                        pci_set_master(dev);
                        if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || !(pcicmd & PCI_COMMAND_MASTER)) {
                                printk(KERN_ERR "%s: %s error updating PCICMD\n",
index c144c7f2605a91462283855d8d32e1c43acd2a03..79652c5c0ea5f84b57f588056783c03e88935a58 100644 (file)
@@ -576,7 +576,6 @@ typedef struct ide_drive_s {
        select_t        select;         /* basic drive/head select reg value */
 
        u8      keep_settings;          /* restore settings after drive reset */
-       u8      autodma;                /* device can safely use dma on host */
        u8      using_dma;              /* disk is using dma for read/write */
        u8      retry_pio;              /* retrying dma capable host in pio */
        u8      state;                  /* retry state */
@@ -797,7 +796,6 @@ typedef struct hwif_s {
        unsigned        serialized : 1; /* serialized all channel operation */
        unsigned        sharing_irq: 1; /* 1 = sharing irq with another hwif */
        unsigned        reset      : 1; /* reset after probe */
-       unsigned        autodma    : 1; /* auto-attempt using DMA at boot */
        unsigned        no_lba48   : 1; /* 1 = cannot do LBA48 */
        unsigned        no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */
        unsigned        auto_poll  : 1; /* supports nop auto-poll */