Commit ad8cb89a authored by Jens Axboe's avatar Jens Axboe

[PATCH] fix ide highmem bounce enable

ide_toggle_bounce() was called prior to init'ing the block queue,
which then reset the bounce_pfn back to BLK_BOUNCE_HIGH. Make
ide_toggle_bounce() an ide-lib helper, and call it when setting up
the queue as well.
parent f5f93c0a
...@@ -445,20 +445,6 @@ static int dma_timer_expiry (ide_drive_t *drive) ...@@ -445,20 +445,6 @@ static int dma_timer_expiry (ide_drive_t *drive)
return 0; return 0;
} }
static void ide_toggle_bounce(ide_drive_t *drive, int on)
{
u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
if (on && drive->media == ide_disk) {
if (!PCI_DMA_BUS_IS_PHYS)
addr = BLK_BOUNCE_ANY;
else
addr = HWIF(drive)->pci_dev->dma_mask;
}
blk_queue_bounce_limit(&drive->queue, addr);
}
int __ide_dma_host_off (ide_drive_t *drive) int __ide_dma_host_off (ide_drive_t *drive)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
......
...@@ -386,3 +386,19 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p ...@@ -386,3 +386,19 @@ u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_p
} }
EXPORT_SYMBOL_GPL(ide_get_best_pio_mode); EXPORT_SYMBOL_GPL(ide_get_best_pio_mode);
void ide_toggle_bounce(ide_drive_t *drive, int on)
{
u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */
if (on && drive->media == ide_disk) {
if (!PCI_DMA_BUS_IS_PHYS)
addr = BLK_BOUNCE_ANY;
else
addr = HWIF(drive)->pci_dev->dma_mask;
}
blk_queue_bounce_limit(&drive->queue, addr);
}
EXPORT_SYMBOL(ide_toggle_bounce);
...@@ -778,6 +778,8 @@ static void ide_init_queue(ide_drive_t *drive) ...@@ -778,6 +778,8 @@ static void ide_init_queue(ide_drive_t *drive)
/* This is a driver limit and could be eliminated. */ /* This is a driver limit and could be eliminated. */
blk_queue_max_phys_segments(q, PRD_ENTRIES); blk_queue_max_phys_segments(q, PRD_ENTRIES);
ide_toggle_bounce(drive, 1);
} }
/* /*
......
...@@ -1753,6 +1753,7 @@ extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode); ...@@ -1753,6 +1753,7 @@ extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode);
extern u8 ide_rate_filter(u8 mode, u8 speed); extern u8 ide_rate_filter(u8 mode, u8 speed);
extern int ide_dma_enable(ide_drive_t *drive); extern int ide_dma_enable(ide_drive_t *drive);
extern char *ide_xfer_verbose(u8 xfer_rate); extern char *ide_xfer_verbose(u8 xfer_rate);
extern void ide_toggle_bounce(ide_drive_t *drive, int on);
extern spinlock_t ide_lock; extern spinlock_t ide_lock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment