linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 01/20] sata_mv: fix irq port status usage
       [not found] ` <20060325042556.GA21260@kroah.com>
@ 2006-03-25  4:26   ` Greg KH
  2006-03-25  4:26   ` [patch 04/20] 2.6.xx: sata_mv: another critical fix Greg KH
  1 sibling, 0 replies; 2+ messages in thread
From: Greg KH @ 2006-03-25  4:26 UTC (permalink / raw)
  To: linux-kernel, stable, Andrew Morton, Linus Torvalds
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, alan, linux-ide@vger.kernel.org,
	Jeff Garzik, Chris Wright, Greg Kroah-Hartman

[-- Attachment #1: sata_mv-fix-irq-port-status-usage.patch --]
[-- Type: text/plain, Size: 1156 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Jeff Garzik <jeff@garzik.org>

Interrupt handler did not properly initialize a variable on a per-port
basis, leading to incorrect behavior on ports other than port 0.

Bug caught and fixed by Mark Lord.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

 drivers/scsi/sata_mv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.16.orig/drivers/scsi/sata_mv.c
+++ linux-2.6.16/drivers/scsi/sata_mv.c
@@ -1192,7 +1192,6 @@ static void mv_host_intr(struct ata_host
 	u32 hc_irq_cause;
 	int shift, port, port0, hard_port, handled;
 	unsigned int err_mask;
-	u8 ata_status = 0;
 
 	if (hc == 0) {
 		port0 = 0;
@@ -1210,6 +1209,7 @@ static void mv_host_intr(struct ata_host
 		hc,relevant,hc_irq_cause);
 
 	for (port = port0; port < port0 + MV_PORTS_PER_HC; port++) {
+		u8 ata_status = 0;
 		ap = host_set->ports[port];
 		hard_port = port & MV_PORT_MASK;	/* range 0-3 */
 		handled = 0;	/* ensure ata_status is set if handled++ */

--

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

* [patch 04/20] 2.6.xx: sata_mv: another critical fix
       [not found] ` <20060325042556.GA21260@kroah.com>
  2006-03-25  4:26   ` [patch 01/20] sata_mv: fix irq port status usage Greg KH
@ 2006-03-25  4:26   ` Greg KH
  1 sibling, 0 replies; 2+ messages in thread
From: Greg KH @ 2006-03-25  4:26 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, torvalds, akpm, alan,
	linux-ide@vger.kernel.org, Mark Lord, Chris Wright,
	Greg Kroah-Hartman

[-- Attachment #1: 2.6.xx-sata_mv-another-critical-fix.patch --]
[-- Type: text/plain, Size: 1589 bytes --]

-stable review patch.  If anyone has any objections, please let us know.

------------------

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

 drivers/scsi/sata_mv.c |    5 ++++-
 1 file 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;
 }
 
 /**

--

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

end of thread, other threads:[~2006-03-25  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060325041355.180237000@quad.kroah.org>
     [not found] ` <20060325042556.GA21260@kroah.com>
2006-03-25  4:26   ` [patch 01/20] sata_mv: fix irq port status usage Greg KH
2006-03-25  4:26   ` [patch 04/20] 2.6.xx: sata_mv: another critical fix Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).