All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD
@ 2009-10-21 18:55 Mikulas Patocka
  2009-10-21 19:34 ` Mikael Pettersson
  2009-10-21 19:39 ` Bartlomiej Zolnierkiewicz
  0 siblings, 2 replies; 63+ messages in thread
From: Mikulas Patocka @ 2009-10-21 18:55 UTC (permalink / raw)
  To: David S. Miller; +Cc: linux-ide

Hi

This patch fixes a data corruption when SSD is connected to Ultra 5.

Mikulas

--

Serialize CMD643 and CMD646 to fix a hardware bug with SSD

CMD646 corrupts data on concurrent transfers on both channels when IDE SSD is
connected to one of the channels.

Setup that demonstrates this hardware bug: Ultra 5, onboard CMD646, rev 3.
/dev/hda is 8GB Seagate ST38410A in MWDMA2
/dev/hdd is 32GB SSD SiliconHardDisk in MWDMA2

- When reading /dev/hdd (for example with dd or fsck), reads from /dev/hda
  are corrupted, there are twiddled single bits 1->0 and some full 32-bit
  words corrupted, sometimes commands fail (which switches /dev/hda to
  PIO mode but the corruptions happen even in PIO).
- Reads from /dev/hdd don't seem to be corrupted (i.e. fsck passes fine).
- When I connected normal rotating harddisk to /dev/hdd, there was no
  corruption, so the corruption is something specific to SSD.
- I tried the same setup on a PCI card with CMD649 and saw no corruption.

This patch serializes the operation for CMD646 and 643 (I didn't test
CMD643 but it may have the same hw bug too because it's earlier design).
CMD649 is good. I don't know anything about CMD 648.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
 drivers/ide/cmd64x.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-2.6.31-fast/drivers/ide/cmd64x.c
===================================================================
--- linux-2.6.31-fast.orig/drivers/ide/cmd64x.c	2009-10-21 06:08:42.000000000 +0200
+++ linux-2.6.31-fast/drivers/ide/cmd64x.c	2009-10-21 06:09:09.000000000 +0200
@@ -379,7 +379,8 @@ static const struct ide_port_info cmd64x
 		.enablebits	= {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
 		.port_ops	= &cmd64x_port_ops,
 		.host_flags	= IDE_HFLAG_CLEAR_SIMPLEX |
-				  IDE_HFLAG_ABUSE_PREFETCH,
+				  IDE_HFLAG_ABUSE_PREFETCH |
+				  IDE_HFLAG_SERIALIZE,
 		.pio_mask	= ATA_PIO5,
 		.mwdma_mask	= ATA_MWDMA2,
 		.udma_mask	= 0x00, /* no udma */
@@ -389,7 +390,8 @@ static const struct ide_port_info cmd64x
 		.init_chipset	= init_chipset_cmd64x,
 		.enablebits	= {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
 		.port_ops	= &cmd648_port_ops,
-		.host_flags	= IDE_HFLAG_ABUSE_PREFETCH,
+		.host_flags	= IDE_HFLAG_ABUSE_PREFETCH |
+				  IDE_HFLAG_SERIALIZE,
 		.pio_mask	= ATA_PIO5,
 		.mwdma_mask	= ATA_MWDMA2,
 		.udma_mask	= ATA_UDMA2,

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

end of thread, other threads:[~2011-10-13 10:42 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-21 18:55 [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD Mikulas Patocka
2009-10-21 19:34 ` Mikael Pettersson
2009-10-21 23:01   ` Mikulas Patocka
2009-10-27 11:34     ` Alan Cox
2009-10-28  1:10       ` Mikulas Patocka
2009-10-21 19:39 ` Bartlomiej Zolnierkiewicz
2009-10-22  0:41   ` David Miller
2009-10-22  9:44     ` Bartlomiej Zolnierkiewicz
2009-10-22 11:00       ` David Miller
2009-10-22 11:15         ` Bartlomiej Zolnierkiewicz
2009-10-22 11:20           ` David Miller
2009-10-23 14:29       ` Mikulas Patocka
2009-10-23 14:31         ` David Miller
2009-10-23 14:44         ` Bartlomiej Zolnierkiewicz
2009-10-23 14:55           ` Mikulas Patocka
2009-10-23 15:03             ` Bartlomiej Zolnierkiewicz
2009-10-23 15:18               ` Daniela Engert
2009-10-23 16:51             ` Alan Cox
2009-10-23 17:27               ` Sergei Shtylyov
2009-10-23 18:22                 ` Alan Cox
2009-10-23 18:52                   ` Bartlomiej Zolnierkiewicz
2009-10-24  3:24                     ` David Miller
2009-10-24 12:38                       ` Bartlomiej Zolnierkiewicz
2009-10-24 12:58                         ` David Miller
2009-10-24 13:13                           ` Bartlomiej Zolnierkiewicz
2009-10-24 13:20                             ` David Miller
2009-10-26 11:36                   ` Mikulas Patocka
2009-10-26 12:18                     ` Alan Cox
2009-11-05  1:25                       ` [PATCH] Don't use UDMA on VIA UDMA33 controller with Transcend SSD Mikulas Patocka
2009-11-05 10:40                         ` Alan Cox
2009-11-05 22:18                           ` Mikulas Patocka
2009-11-05 22:46                             ` Alan Cox
2009-11-05 23:19                               ` Mikulas Patocka
2009-11-17 12:30                         ` David Miller
2009-11-18 17:09                           ` Mikulas Patocka
2009-11-18 17:22                             ` Alan Cox
2009-11-18 17:32                               ` David Miller
2009-11-18 17:46                                 ` Mikulas Patocka
2009-11-18 17:53                                   ` David Miller
2009-11-18 18:04                                     ` Mikulas Patocka
2009-11-18 17:37                               ` Mikulas Patocka
2009-11-18 17:50                                 ` Alan Cox
2009-11-18 18:02                                   ` Mikulas Patocka
2011-10-11 17:12                             ` Bartlomiej Zolnierkiewicz
2011-10-11 19:05                               ` David Miller
2011-10-11 19:39                                 ` Alan Cox
2011-10-12 14:38                                   ` Bartlomiej Zolnierkiewicz
2011-10-12 17:59                                     ` Alan Cox
2011-10-13 10:35                                       ` Bartlomiej Zolnierkiewicz
2010-01-14 15:49                         ` Bartlomiej Zolnierkiewicz
2010-01-14 19:24                           ` Alan Cox
2010-01-14 20:17                             ` Bartlomiej Zolnierkiewicz
2009-10-23 17:15         ` [PATCH] Serialize CMD643 and CMD646 to fix a hardware bug with SSD Alan Cox
2009-10-22 13:56     ` Alan Cox
2009-10-23  1:30       ` David Miller
2009-10-23 14:50     ` Mikulas Patocka
2009-10-23 20:50       ` Sergei Shtylyov
2009-10-26 11:30         ` Mikulas Patocka
2009-10-26 18:20           ` Sergei Shtylyov
2009-10-24 11:28     ` Frans Pop
2009-10-24 11:31       ` David Miller
2009-10-25  2:48         ` Frans Pop
2009-10-29 10:02           ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.