]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ide: set drive->autotune in ide_pci_setup_ports()
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:12 +0000 (00:30 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:12 +0000 (00:30 +0200)
Majority of host drivers using IDE PCI layer set drive->autotune, the only
exceptions are:

generic.c
ns87415.c
rz1000.c
trm290.c
* no ->set_pio_mode method

it821x.c:
* if memory allocation fails drive->autotune won't be set
  (but there also won't be ->set_pio_mode method in such case)

piix.c:
* MPIIX controller (no ->init_hwif method so also no ->set_pio_mode method)

However if there is no ->set_pio_mode method there are no changes in behavior
w.r.t. PIO tuning so always set drive->autotune in ide_pci_setup_ports().

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
29 files changed:
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/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/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/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/via82cxxx.c
drivers/ide/setup-pci.c

index f3912aa8e576e5ce0602167b355024d379bbeb28..b3dc12a70d51beeb27973b4ac6d9a6174668bbfb 100644 (file)
@@ -192,8 +192,6 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
        else
                hwif->set_dma_mode = &aec6260_set_mode;
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 644e054926e30c887fb0f2ba8310cee15487cf52..8ee2b48d105d8c2a6c1ffc51280478b82b757576 100644 (file)
@@ -668,9 +668,6 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
        if (m5229_revision <= 0xC4)
                hwif->host_flags |= IDE_HFLAG_NO_LBA48_DMA;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index dc2ab1153d3e2e3c62bc7492d68c93c63a3e6e2d..7cafefbf6c1bad40e03729212a0a26e676b21439 100644 (file)
@@ -253,7 +253,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
        for (i = 0; i < 2; i++) {
                hwif->drives[i].io_32bit = 1;
                hwif->drives[i].unmask = 1;
-               hwif->drives[i].autotune = 1;
        }
 
        if (!hwif->dma_base)
index 47e95806c07f8df7d5a304002eda309c1edd9664..307843053078e2847828370d4501fe8b038c5d5a 100644 (file)
@@ -174,8 +174,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
 
        hwif->set_pio_mode = &atiixp_set_pio_mode;
        hwif->set_dma_mode = &atiixp_set_dma_mode;
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 
        if (!hwif->dma_base)
                return;
index 95ca3b6fd352258e6d6e91c2646d4094b8610051..adee2ef6fd710b5a9b973a37d708239cf671b95d 100644 (file)
@@ -506,8 +506,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
        hwif->set_pio_mode = &cmd64x_set_pio_mode;
        hwif->set_dma_mode = &cmd64x_set_dma_mode;
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index fd57efb812b3ee102ac33e5e90bb95c3c7a88481..aa98e817d3852e8b1596445e68d9d511aa2494f1 100644 (file)
@@ -123,9 +123,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
        hwif->set_pio_mode = &cs5520_set_pio_mode;
        hwif->set_dma_mode = &cs5520_set_dma_mode;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 0324a8a88ef4dad2d1fbbfe5caabf43f30cc9444..ba0c6eba024be092f6219ca69c10e9ac62b00c23 100644 (file)
@@ -255,9 +255,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
        if (CS5530_BAD_PIO(inl(basereg + 8)))
                outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8);
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 4360ba30155160e5c5b3f1b9d475033a5dc2ff83..5ac82ffa5c0916a2a2f74af9f5ebe39488dadec8 100644 (file)
@@ -180,8 +180,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
        hwif->set_pio_mode = &cs5535_set_pio_mode;
        hwif->set_dma_mode = &cs5535_set_dma_mode;
 
-       hwif->drives[1].autotune = hwif->drives[0].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index e9502ea51a5e4f80f5861eb107a944b17a512ac1..efc20bd97fd51bbdfb52cc53e44c7a6ced952797 100644 (file)
@@ -431,9 +431,6 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
        hwif->chipset = ide_cy82c693;
        hwif->set_pio_mode = &cy82c693_set_pio_mode;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 0b0c08298348c2f147ede0d3bc9932b146e77d73..67af1a7dde3018321e02a3d215a2506d5877aff3 100644 (file)
@@ -127,9 +127,6 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 {
        hwif->set_pio_mode = &hpt34x_set_pio_mode;
        hwif->set_dma_mode = &hpt34x_set_mode;
-
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 }
 
 static ide_pci_device_t hpt34x_chipsets[] __devinitdata = {
index 3817c7db616e2e1610192a253f9b5658b39fb9a2..18f5b7ddaee606a1571af6b1ad0068295c988abd 100644 (file)
@@ -1301,8 +1301,6 @@ static void __devinit init_hwif_hpt366(ide_hwif_t *hwif)
        if (new_mcr != old_mcr)
                pci_write_config_byte(dev, hwif->select_data + 1, new_mcr);
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index e0c1d50e50d47cc48151bb91e0c8fe31cbd59c96..dfbe605120cb8647e1a63cde9d905fb3a78f3a67 100644 (file)
@@ -170,9 +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->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index 611d0f272fbe6e991ee040da87d7222f0986ceb6..ec45b72472094a594fe676f2415c943ec3450633 100644 (file)
@@ -585,9 +585,6 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
        } else
                hwif->host_flags |= IDE_HFLAG_NO_SET_MODE;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index b058b3a01b30463396970de5302e12997d6f4787..2eeff670d9a624f53c47d77da0acf91b3684e98c 100644 (file)
@@ -111,9 +111,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
        hwif->set_pio_mode = &jmicron_set_pio_mode;
        hwif->set_dma_mode = &jmicron_set_dma_mode;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 0b15c78d278b4b48b86fa683e129afa2d12e24dd..3573ffeaaa3459a24eaf02cec521cd6901ef9171 100644 (file)
@@ -329,9 +329,6 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
        hwif->drives[1].drive_data = PIO_DONT_KNOW;
 
        hwif->set_pio_mode = &opti621_set_pio_mode;
-
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 }
 
 static ide_pci_device_t opti621_chipsets[] __devinitdata = {
index 415a2282fcbb9ed11037d9e9c7dec7a490df1dba..d1e7823454f37406ac250fa17cc2ffe265862257 100644 (file)
@@ -471,8 +471,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
        hwif->quirkproc = &pdcnew_quirkproc;
        hwif->resetproc = &pdcnew_reset;
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index c34e5936a990d30e10474d7ac5b99eb6644299d2..29306121dc4a916780d25c62fa788bdfe7da7100 100644 (file)
@@ -317,8 +317,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
        if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246)
                hwif->resetproc = &pdc202xx_reset;
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 2e29543acff9079d53568e2e9643bddf8803d825..ec0c6e96a213a1512558ee7e7cb9f90a0880146b 100644 (file)
@@ -344,9 +344,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
        hwif->set_pio_mode = &piix_set_pio_mode;
        hwif->set_dma_mode = &piix_set_dma_mode;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index 2471a6dcf6fae2d801ec71fa1335a546ff6ac1f2..b2423e03bf367c590db26e766ca817b9306e563b 100644 (file)
@@ -365,9 +365,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
        hwif->set_pio_mode = &sc1200_set_pio_mode;
        hwif->set_dma_mode = &sc1200_set_dma_mode;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 8ae8f31c41d3f02c01fa94bb716ce981a2a42b52..ae9b50331d2a58d50449fd0109aa1a2fb62538d9 100644 (file)
@@ -683,9 +683,6 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
        hwif->ide_dma_test_irq = scc_dma_test_irq;
        hwif->udma_filter = scc_udma_filter;
 
-       hwif->drives[0].autotune = IDE_TUNE_AUTO;
-       hwif->drives[1].autotune = IDE_TUNE_AUTO;
-
        if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN)
                hwif->ultra_mask = ATA_UDMA6; /* 133MHz */
        else
index 6f95cd29292797b293c2729b20caba6f95e93ab0..a3d880e21d0b53230fd81427b1364d5ab4c86113 100644 (file)
@@ -364,9 +364,6 @@ static void __devinit init_hwif_svwks (ide_hwif_t *hwif)
        hwif->set_dma_mode = &svwks_set_dma_mode;
        hwif->udma_filter = &svwks_udma_filter;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index faf0be31ba5704ddb8f5e7c350ba832f19b3cd1b..689786df1edebb39ee1603da2b8887c5ddd5685b 100644 (file)
@@ -882,8 +882,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
                }
        }
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 674a5bb7955048778d38e7f2222c5ab06c66f39a..c1d280b06391e3a08f79626429f140b7961466d4 100644 (file)
@@ -570,9 +570,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
        if (chipset_family >= ATA_133)
                hwif->udma_filter = sis5513_ata133_udma_filter;
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index ea6d925ac573ff8d490a043ee6c606815b673f4e..0dce459b12698f0bcc9518566bae5c3ee1904be7 100644 (file)
@@ -368,12 +368,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
        hwif->drives[0].io_32bit = hwif->drives[1].io_32bit = 1;
        hwif->drives[0].unmask   = hwif->drives[1].unmask   = 1;
 
-       /*
-        * We always autotune PIO,  this is done before DMA is checked,
-        * so there's no risk of accidentally disabling DMA
-        */
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index d85a48e7deba3ace8d7eebff839f02d80ce81934..4f22dffdf8ef634c674c1c857bbed2459f86a965 100644 (file)
@@ -138,9 +138,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
 
        pci_read_config_byte(hwif->pci_dev, 0x47, &reg47);
 
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
-
        if (hwif->dma_base == 0)
                return;
 
index 04fe9b7f6e72e49f3efaa56f078ffa9108b06464..631506e9b5d27884f4615ac810b6ce9002d99a6f 100644 (file)
@@ -184,8 +184,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
 
        hwif->busproc   = &tc86c001_busproc;
 
-       hwif->drives[0].autotune = hwif->drives[1].autotune = 1;
-
        if (!hwif->dma_base)
                return;
 
index a93dc9bcf9903e09df811a46de93dd1beebcf3e6..30b52f62699a9f1fc40121f33109635c06880b88 100644 (file)
@@ -100,9 +100,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
 {
        hwif->set_pio_mode = &triflex_set_pio_mode;
        hwif->set_dma_mode = &triflex_set_mode;
-
-       hwif->drives[0].autotune = 1;
-       hwif->drives[1].autotune = 1;
 }
 
 static ide_pci_device_t triflex_device __devinitdata = {
index 70e6c44ec69945558616af3fae1b7670075f38f6..c8022a92a0e3fe490fd38ad4fb0cdeaf856fa3a4 100644 (file)
@@ -437,7 +437,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
        for (i = 0; i < 2; i++) {
                hwif->drives[i].io_32bit = 1;
                hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
-               hwif->drives[i].autotune = 1;
        }
 
        if (!hwif->dma_base)
index 7989f521b801dcc70dd42439b1de52a07f8a7ccb..fff567bcedbeed1496603a06c4caec9cc305f73a 100644 (file)
@@ -577,6 +577,9 @@ void ide_pci_setup_ports(struct pci_dev *dev, ide_pci_device_t *d, int pciirq, a
                        hwif->ultra_mask = d->udma_mask;
                }
 
+               hwif->drives[0].autotune = 1;
+               hwif->drives[1].autotune = 1;
+
                if (d->init_hwif)
                        /* Call chipset-specific routine
                         * for each enabled hwif