lkml.org 
[lkml]   [2004]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Worrisome IDE PIO transfers...
Matt Mackall wrote:
> On Sun, Feb 29, 2004 at 01:21:30AM +0100, Bartlomiej Zolnierkiewicz wrote:
>
>>I like Alan's idea to use loopback instead of "bswap".
>
>
> Or, more likely, device mapper.


Somehow I doubt anybody cares enough to write a whole driver just for
this unlikely case.

For now let's at least record the knowledge... (patch attached)

Jeff


===== drivers/ide/ide-taskfile.c 1.28 vs edited =====
--- 1.28/drivers/ide/ide-taskfile.c Thu Feb 26 12:11:20 2004
+++ edited/drivers/ide/ide-taskfile.c Sat Feb 28 21:18:27 2004
@@ -29,6 +29,7 @@

#include <linux/config.h>
#include <linux/module.h>
+#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/kernel.h>
@@ -81,7 +82,12 @@

void taskfile_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
{
- if (drive->bswap) {
+ if (unlikely(drive->bswap)) {
+ /* FIXME: Besides the inefficiency each sector
+ * twice, this can lead to data corruption on
+ * SMP. Fortunately drives that need this swapping
+ * are quite uncommon.
+ */
ata_bswap_data(buffer, wcount);
HWIF(drive)->ata_output_data(drive, buffer, wcount);
ata_bswap_data(buffer, wcount);
\
 
 \ /
  Last update: 2005-03-22 14:01    [from the cache]
©2003-2011 Jasper Spaans