From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>, Tejun Heo <htejun@gmail.com>
Cc: Alan Cox <alan@redhat.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: [PATCH 02/04] sata_mv fis irq register fixes
Date: Wed, 14 May 2008 09:19:30 -0400 [thread overview]
Message-ID: <482AE6E2.4080900@rtr.ca> (raw)
In-Reply-To: <482AE694.5080604@rtr.ca>
Fix handling of the FIS_IRQ_CAUSE register in sata_mv.
This register exists *only* on GenIIe devices, so don't bother
writing to it on older chips. Also, it has to be read/cleared
in mv_err_intr() before clearing the main ERR_IRQ_CAUSE register.
This keeps sata_mv from getting stuck forever on certain error types.
Signed-off-by: Mark Lord <mlord@pobox.com>
---
For 2.6.26.
--- old/drivers/ata/sata_mv.c 2008-05-14 08:48:19.000000000 -0400
+++ linux/drivers/ata/sata_mv.c 2008-05-14 08:51:49.000000000 -0400
@@ -886,7 +886,8 @@
mv_edma_cfg(ap, want_ncq);
/* clear FIS IRQ Cause */
- writelfl(0, port_mmio + SATA_FIS_IRQ_CAUSE_OFS);
+ if (IS_GEN_IIE(hpriv))
+ writelfl(0, port_mmio + SATA_FIS_IRQ_CAUSE_OFS);
mv_set_edma_ptrs(port_mmio, hpriv, pp);
@@ -1812,6 +1813,7 @@
{
void __iomem *port_mmio = mv_ap_base(ap);
u32 edma_err_cause, eh_freeze_mask, serr = 0;
+ u32 fis_cause = 0;
struct mv_port_priv *pp = ap->private_data;
struct mv_host_priv *hpriv = ap->host->private_data;
unsigned int action = 0, err_mask = 0;
@@ -1821,16 +1823,19 @@
/*
* Read and clear the SError and err_cause bits.
+ * For GenIIe, if EDMA_ERR_TRANS_IRQ_7 is set, we also must read/clear
+ * the FIS_IRQ_CAUSE register before clearing edma_err_cause.
*/
sata_scr_read(&ap->link, SCR_ERROR, &serr);
sata_scr_write_flush(&ap->link, SCR_ERROR, serr);
edma_err_cause = readl(port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
+ if (IS_GEN_IIE(hpriv) && (edma_err_cause & EDMA_ERR_TRANS_IRQ_7)) {
+ fis_cause = readl(port_mmio + SATA_FIS_IRQ_CAUSE_OFS);
+ writelfl(~fis_cause, port_mmio + SATA_FIS_IRQ_CAUSE_OFS);
+ }
writelfl(~edma_err_cause, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS);
- ata_port_printk(ap, KERN_INFO, "%s: err_cause=%08x pp_flags=0x%x\n",
- __func__, edma_err_cause, pp->pp_flags);
-
if (edma_err_cause & EDMA_ERR_DEV) {
/*
* Device errors during FIS-based switching operation
@@ -1844,6 +1849,9 @@
ata_ehi_clear_desc(ehi);
ata_ehi_push_desc(ehi, "edma_err_cause=%08x pp_flags=%08x",
edma_err_cause, pp->pp_flags);
+
+ if (IS_GEN_IIE(hpriv) && (edma_err_cause & EDMA_ERR_TRANS_IRQ_7))
+ ata_ehi_push_desc(ehi, "fis_cause=%08x", fis_cause);
/*
* All generations share these EDMA error cause bits:
*/
next prev parent reply other threads:[~2008-05-14 13:19 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-14 13:18 [PATCH 01/04] sata_mv always do softreset Mark Lord
2008-05-14 13:19 ` Mark Lord [this message]
2008-05-14 13:21 ` [PATCH 03/04] sata_mv group genIIe flags Mark Lord
2008-05-14 13:24 ` [PATCH 04/04] sata_mv async notify for genIIe only Mark Lord
2008-05-17 17:34 ` [PATCH 05/09] sata_mv don't blindly enable IRQs Mark Lord
2008-05-17 17:35 ` [PATCH 06/09] sata_mv consolidate main_irq_mask updates Mark Lord
2008-05-17 17:36 ` [PATCH 07/09] sata_mv fix pmp drives not found Mark Lord
2008-05-17 17:37 ` [PATCH 08/09] sata_mv disregard masked irqs Mark Lord
2008-05-17 17:38 ` [PATCH 09/09] sata_mv cache main_irq_mask register in hpriv Mark Lord
2008-05-19 13:01 ` [PATCH 10/10] sata_mv: ensure empty request queue for FBS-NCQ EH Mark Lord
2008-05-19 21:41 ` Jeff Garzik
2008-05-19 21:42 ` Jeff Garzik
2008-05-19 18:27 ` [PATCH 09/09] sata_mv cache main_irq_mask register in hpriv Grant Grundler
2008-05-17 17:41 ` [PATCH 05/09] sata_mv don't blindly enable IRQs Jeff Garzik
2008-05-17 17:45 ` Mark Lord
2008-05-17 17:49 ` Jeff Garzik
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=482AE6E2.4080900@rtr.ca \
--to=liml@rtr.ca \
--cc=alan@redhat.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/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 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.