]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Another critical sata_mv fix, fwd from Jeff Garzik
authorChris Wright <chrisw@sous-sol.org>
Wed, 22 Mar 2006 02:12:01 +0000 (18:12 -0800)
committerChris Wright <chrisw@sous-sol.org>
Wed, 22 Mar 2006 02:12:01 +0000 (18:12 -0800)
queue-2.6.16/2.6.xx-sata_mv-another-critical-fix.patch [new file with mode: 0644]
queue-2.6.16/series

diff --git a/queue-2.6.16/2.6.xx-sata_mv-another-critical-fix.patch b/queue-2.6.16/2.6.xx-sata_mv-another-critical-fix.patch
new file mode 100644 (file)
index 0000000..25dca33
--- /dev/null
@@ -0,0 +1,52 @@
+From stable-bounces@linux.kernel.org  Tue Mar 21 18:06:15 2006
+Date: Tue, 21 Mar 2006 21:05:32 -0500
+From: Jeff Garzik <jeff@garzik.org>
+To: stable@kernel.org
+Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>, "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>, Linux Kernel <linux-kernel@vger.kernel.org>
+Subject: [PATCH] 2.6.xx: sata_mv: another critical fix
+
+
+From: Mark Lord <lkml@rtr.ca>
+
+This patch addresses a number of weird behaviours observed
+for the sata_mv driver, by fixing an "off by one" bug in processing
+of the EDMA response queue.
+
+Basically, sata_mv was looking in the wrong place for
+command results, and this produced a lot of unpredictable behaviour.
+
+Signed-off-by: Mark Lord <mlord@pobox.com>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ drivers/scsi/sata_mv.c |    5 ++++-
+ 1 files changed, 4 insertions(+), 1 deletion(-)
+
+--- linux-2.6.16.orig/drivers/scsi/sata_mv.c
++++ linux-2.6.16/drivers/scsi/sata_mv.c
+@@ -1102,6 +1102,7 @@ static u8 mv_get_crpb_status(struct ata_
+       void __iomem *port_mmio = mv_ap_base(ap);
+       struct mv_port_priv *pp = ap->private_data;
+       u32 out_ptr;
++      u8 ata_status;
+       out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
+@@ -1109,6 +1110,8 @@ static u8 mv_get_crpb_status(struct ata_
+       assert(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) ==
+              pp->rsp_consumer);
++      ata_status = pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT;
++
+       /* increment our consumer index... */
+       pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer);
+@@ -1123,7 +1126,7 @@ static u8 mv_get_crpb_status(struct ata_
+       writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
+       /* Return ATA status register for completed CRPB */
+-      return (pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT);
++      return ata_status;
+ }
+ /**
index 7453858f7405535a8a1216413d612ac4279f5d4c..0f1b434518aa6a6d6a05beeb62ccd3f52cc91481 100644 (file)
@@ -1,3 +1,4 @@
 sata_mv-fix-irq-port-status-usage.patch
 v4l-dvb-fix-samsung-tuner-frequency-ranges.patch
 kconfig-video_decoder-must-select-fw_loader.patch
+2.6.xx-sata_mv-another-critical-fix.patch