Patchwork [#upstream-fixes] libata-sff: fix HSM_ST_ERR handling in __ata_sff_port_intr()

login
register
mail settings
Submitter Tejun Heo
Date Dec. 3, 2010, 2:19 p.m.
Message ID <4CF8FC61.8060606@kernel.org>
Download mbox | patch
Permalink /patch/74155/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - Dec. 3, 2010, 2:19 p.m.
While separating out BMDMA irq handler from SFF, commit c3b28894
(libata-sff: separate out BMDMA irq handler) incorrectly made
__ata_sff_port_intr() consider an IRQ to be an idle one if the host
state was transitioned to HSM_ST_ERR by ata_bmdma_port_intr().

This makes BMDMA drivers ignore IRQs reporting host bus error which
leads to timeouts instead of triggering EH immediately.  Fix it by
making __ata_sff_port_intr() consider the IRQ to be an idle one iff
the state is HSM_ST_IDLE.  This is equivalent to adding HSM_ST_ERR to
the "break"ing case but less error-prone.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Antonio Toma <antonio.toma@gmail.com>
Cc: stable@kernel.org
---
 drivers/ata/libata-sff.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo - Dec. 24, 2010, 3:20 p.m.
On Fri, Dec 03, 2010 at 03:19:13PM +0100, Tejun Heo wrote:
> While separating out BMDMA irq handler from SFF, commit c3b28894
> (libata-sff: separate out BMDMA irq handler) incorrectly made
> __ata_sff_port_intr() consider an IRQ to be an idle one if the host
> state was transitioned to HSM_ST_ERR by ata_bmdma_port_intr().
> 
> This makes BMDMA drivers ignore IRQs reporting host bus error which
> leads to timeouts instead of triggering EH immediately.  Fix it by
> making __ata_sff_port_intr() consider the IRQ to be an idle one iff
> the state is HSM_ST_IDLE.  This is equivalent to adding HSM_ST_ERR to
> the "break"ing case but less error-prone.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Antonio Toma <antonio.toma@gmail.com>
> Cc: stable@kernel.org

Ping.
Jeff Garzik - Dec. 24, 2010, 6:39 p.m.
On 12/03/2010 09:19 AM, Tejun Heo wrote:
> While separating out BMDMA irq handler from SFF, commit c3b28894
> (libata-sff: separate out BMDMA irq handler) incorrectly made
> __ata_sff_port_intr() consider an IRQ to be an idle one if the host
> state was transitioned to HSM_ST_ERR by ata_bmdma_port_intr().
>
> This makes BMDMA drivers ignore IRQs reporting host bus error which
> leads to timeouts instead of triggering EH immediately.  Fix it by
> making __ata_sff_port_intr() consider the IRQ to be an idle one iff
> the state is HSM_ST_IDLE.  This is equivalent to adding HSM_ST_ERR to
> the "break"ing case but less error-prone.
>
> Signed-off-by: Tejun Heo<tj@kernel.org>
> Reported-by: Antonio Toma<antonio.toma@gmail.com>
> Cc: stable@kernel.org
> ---
>   drivers/ata/libata-sff.c |    7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)

applied


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index d05387d..484697f 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1532,11 +1532,10 @@  static unsigned int __ata_sff_port_intr(struct ata_port *ap,
 		if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR))
 			return ata_sff_idle_irq(ap);
 		break;
-	case HSM_ST:
-	case HSM_ST_LAST:
-		break;
-	default:
+	case HSM_ST_IDLE:
 		return ata_sff_idle_irq(ap);
+	default:
+		break;
 	}

 	/* check main status, clearing INTRQ if needed */