Skip to content

Commit 1d3b991

Browse files
author
Christoph Hellwig
committed
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>
1 parent 21e07db commit 1d3b991

4 files changed

Lines changed: 0 additions & 33 deletions

File tree

‎drivers/ide/ide-dma.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ EXPORT_SYMBOL_GPL(ide_dma_unmap_sg);
180180
void ide_dma_off_quietly(ide_drive_t *drive)
181181
{
182182
drive->dev_flags &= ~IDE_DFLAG_USING_DMA;
183-
ide_toggle_bounce(drive, 0);
184183

185184
drive->hwif->dma_ops->dma_host_set(drive, 0);
186185
}
@@ -211,7 +210,6 @@ EXPORT_SYMBOL(ide_dma_off);
211210
void ide_dma_on(ide_drive_t *drive)
212211
{
213212
drive->dev_flags |= IDE_DFLAG_USING_DMA;
214-
ide_toggle_bounce(drive, 1);
215213

216214
drive->hwif->dma_ops->dma_host_set(drive, 1);
217215
}

‎drivers/ide/ide-lib.c‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,6 @@
66
#include <linux/ide.h>
77
#include <linux/bitops.h>
88

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-
359
u64 ide_get_lba_addr(struct ide_cmd *cmd, int lba48)
3610
{
3711
struct ide_taskfile *tf = &cmd->tf;

‎drivers/ide/ide-probe.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,9 +805,6 @@ static int ide_init_queue(ide_drive_t *drive)
805805
/* assign drive queue */
806806
drive->queue = q;
807807

808-
/* needs drive->queue to be set */
809-
ide_toggle_bounce(drive, 1);
810-
811808
return 0;
812809
}
813810

‎include/linux/ide.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,8 +1508,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
15081508
hwif->hwif_data = data;
15091509
}
15101510

1511-
extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1512-
15131511
u64 ide_get_lba_addr(struct ide_cmd *, int);
15141512
u8 ide_dump_status(ide_drive_t *, const char *, u8);
15151513

0 commit comments

Comments
 (0)