public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: Matt Mackall <mpm@selenic.com>,
	Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Jens Axboe <axboe@suse.de>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: Worrisome IDE PIO transfers...
Date: Sat, 28 Feb 2004 21:41:22 -0500	[thread overview]
Message-ID: <40415152.8040205@pobox.com> (raw)
In-Reply-To: <20040229015041.GQ3883@waste.org>

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

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



[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 826 bytes --]

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

  reply	other threads:[~2004-02-29  2:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40415152.8040205@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=axboe@suse.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox