Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide: kill ide_toggle_bounce

ide_toggle_bounce did select various strange block bounce limits, including
not bouncing at all as soon as an iommu is present in the system. Given
that the dma_map routines now handle any required bounce buffering except
for ISA DMA, and the ide code already must handle either ISA DMA or highmem
at least for iommu equipped systems we can get rid of the block layer
bounce limit setting entirely.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>

-33
-2
drivers/ide/ide-dma.c
··· 180 180 void ide_dma_off_quietly(ide_drive_t *drive) 181 181 { 182 182 drive->dev_flags &= ~IDE_DFLAG_USING_DMA; 183 - ide_toggle_bounce(drive, 0); 184 183 185 184 drive->hwif->dma_ops->dma_host_set(drive, 0); 186 185 } ··· 210 211 void ide_dma_on(ide_drive_t *drive) 211 212 { 212 213 drive->dev_flags |= IDE_DFLAG_USING_DMA; 213 - ide_toggle_bounce(drive, 1); 214 214 215 215 drive->hwif->dma_ops->dma_host_set(drive, 1); 216 216 }
-26
drivers/ide/ide-lib.c
··· 6 6 #include <linux/ide.h> 7 7 #include <linux/bitops.h> 8 8 9 - /** 10 - * ide_toggle_bounce - handle bounce buffering 11 - * @drive: drive to update 12 - * @on: on/off boolean 13 - * 14 - * Enable or disable bounce buffering for the device. Drives move 15 - * between PIO and DMA and that changes the rules we need. 16 - */ 17 - 18 - void ide_toggle_bounce(ide_drive_t *drive, int on) 19 - { 20 - u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ 21 - 22 - if (!PCI_DMA_BUS_IS_PHYS) { 23 - addr = BLK_BOUNCE_ANY; 24 - } else if (on && drive->media == ide_disk) { 25 - struct device *dev = drive->hwif->dev; 26 - 27 - if (dev && dev->dma_mask) 28 - addr = *dev->dma_mask; 29 - } 30 - 31 - if (drive->queue) 32 - blk_queue_bounce_limit(drive->queue, addr); 33 - } 34 - 35 9 u64 ide_get_lba_addr(struct ide_cmd *cmd, int lba48) 36 10 { 37 11 struct ide_taskfile *tf = &cmd->tf;
-3
drivers/ide/ide-probe.c
··· 805 805 /* assign drive queue */ 806 806 drive->queue = q; 807 807 808 - /* needs drive->queue to be set */ 809 - ide_toggle_bounce(drive, 1); 810 - 811 808 return 0; 812 809 } 813 810
-2
include/linux/ide.h
··· 1508 1508 hwif->hwif_data = data; 1509 1509 } 1510 1510 1511 - extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1512 - 1513 1511 u64 ide_get_lba_addr(struct ide_cmd *, int); 1514 1512 u8 ide_dump_status(ide_drive_t *, const char *, u8); 1515 1513