public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Worrisome IDE PIO transfers...
@ 2004-02-28 23:24 Jeff Garzik
  2004-02-29  0:21 ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 17+ messages in thread
From: Jeff Garzik @ 2004-02-28 23:24 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Jens Axboe, Linux Kernel


Looking at the function that is used to transfer data when in PIO mode...

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);
         }
}

Swapping the data in-place is very, very wrong...   you don't want to be 
touching the data that userspace might have mmap'd ...  Additionally, 
byteswapping back and forth for each PIO sector chews unnecessary CPU.

Seems to me the architecture's OUTS[WL] hook (or a new, similar hook) 
that swaps as it writes would be _much_ preferred, and eliminate this 
possible data corruption issue.

	Jeff





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2004-03-01 16:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-28 23:24 Worrisome IDE PIO transfers Jeff Garzik
2004-02-29  0:21 ` Bartlomiej Zolnierkiewicz
2004-02-29  0:58   ` Jeff Garzik
2004-02-29  3:05     ` Bartlomiej Zolnierkiewicz
2004-02-29  8:52       ` Geert Uytterhoeven
2004-02-29 19:23         ` Richard Zidlicky
2004-02-29 20:36           ` Bartlomiej Zolnierkiewicz
2004-03-01 10:43             ` Richard Zidlicky
2004-02-29  1:50   ` Matt Mackall
2004-02-29  2:41     ` Jeff Garzik
2004-02-29  3:08       ` Bartlomiej Zolnierkiewicz
2004-02-29  9:32         ` Aubin LaBrosse
2004-03-01  0:47       ` Bartlomiej Zolnierkiewicz
2004-03-01 13:23         ` Christophe Saout
2004-03-01 16:45           ` Bartlomiej Zolnierkiewicz
2004-02-29  8:50   ` Geert Uytterhoeven
2004-02-29 14:55     ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox