Messages in this thread Patch in this message | | | Date | Tue, 25 Jun 2002 21:31:34 +0200 (MET DST) | From | Bartlomiej Zolnierkiewicz <> | Subject | [PATCH] ATA: cleanup of channel->autodma flags usage |
| |
incremental to generic ATA PCI auto-dma patches...
- clean usage of ch->autodma flag in PCI host chips drivers
- remove ATA_F_NOAUTODMA flag from aec62xx.c, hpt34x.c, sis5513.c and via82cxxx.c drivers, it's use was bogus in these drivers
only two usages of ATA_F_NOAUTODMA are left (in ide-pci.c), probably they can alse be removed due to fact that drivers should disable autodma not ide-pci (i.e. hpt34x)
- teach alim15x3.c, cs5530.c, cy82c693.c, hpt34x.c, hpt366.c, it8172.c, pdc202xx.c, sis5513.c, sl82c105.c, and trm290.c drivers about CONFIG_IDEDMA_AUTO (indirectly through ide-pci)
- make it possible to auto-tune DMA for trm290.c
- always check PIO timings in cs5530.c
-- Bartlomiej Zolnierkiewicz diff -ur linux-ata-hosts-11/drivers/ide/aec62xx.c linux/drivers/ide/aec62xx.c --- linux-ata-hosts-11/drivers/ide/aec62xx.c Mon Jun 24 22:35:10 2002 +++ linux/drivers/ide/aec62xx.c Mon Jun 24 23:55:15 2002 @@ -251,7 +251,6 @@ ch->tuneproc = aec62xx_tune_drive; ch->speedproc = aec_set_drive; - ch->autodma = 0; ch->io_32bit = 1; ch->unmask = 1; @@ -266,10 +265,6 @@ ch->highmem = 1; ch->modes_map = aec62xx_modes_map(ch); ch->udma_setup = udma_generic_setup; -#ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - ch->autodma = 1; -#endif } #endif } @@ -306,7 +301,7 @@ init_channel: aec62xx_init_channel, enablebits: { {0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, bootable: NEVER_BOARD, - flags: ATA_F_IRQ | ATA_F_NOADMA | ATA_F_DMA + flags: ATA_F_IRQ | ATA_F_DMA }, { vendor: PCI_VENDOR_ID_ARTOP, diff -ur linux-ata-hosts-11/drivers/ide/alim15x3.c linux/drivers/ide/alim15x3.c --- linux-ata-hosts-11/drivers/ide/alim15x3.c Mon Jun 24 22:43:20 2002 +++ linux/drivers/ide/alim15x3.c Tue Jun 25 00:09:09 2002 @@ -354,13 +354,7 @@ hwif->no_atapi_autodma = 1; hwif->udma_setup = ali15x3_udma_setup; hwif->udma_init = ali15x3_udma_init; - hwif->autodma = 1; } - - if (noautodma) - hwif->autodma = 0; -#else - hwif->autodma = 0; #endif } diff -ur linux-ata-hosts-11/drivers/ide/amd74xx.c linux/drivers/ide/amd74xx.c --- linux-ata-hosts-11/drivers/ide/amd74xx.c Mon Jun 24 22:35:10 2002 +++ linux/drivers/ide/amd74xx.c Mon Jun 24 23:28:50 2002 @@ -270,7 +270,6 @@ hwif->tuneproc = &amd74xx_tune_drive; hwif->speedproc = &amd_set_drive; - hwif->autodma = 0; hwif->io_32bit = 1; hwif->unmask = 1; @@ -285,10 +284,6 @@ hwif->highmem = 1; hwif->modes_map = amd_modes_map(hwif); hwif->udma_setup = udma_generic_setup; -# ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -# endif } #endif } diff -ur linux-ata-hosts-11/drivers/ide/cmd64x.c linux/drivers/ide/cmd64x.c --- linux-ata-hosts-11/drivers/ide/cmd64x.c Mon Jun 24 22:36:13 2002 +++ linux/drivers/ide/cmd64x.c Mon Jun 24 23:29:08 2002 @@ -804,10 +804,6 @@ hwif->modes_map = cmd6xx_modes_map(hwif); hwif->no_atapi_autodma = 1; hwif->udma_setup = udma_generic_setup; -# ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -# endif } #endif } diff -ur linux-ata-hosts-11/drivers/ide/cs5530.c linux/drivers/ide/cs5530.c --- linux-ata-hosts-11/drivers/ide/cs5530.c Mon Jun 24 22:40:40 2002 +++ linux/drivers/ide/cs5530.c Mon Jun 24 23:29:44 2002 @@ -285,17 +285,15 @@ */ static void __init ide_init_cs5530(struct ata_channel *hwif) { + u32 basereg, d0_timings; + hwif->serialized = 1; - if (!hwif->dma_base) { - hwif->autodma = 0; - } else { - unsigned int basereg, d0_timings; #ifdef CONFIG_BLK_DEV_IDEDMA - hwif->udma_setup = cs5530_udma_setup; - hwif->highmem = 1; -#else - hwif->autodma = 0; + if (hwif->dma_base) { + hwif->highmem = 1; + hwif->udma_setup = cs5530_udma_setup; + } #endif hwif->tuneproc = &cs5530_tuneproc; @@ -309,7 +309,6 @@ if (!hwif->drives[1].autotune) hwif->drives[1].autotune = 1; /* needs autotuning later */ } - } } diff -ur linux-ata-hosts-11/drivers/ide/cy82c693.c linux/drivers/ide/cy82c693.c --- linux-ata-hosts-11/drivers/ide/cy82c693.c Mon Jun 24 22:40:40 2002 +++ linux/drivers/ide/cy82c693.c Mon Jun 24 23:29:57 2002 @@ -414,14 +414,11 @@ hwif->tuneproc = cy82c693_tune_drive; hwif->drives[0].autotune = 1; hwif->drives[1].autotune = 1; - hwif->autodma = 0; #ifdef CONFIG_BLK_DEV_IDEDMA if (hwif->dma_base) { hwif->highmem = 1; hwif->udma_setup = cy82c693_udma_setup; - if (!noautodma) - hwif->autodma = 1; } #endif } diff -ur linux-ata-hosts-11/drivers/ide/hpt34x.c linux/drivers/ide/hpt34x.c --- linux-ata-hosts-11/drivers/ide/hpt34x.c Mon Jun 24 22:43:20 2002 +++ linux/drivers/ide/hpt34x.c Mon Jun 24 23:55:02 2002 @@ -182,26 +182,21 @@ unsigned short pcicmd = 0; pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); - if (!noautodma) - hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; - else - hwif->autodma = 0; - +#ifdef CONFIG_IDEDMA_AUTO + hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; +#endif hwif->udma_stop = hpt34x_udma_stop; hwif->udma_init = hpt34x_udma_init; hwif->modes_map = XFER_EPIO | XFER_SWDMA | XFER_MWDMA | XFER_UDMA; hwif->no_atapi_autodma = 1; hwif->udma_setup = hpt34x_udma_setup; hwif->highmem = 1; - } else { + } else +#endif + { hwif->drives[0].autotune = 1; hwif->drives[1].autotune = 1; } -#else - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; -#endif } @@ -213,7 +208,7 @@ init_channel: ide_init_hpt34x, bootable: NEVER_BOARD, extra: 16, - flags: ATA_F_NOADMA | ATA_F_DMA + flags: ATA_F_DMA }; int __init init_hpt34x(void) diff -ur linux-ata-hosts-11/drivers/ide/hpt366.c linux/drivers/ide/hpt366.c --- linux-ata-hosts-11/drivers/ide/hpt366.c Mon Jun 24 22:43:20 2002 +++ linux/drivers/ide/hpt366.c Mon Jun 24 23:30:39 2002 @@ -1187,16 +1187,10 @@ } ch->modes_map = hpt3xx_modes_map(ch); ch->udma_setup = hpt3xx_udma_setup; - - if (!noautodma) - ch->autodma = 1; - else - ch->autodma = 0; ch->highmem = 1; } else #endif { - ch->autodma = 0; ch->drives[0].autotune = 1; ch->drives[1].autotune = 1; } diff -ur linux-ata-hosts-11/drivers/ide/ide-pci.c linux/drivers/ide/ide-pci.c --- linux-ata-hosts-11/drivers/ide/ide-pci.c Mon Jun 10 23:17:37 2002 +++ linux/drivers/ide/ide-pci.c Tue Jun 25 00:03:46 2002 @@ -269,12 +269,6 @@ /* * Setup DMA transfers on the channel. */ - if (d->flags & ATA_F_NOADMA) - autodma = 0; - - if (autodma) - ch->autodma = 1; - if (!((d->flags & ATA_F_DMA) || ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80)))) goto no_dma; /* @@ -328,6 +322,9 @@ d->init_dma(ch, dma_base); else ata_init_dma(ch, dma_base); + + if (ch->dma_base && autodma) + ch->autodma = 1; #endif no_dma: @@ -335,6 +332,11 @@ if (d->init_channel) d->init_channel(ch); +#ifdef CONFIG_BLK_DEV_IDEDMA + if ((d->flags & ATA_F_NOADMA) || noautodma) + ch->autodma = 0; +#endif + return 0; } diff -ur linux-ata-hosts-11/drivers/ide/it8172.c linux/drivers/ide/it8172.c --- linux-ata-hosts-11/drivers/ide/it8172.c Mon Jun 24 22:45:20 2002 +++ linux/drivers/ide/it8172.c Mon Jun 24 23:31:32 2002 @@ -208,17 +208,11 @@ if (!hwif->dma_base) return; -#ifndef CONFIG_BLK_DEV_IDEDMA - hwif->autodma = 0; -#else /* CONFIG_BLK_DEV_IDEDMA */ # ifdef CONFIG_IT8172_TUNING - hwif->autodma = 1; hwif->modes_map = XFER_EPIO | XFER_SWDMA | XFER_MWDMA | XFER_UDMA; hwif->udma_setup = udma_generic_setup; - hwif->dmaproc = &it8172_dmaproc; hwif->speedproc = &it8172_tune_chipset; # endif -#endif cmdBase = dev->resource[0].start; ctrlBase = dev->resource[1].start; diff -ur linux-ata-hosts-11/drivers/ide/pdc202xx.c linux/drivers/ide/pdc202xx.c --- linux-ata-hosts-11/drivers/ide/pdc202xx.c Mon Jun 24 22:44:38 2002 +++ linux/drivers/ide/pdc202xx.c Mon Jun 24 23:31:59 2002 @@ -687,14 +687,11 @@ hwif->udma_irq_lost = pdc202xx_bug; hwif->udma_timeout = pdc202xx_bug; hwif->highmem = 1; - if (!noautodma) - hwif->autodma = 1; } else #endif { hwif->drives[0].autotune = 1; hwif->drives[1].autotune = 1; - hwif->autodma = 0; } } diff -ur linux-ata-hosts-11/drivers/ide/piix.c linux/drivers/ide/piix.c --- linux-ata-hosts-11/drivers/ide/piix.c Mon Jun 24 22:35:10 2002 +++ linux/drivers/ide/piix.c Mon Jun 24 23:33:39 2002 @@ -354,7 +354,6 @@ ch->tuneproc = &piix_tune_drive; ch->speedproc = &piix_set_drive; - ch->autodma = 0; ch->io_32bit = 1; ch->unmask = 1; for (i = 0; i < 2; i++) { @@ -367,10 +366,6 @@ ch->highmem = 1; ch->modes_map = piix_modes_map(ch); ch->udma_setup = udma_generic_setup; -# ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - ch->autodma = 1; -# endif } #endif } diff -ur linux-ata-hosts-11/drivers/ide/serverworks.c linux/drivers/ide/serverworks.c --- linux-ata-hosts-11/drivers/ide/serverworks.c Mon Jun 24 22:36:38 2002 +++ linux/drivers/ide/serverworks.c Mon Jun 24 23:34:08 2002 @@ -375,19 +375,13 @@ #ifndef CONFIG_BLK_DEV_IDEDMA hwif->drives[0].autotune = 1; hwif->drives[1].autotune = 1; - hwif->autodma = 0; #else if (hwif->dma_base) { -#ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -#endif hwif->modes_map = svwks_modes_map(hwif); hwif->udma_setup = udma_generic_setup; hwif->udma_stop = svwks_udma_stop; hwif->highmem = 1; } else { - hwif->autodma = 0; hwif->drives[0].autotune = 1; hwif->drives[1].autotune = 1; } diff -ur linux-ata-hosts-11/drivers/ide/sis5513.c linux/drivers/ide/sis5513.c --- linux-ata-hosts-11/drivers/ide/sis5513.c Mon Jun 24 22:35:10 2002 +++ linux/drivers/ide/sis5513.c Mon Jun 24 23:56:11 2002 @@ -492,23 +492,14 @@ hwif->tuneproc = &sis5513_tune_drive; hwif->speedproc = &sis5513_tune_chipset; - if (!(hwif->dma_base)) - return; - - if (host_dev) { -#ifdef CONFIG_BLK_DEV_IDEDMA - if (chipset_family > ATA_16) { - hwif->autodma = noautodma ? 0 : 1; - hwif->highmem = 1; - hwif->modes_map = sis5513_modes_map(hwif); - hwif->udma_setup = udma_generic_setup; - } else { -#endif - hwif->autodma = 0; #ifdef CONFIG_BLK_DEV_IDEDMA - } -#endif + if (hwif->dma_base && host_dev && chipset_family > ATA_16) { + hwif->highmem = 1; + hwif->modes_map = sis5513_modes_map(hwif); + hwif->udma_setup = udma_generic_setup; } +#endif + return; } @@ -522,7 +513,6 @@ init_channel: ide_init_sis5513, enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04} }, bootable: ON_BOARD, - flags: ATA_F_NOADMA }; int __init init_sis5513(void) diff -ur linux-ata-hosts-11/drivers/ide/sl82c105.c linux/drivers/ide/sl82c105.c --- linux-ata-hosts-11/drivers/ide/sl82c105.c Mon Jun 24 22:40:40 2002 +++ linux/drivers/ide/sl82c105.c Mon Jun 24 23:44:04 2002 @@ -333,7 +333,6 @@ dma_state &= ~0x60; } else { dma_state |= 0x60; - ch->autodma = 1; } outb(dma_state, dma_base + 2); diff -ur linux-ata-hosts-11/drivers/ide/trm290.c linux/drivers/ide/trm290.c --- linux-ata-hosts-11/drivers/ide/trm290.c Mon Jun 24 22:40:40 2002 +++ linux/drivers/ide/trm290.c Mon Jun 24 23:37:34 2002 @@ -303,7 +303,6 @@ #endif hwif->selectproc = &trm290_selectproc; - hwif->autodma = 0; /* play it safe for now */ #if 1 { /* diff -ur linux-ata-hosts-11/drivers/ide/via82cxxx.c linux/drivers/ide/via82cxxx.c --- linux-ata-hosts-11/drivers/ide/via82cxxx.c Mon Jun 24 22:35:10 2002 +++ linux/drivers/ide/via82cxxx.c Mon Jun 24 23:56:17 2002 @@ -348,7 +348,6 @@ hwif->tuneproc = &via82cxxx_tune_drive; hwif->speedproc = &via_set_drive; - hwif->autodma = 0; hwif->io_32bit = 1; hwif->unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1; @@ -362,10 +361,6 @@ hwif->highmem = 1; hwif->modes_map = via_modes_map(hwif); hwif->udma_setup = udma_generic_setup; -# ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -# endif } #endif } @@ -391,7 +386,6 @@ init_dma: via82cxxx_init_dma, enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, bootable: ON_BOARD, - flags: ATA_F_NOADMA }, { vendor: PCI_VENDOR_ID_VIA, @@ -402,7 +396,6 @@ init_dma: via82cxxx_init_dma, enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, bootable: ON_BOARD, - flags: ATA_F_NOADMA }, };
| |