X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fide%2Fide-dma.c;h=cd32057b53a97cccfac2888022ceb63db61dc888;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=6ed4de8a58e307274fa3f72c56e1fc8a40d5ee9f;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 6ed4de8a5..cd32057b5 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -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 @@ -569,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);