ide: add IDE_HFLAG_NO_ATAPI_DMA host flag
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:06 +0000 (00:30 +0200)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Thu, 18 Oct 2007 22:30:06 +0000 (00:30 +0200)
Add IDE_HFLAG_NO_ATAPI_DMA host flag and set it in host drivers which
don't support ATAPI DMA.  Then remove no longer needed hwif->atapi_dma.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
39 files changed:
drivers/ide/arm/icside.c
drivers/ide/cris/ide-cris.c
drivers/ide/ide-dma.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
include/linux/ide.h

index e4875cef78bbad6e229eb1fd5315f60ab4b32a7e..3af33fbf1f8859da5f2dc6c7ea0f9aeaf52e1c3a 100644 (file)
@@ -415,7 +415,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)
 
 static void icside_dma_init(ide_hwif_t *hwif)
 {
-       hwif->atapi_dma         = 1;
        hwif->mwdma_mask        = 7; /* MW0..2 */
        hwif->swdma_mask        = 7; /* SW0..2 */
 
index 06c75f18eb8826e931336ab2b3929f29c312ef91..9a96a10ba9d3a7f69573f117b59c34a95db3a220 100644 (file)
@@ -805,6 +805,7 @@ init_e100_ide (void)
                hwif->dma_host_on = &cris_dma_on;
                hwif->dma_off_quietly = &cris_dma_off;
                hwif->cbl = ATA_CBL_PATA40;
+               hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
                hwif->pio_mask = ATA_PIO4,
                hwif->drives[0].autotune = 1;
                hwif->drives[1].autotune = 1;
index bc57ce6bf0b3064ecdc76f9b55895e68988201f3..80b4f17f3941deeeb42c9791d1ff40e42ae62d30 100644 (file)
@@ -338,8 +338,10 @@ static int config_drive_for_dma (ide_drive_t *drive)
        ide_hwif_t *hwif = drive->hwif;
        struct hd_driveid *id = drive->id;
 
-       if (drive->media != ide_disk && hwif->atapi_dma == 0)
-               return 0;
+       if (drive->media != ide_disk) {
+               if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
+                       return -1;
+       }
 
        /*
         * Enable DMA on any drive that has
@@ -726,8 +728,10 @@ u8 ide_find_dma_mode(ide_drive_t *drive, u8 req_mode)
        int x, i;
        u8 mode = 0;
 
-       if (drive->media != ide_disk && hwif->atapi_dma == 0)
-               return 0;
+       if (drive->media != ide_disk) {
+               if (hwif->host_flags & IDE_HFLAG_NO_ATAPI_DMA)
+                       return 0;
+       }
 
        for (i = 0; i < ARRAY_SIZE(xfer_mode_bases); i++) {
                if (req_mode < xfer_mode_bases[i])
index 5b090662683ed25031b69e10593fc8582951c941..f78943f8631468dbad101dc9dd9b4cea96a2b9b8 100644 (file)
@@ -134,8 +134,6 @@ static void init_hwif_data(ide_hwif_t *hwif, unsigned int index)
 
        hwif->bus_state = BUSSTATE_ON;
 
-       hwif->atapi_dma = 0;            /* disable all atapi dma */ 
-
        init_completion(&hwif->gendev_rel_comp);
 
        default_hwif_iops(hwif);
@@ -379,7 +377,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
 
        hwif->pio_mask                  = tmp_hwif->pio_mask;
 
-       hwif->atapi_dma                 = tmp_hwif->atapi_dma;
        hwif->ultra_mask                = tmp_hwif->ultra_mask;
        hwif->mwdma_mask                = tmp_hwif->mwdma_mask;
        hwif->swdma_mask                = tmp_hwif->swdma_mask;
index 47c035a550e343e9a3515055f52bfa5cd35ca47e..2f322d7e881bc95dcdade00ad6ed27115ddf53e5 100644 (file)
@@ -699,9 +699,6 @@ static int au_ide_probe(struct device *dev)
        hwif->dma_host_on               = &auide_dma_host_on;
        hwif->dma_lost_irq              = &auide_dma_lost_irq;
        hwif->ide_dma_on                = &auide_dma_on;
-
-       hwif->atapi_dma                 = 1;
-
 #else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
        hwif->channel                   = 0;
        hwif->hold                      = 1;
index 3a4c2c26a77e1da218de133db363f7c84e92a53b..7bf922fc7a074219c4dafa17d73decd6d9bb4eeb 100644 (file)
@@ -247,6 +247,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = OFF_BOARD,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
                .udma_mask      = 0x07, /* udma0-2 */
        },{     /* 1 */
@@ -256,6 +257,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_aec62xx,
                .autodma        = NOAUTODMA,
                .bootable       = OFF_BOARD,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
                .udma_mask      = 0x1f, /* udma0-4 */
        },{     /* 2 */
@@ -266,6 +268,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = NEVER_BOARD,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
                .udma_mask      = 0x1f, /* udma0-4 */
        },{     /* 3 */
@@ -275,6 +278,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .init_hwif      = init_hwif_aec62xx,
                .autodma        = AUTODMA,
                .bootable       = OFF_BOARD,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
                .udma_mask      = 0x3f, /* udma0-5 */
        },{     /* 4 */
@@ -285,6 +289,7 @@ static ide_pci_device_t aec62xx_chipsets[] __devinitdata = {
                .autodma        = AUTODMA,
                .enablebits     = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}},
                .bootable       = OFF_BOARD,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
                .udma_mask      = 0x3f, /* udma0-5 */
        }
index 31d4e50647d5881bbc3b274e0d9e0f59b9338554..6f8ebc959d853d43b76da92d35568faf0f291894 100644 (file)
@@ -677,8 +677,8 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
         * check in ->init_dma guarantees m5229_revision >= 0x20 here
         */
 
-       if (m5229_revision > 0x20)
-               hwif->atapi_dma = 1;
+       if (m5229_revision == 0x20)
+               hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
 
        if (m5229_revision <= 0x20)
                hwif->ultra_mask = 0x00; /* no udma */
index 3bf3d931eea1b84b6c5ce127a7620ba28eb1367d..9e9e2b6ef6cbd3256943fe1b07138b09a34f0439 100644 (file)
@@ -260,8 +260,6 @@ static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-        hwif->atapi_dma = 1;
-
        hwif->ultra_mask = amd_config->udma_mask;
        hwif->mwdma_mask = 0x07;
        if ((amd_config->flags & AMD_BAD_SWDMA) == 0)
index 446900da1329a6af1eb92e70f66959386947ad4c..9bb1b93325c6af829fa7b06a19ab9830f3cea9b6 100644 (file)
@@ -183,7 +183,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x3f;
        hwif->mwdma_mask = 0x07;
 
index f3d3bde8daba7596436de42b00df10de31fd32df..bd9adfbe982e8d7c8539cc244de1e16391f5a684 100644 (file)
@@ -517,7 +517,6 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->atapi_dma  = 1;
        hwif->mwdma_mask = 0x07;
        hwif->ultra_mask = hwif->cds->udma_mask;
 
index a8bf4940ca9c3941461b1c6c4bdc2c73a793d8fe..b7906a9801206d9878256c069dc88f73d736510b 100644 (file)
@@ -125,6 +125,7 @@ static void __devinit cs5520_init_setup_dma(struct pci_dev *dev, ide_pci_device_
  
 static int cs5520_dma_on(ide_drive_t *drive)
 {
+       /* ATAPI is harder so leave it for now */
        drive->vdma = 1;
        return 0;
 }
@@ -141,8 +142,6 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
 
        hwif->ide_dma_on = &cs5520_dma_on;
 
-       /* ATAPI is harder so leave it for now */
-       hwif->atapi_dma = 0;
        hwif->ultra_mask = 0;
        hwif->swdma_mask = 0;
        hwif->mwdma_mask = 0;
@@ -156,7 +155,8 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
                .autodma        = AUTODMA,                      \
                .bootable       = ON_BOARD,                     \
                .host_flags     = IDE_HFLAG_ISA_PORTS |         \
-                                 IDE_HFLAG_VDMA,               \
+                                 IDE_HFLAG_VDMA |              \
+                                 IDE_HFLAG_NO_ATAPI_DMA,       \
                .pio_mask       = ATA_PIO4,                     \
        }
 
index 0d23b8aabe9ca4989a453a274ef313c4750f2aca..2ca5bb280a8a4b6a5522b2adfa34ad93d43d3c00 100644 (file)
@@ -264,7 +264,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x07;
        hwif->mwdma_mask = 0x07;
 
index c141b730617979c49852068c8a2748e22a6ab748..45dc9a1b65a4d8abc854a7e22509a25e25c09c8b 100644 (file)
@@ -185,7 +185,6 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x1F;
        hwif->mwdma_mask = 0x07;
 
index c498ecfd7fcb35d9f813fa510adff7b39ecfc909..c1e672f03244890d2a732d37538055f43eb886c0 100644 (file)
@@ -437,7 +437,6 @@ static void __devinit init_hwif_cy82c693(ide_hwif_t *hwif)
                return;
        }
 
-       hwif->atapi_dma = 1;
        hwif->mwdma_mask = 0x04;
        hwif->swdma_mask = 0x04;
 
index d543abc26c714bb55259de05ee7e022e562937f7..dcee8278141e4f7a5ad8a19d72334d52f4d43c53 100644 (file)
@@ -69,7 +69,6 @@ static void __devinit init_hwif_generic (ide_hwif_t *hwif)
        if (!(hwif->dma_base))
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
index 44ac0e2f7a09cdd8f3fca871ec13712c94c8c619..9709681dff6fe6ec64b7d65c867d7778fb0dddc4 100644 (file)
@@ -155,6 +155,7 @@ static ide_pci_device_t hpt34x_chipset __devinitdata = {
        .autodma        = NOAUTODMA,
        .bootable       = NEVER_BOARD,
        .extra          = 16,
+       .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
        .pio_mask       = ATA_PIO5,
 };
 
index fcb21ddab2cc6d69415147a9fcb742f33b8e02a4..5d96a086bde4cb675d605aec874c41d3939dc4ba 100644 (file)
@@ -1555,6 +1555,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .enablebits     = {{0x50,0x04,0x04}, {0x54,0x04,0x04}},
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        },{     /* 1 */
                .name           = "HPT372A",
@@ -1567,6 +1568,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        },{     /* 2 */
                .name           = "HPT302",
@@ -1579,6 +1581,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .udma_mask      = HPT302_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        },{     /* 3 */
                .name           = "HPT371",
@@ -1591,6 +1594,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .udma_mask      = HPT371_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        },{     /* 4 */
                .name           = "HPT374",
@@ -1603,6 +1607,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .udma_mask      = ATA_UDMA5,
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        },{     /* 5 */
                .name           = "HPT372N",
@@ -1615,6 +1620,7 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
                .udma_mask      = HPT372_ALLOW_ATA133_6 ? ATA_UDMA6 : ATA_UDMA5,
                .bootable       = OFF_BOARD,
                .extra          = 240,
+               .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
                .pio_mask       = ATA_PIO4,
        }
 };
index 24a71d03744a35bb88d3e68f30c15a4a972ebd93..b52bca7b497a76ea3f4cc93dead30ac95e31a7f7 100644 (file)
@@ -176,7 +176,6 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x06;
        hwif->swdma_mask = 0x04;
index f3391a8698ac65fed5d55afd258e18f65a1048a5..1b1286baa8e0df6073f8eef7ae089dc36bb87901 100644 (file)
@@ -544,12 +544,10 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
 
        ide_set_hwifdata(hwif, idev);
 
-       hwif->atapi_dma = 1;
-
        pci_read_config_byte(hwif->pci_dev, 0x50, &conf);
-       if(conf & 1) {
+       if (conf & 1) {
                idev->smart = 1;
-               hwif->atapi_dma = 0;
+               hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
                /* Long I/O's although allowed in LBA48 space cause the
                   onboard firmware to enter the twighlight zone */
                hwif->rqsize = 256;
@@ -570,10 +568,10 @@ static void __devinit init_hwif_it821x(ide_hwif_t *hwif)
         */
 
        pci_read_config_byte(hwif->pci_dev, 0x08, &conf);
-       if(conf == 0x10) {
+       if (conf == 0x10) {
                idev->timing10 = 1;
-               hwif->atapi_dma = 0;
-               if(!idev->smart)
+               hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
+               if (idev->smart == 0)
                        printk(KERN_WARNING "it821x: Revision 0x10, workarounds activated.\n");
        }
 
index bb893ffcc987f646e5ad651249cb44388a9fb542..d151fbc26370788109ea5a44eb5b77782574093b 100644 (file)
@@ -117,7 +117,6 @@ static void __devinit init_hwif_jmicron(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
 
index a8cd50ab62fb5ed2216d52a0e7e0f3320cc28b73..2d5dd983bfe3dc4408195775e91fe7ad8dce76ed 100644 (file)
@@ -268,7 +268,8 @@ static ide_pci_device_t ns87415_chipset __devinitdata = {
        .init_hwif      = init_hwif_ns87415,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
-       .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
+       .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
+                         IDE_HFLAG_NO_ATAPI_DMA,
 };
 
 static int __devinit ns87415_init_one(struct pci_dev *dev, const struct pci_device_id *id)
index 250662ea18ad837b608a6272249cb638c4f8fabb..2437aed73f35be1fcd2ba9a354a80582a4e8090c 100644 (file)
@@ -336,7 +336,6 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
        if (!(hwif->dma_base))
                return;
 
-       hwif->atapi_dma = 1;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
 }
index 8704b6f33312636034d0a6a33cbdffe1df3fea62..2238df9b8372629f7f22638436495d29f949f891 100644 (file)
@@ -482,8 +482,6 @@ static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma  = 1;
-
        hwif->ultra_mask = hwif->cds->udma_mask;
        hwif->mwdma_mask = 0x07;
 
index e1d2337a9f1d563af10b1a4253495997d6a7adac..903bf715fab30577f2ab2d44b18b63bab9edc2a9 100644 (file)
@@ -330,7 +330,6 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
        hwif->ultra_mask = hwif->cds->udma_mask;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
-       hwif->atapi_dma = 1;
 
        hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
        hwif->dma_timeout = &pdc202xx_dma_timeout;
index a8dd0c0add351890dadfc5659ff2270d3f8b3b5a..3694db62f2576956096243a8bc9bda8b9bbb1278 100644 (file)
@@ -397,8 +397,6 @@ static void __devinit init_hwif_piix(ide_hwif_t *hwif)
        if (piix_is_ichx(hwif->pci_dev))
                hwif->ide_dma_clear_irq = &piix_dma_clear_irq;
 
-       hwif->atapi_dma = 1;
-
        hwif->ultra_mask = hwif->cds->udma_mask;
        hwif->mwdma_mask = 0x06;
        hwif->swdma_mask = 0x04;
index 54c5c98a2e2655f32b32b4b0fa3335f8ac3df1c7..0ba9d2408575caf8239c271eac2527d2fdcf63dc 100644 (file)
@@ -377,7 +377,6 @@ static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
        hwif->udma_filter = sc1200_udma_filter;
        hwif->ide_dma_end   = &sc1200_ide_dma_end;
 
-        hwif->atapi_dma = 1;
         hwif->ultra_mask = 0x07;
         hwif->mwdma_mask = 0x07;
 }
index bd4c1d3070e4961c7fee4cb20337a0d1ff8a729e..ac519fa62153070e5a25f6661a51ad0bc9013795 100644 (file)
@@ -693,7 +693,6 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif)
        }
        hwif->mwdma_mask = 0x00;
        hwif->swdma_mask = 0x00;
-       hwif->atapi_dma = 1;
 
        /* we support 80c cable only. */
        hwif->cbl = ATA_CBL_PATA80;
index d3ffc52e22aff340ee55e71c4a6a9fda91472e10..40b89a29014ff14ccd3d64838ff0a5587c5b3fab 100644 (file)
@@ -367,8 +367,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->atapi_dma = 1;
-
        if (hwif->pci_dev->device != PCI_DEVICE_ID_SERVERWORKS_OSB4IDE)
                hwif->ultra_mask = 0x3f;
 
index 9a9474f534e5e8a7676236c8c8c67d87e187f7d8..9122cb71bcc9b113b3536066ad3f5392e09372e0 100644 (file)
@@ -592,7 +592,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->mwdma_mask = 0x04;
 
        hwif->dma_setup = &sgiioc4_ide_dma_setup;
index 5ca14ae46c9d63b23bb06a38d06d975aec4b1b46..4c8108345d83d9b990c6094a9cba60d7fcc7102c 100644 (file)
@@ -899,8 +899,8 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
        hwif->ultra_mask = 0x7f;
        hwif->mwdma_mask = 0x07;
 
-       if (!is_sata(hwif))
-               hwif->atapi_dma = 1;
+       if (is_sata(hwif))
+               hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
 
        if (hwif->cbl != ATA_CBL_PATA40_SHORT)
                hwif->cbl = ata66_siimage(hwif);
index 5a54e2e20b3ce8e4e22b613f8ca94b6f3994e65a..f756c7f83b5da34e8a69c899f10587661af3afd5 100644 (file)
@@ -579,8 +579,6 @@ static void __devinit init_hwif_sis5513 (ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
-
        hwif->ultra_mask = udma_rates[chipset_family];
        hwif->mwdma_mask = 0x07;
 
index 771efb8884c8d37eec36e5fb79a7fb1a416246c2..e78448148acafcc64392a44db4c4da3dd381a471 100644 (file)
@@ -388,7 +388,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
                return;
        }
 
-       hwif->atapi_dma  = 1;
        hwif->mwdma_mask = 0x07;
 
        hwif->ide_dma_on                = &sl82c105_ide_dma_on;
index fa8df6d43832b11ebd0686f1d51a52ab6253db07..d0447219752d80831aaa18edcaa8563304f17c04 100644 (file)
@@ -147,7 +147,6 @@ static void __devinit init_hwif_slc90e66 (ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma = 1;
        hwif->ultra_mask = 0x1f;
        hwif->mwdma_mask = 0x06;
        hwif->swdma_mask = 0x04;
index de62db576adcf50647d815c8cfc0f66b88dc6b89..0e3a8fe2037dc1d4fac4df8863ed7ee4678c6883 100644 (file)
@@ -198,7 +198,6 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif)
        /* Sector Count Register limit */
        hwif->rqsize     = 0xffff;
 
-       hwif->atapi_dma  = 1;
        hwif->ultra_mask = 0x1f;
        hwif->mwdma_mask = 0x07;
 
index 4075c907f05cf4bea497cb017786919c56979ba9..68e1e9adf84dbb9595cc5845a51daefbdc2a4873 100644 (file)
@@ -104,7 +104,6 @@ static void __devinit init_hwif_triflex(ide_hwif_t *hwif)
        if (hwif->dma_base == 0)
                return;
 
-       hwif->atapi_dma  = 1;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
 }
index e3d943ada7b0d5be11743c2f426eb10de88f6174..1307454f9c15492001d84aae1ada0b2162769b74 100644 (file)
@@ -327,7 +327,9 @@ static ide_pci_device_t trm290_chipset __devinitdata = {
        .autodma        = NOAUTODMA,
        .bootable       = ON_BOARD,
 #if 0 /* play it safe for now */
-       .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
+       .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA | IDE_HFLAG_NO_ATAPI_DMA,
+#else
+       .host_flags     = IDE_HFLAG_NO_ATAPI_DMA,
 #endif
 };
 
index b25fb65b240e10cc0e9d07cf7cb525f1bbaa084e..648432f4c79e983e2a874288037311b4b5391fab 100644 (file)
@@ -443,8 +443,6 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
-       hwif->atapi_dma = 1;
-
        hwif->ultra_mask = vdev->via_config->udma_mask;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
index 1d25a3433008699dca36c172d610fff87d278033..c55479356768da5b2b77652535999bb6b9117f09 100644 (file)
@@ -1780,7 +1780,6 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
        hwif->dma_timeout = &ide_dma_timeout;
        hwif->dma_lost_irq = &pmac_ide_dma_lost_irq;
 
-       hwif->atapi_dma = 1;
        switch(pmif->kind) {
                case controller_sh_ata6:
                        hwif->ultra_mask = pmif->cable_80 ? 0x7f : 0x07;
index 69dbe7dc04beacde71a716f6624910e8c8f7e312..e44ecc942ff867eb80a5bd844d6573fe282ac5e7 100644 (file)
@@ -685,7 +685,6 @@ typedef struct hwif_s {
 
        u8 pio_mask;
 
-       u8 atapi_dma;   /* host supports atapi_dma */
        u8 ultra_mask;
        u8 mwdma_mask;
        u8 swdma_mask;
@@ -1258,6 +1257,8 @@ enum {
        IDE_HFLAG_TRUST_BIOS_FOR_DMA    = (1 << 10),
        /* host uses VDMA */
        IDE_HFLAG_VDMA                  = (1 << 11),
+       /* ATAPI DMA is unsupported */
+       IDE_HFLAG_NO_ATAPI_DMA          = (1 << 12),
 };
 
 typedef struct ide_pci_device_s {