From 9e47be0c97f7357b80e91dc0632e9cce2eb025e0 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Sat, 26 Jan 2008 20:13:09 +0100 Subject: ide: remove broken disk byte-swapping support Remove broken disk byte-swapping support: - it can cause a data corruption on SMP (or if using PREEMPT on UP) - all data coming from disk are byte-swapped by taskfile_*_data() which results in incorrect identify data being reported by /proc/ide/ and IOCTLs - "hdx=bswap/byteswap" kernel parameter has been broken on m68k host drivers (including Atari/Q40 ones) since 2.5.x days (because of 'hwif' zero-ing) - byte-swapping is limited to PIO transfers (for working with TiVo disks on x86 machines using user-space solutions or dm-byteswap should result in much better performance because DMA can be used) For previous discussions please see: http://www.ussg.iu.edu/hypermail/linux/kernel/0201.0/0768.html http://lkml.org/lkml/2004/2/28/111 [ I have dm-byteswap device mapper target if somebody is interested (patch is for 2.6.4 though but I'll dust it off if needed). ] Acked-by: Sergei Shtylyov Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide-taskfile.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'drivers/ide/ide-taskfile.c') diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index c58edc86ed3..3ecafab8f54 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c @@ -35,34 +35,6 @@ #include #include -static void ata_bswap_data (void *buffer, int wcount) -{ - u16 *p = buffer; - - while (wcount--) { - *p = *p << 8 | *p >> 8; p++; - *p = *p << 8 | *p >> 8; p++; - } -} - -static void taskfile_input_data(ide_drive_t *drive, void *buffer, u32 wcount) -{ - HWIF(drive)->ata_input_data(drive, buffer, wcount); - if (drive->bswap) - ata_bswap_data(buffer, wcount); -} - -static void taskfile_output_data(ide_drive_t *drive, void *buffer, u32 wcount) -{ - if (drive->bswap) { - ata_bswap_data(buffer, wcount); - HWIF(drive)->ata_output_data(drive, buffer, wcount); - ata_bswap_data(buffer, wcount); - } else { - HWIF(drive)->ata_output_data(drive, buffer, wcount); - } -} - void ide_tf_load(ide_drive_t *drive, ide_task_t *task) { ide_hwif_t *hwif = drive->hwif; @@ -352,9 +324,9 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write) /* do the actual data transfer */ if (write) - taskfile_output_data(drive, buf, SECTOR_WORDS); + hwif->ata_output_data(drive, buf, SECTOR_WORDS); else - taskfile_input_data(drive, buf, SECTOR_WORDS); + hwif->ata_input_data(drive, buf, SECTOR_WORDS); kunmap_atomic(buf, KM_BIO_SRC_IRQ); #ifdef CONFIG_HIGHMEM -- cgit v1.2.3