vserver 1.9.3
[linux-2.6.git] / drivers / ide / ide-dma.c
index 4f44c29..cd32057 100644 (file)
@@ -100,7 +100,7 @@ static const struct drive_list_entry drive_whitelist [] = {
        { "CONNER CTMA 4000"    ,       "ALL"           },
        { "CONNER CTT8000-A"    ,       "ALL"           },
        { "ST34342A"            ,       "ALL"           },
-       { 0                     ,       0               }
+       { NULL                  ,       NULL            }
 };
 
 static const struct drive_list_entry drive_blacklist [] = {
@@ -138,7 +138,7 @@ static const struct drive_list_entry drive_blacklist [] = {
        { "PLEXTOR CD-R PX-W8432T",     "ALL"           },
        { "ATAPI CD-ROM DRIVE 40X MAXIMUM",     "ALL"           },
        { "_NEC DV5800A",               "ALL"           },  
-       { 0                     ,       0               }
+       { NULL                  ,       NULL            }
 
 };
 
@@ -208,9 +208,6 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
        struct scatterlist *sg = hwif->sg_table;
        int nents;
 
-       if (hwif->sg_dma_active)
-               BUG();
-
        nents = blk_rq_map_sg(drive->queue, rq, hwif->sg_table);
                
        if (rq_data_dir(rq) == READ)
@@ -366,7 +363,6 @@ use_pio_instead:
                     hwif->sg_table,
                     hwif->sg_nents,
                     hwif->sg_dma_direction);
-       hwif->sg_dma_active = 0;
        return 0; /* revert to PIO for this request */
 }
 
@@ -390,7 +386,6 @@ void ide_destroy_dmatable (ide_drive_t *drive)
        int nents = HWIF(drive)->sg_nents;
 
        pci_unmap_sg(dev, sg, nents, HWIF(drive)->sg_dma_direction);
-       HWIF(drive)->sg_dma_active = 0;
 }
 
 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
@@ -412,10 +407,6 @@ static int config_drive_for_dma (ide_drive_t *drive)
        ide_hwif_t *hwif = HWIF(drive);
 
        if ((id->capability & 1) && hwif->autodma) {
-               /* Consult the list of known "bad" drives */
-               if (__ide_dma_bad_drive(drive))
-                       return __ide_dma_off(drive);
-
                /*
                 * Enable DMA on any drive that has
                 * UltraDMA (mode 0/1/2/3/4/5/6) enabled
@@ -513,9 +504,7 @@ int __ide_dma_off_quietly (ide_drive_t *drive)
 
        if (HWIF(drive)->ide_dma_host_off(drive))
                return 1;
-#ifdef CONFIG_BLK_DEV_IDE_TCQ
-       __ide_dma_queued_off(drive);
-#endif
+
        return 0;
 }
 
@@ -571,6 +560,10 @@ EXPORT_SYMBOL(__ide_dma_host_on);
  
 int __ide_dma_on (ide_drive_t *drive)
 {
+       /* consult the list of known "bad" drives */
+       if (__ide_dma_bad_drive(drive))
+               return 1;
+
        drive->using_dma = 1;
        ide_toggle_bounce(drive, 1);