[PATCH 4/8] block: convert IDE to use blk_kmap helpers

From: Tejun Heo
Date: Fri Jan 13 2006 - 10:25:36 EST


Convert direct uses of kmap/unmap to blk_kmap/unmap in IDE. This
combined with the previous bio helper change fixes PIO cache coherency
bugs on architectures with aliased caches.

Signed-off-by: Tejun Heo <htejun@xxxxxxxxx>

---

drivers/ide/ide-taskfile.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

72ba1c82f766c7b42792499cc9156f89e76b176c
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 62ebefd..24d5e56 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -260,6 +260,7 @@ static void ide_pio_sector(ide_drive_t *
{
ide_hwif_t *hwif = drive->hwif;
struct scatterlist *sg = hwif->sg_table;
+ enum dma_data_direction dir = write ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
struct page *page;
#ifdef CONFIG_HIGHMEM
unsigned long flags;
@@ -277,7 +278,7 @@ static void ide_pio_sector(ide_drive_t *
#ifdef CONFIG_HIGHMEM
local_irq_save(flags);
#endif
- buf = kmap_atomic(page, KM_BIO_SRC_IRQ) + offset;
+ buf = blk_kmap_atomic(page, KM_BIO_SRC_IRQ, dir) + offset;

hwif->nleft--;
hwif->cursg_ofs++;
@@ -293,7 +294,7 @@ static void ide_pio_sector(ide_drive_t *
else
taskfile_input_data(drive, buf, SECTOR_WORDS);

- kunmap_atomic(buf, KM_BIO_SRC_IRQ);
+ blk_kunmap_atomic(buf, KM_BIO_SRC_IRQ, dir);
#ifdef CONFIG_HIGHMEM
local_irq_restore(flags);
#endif
--
1.0.6


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/