From: Tejun Heo <htejun@gmail.com>
To: "Lars Michael Jogbäck" <lm@jogback.se>
Cc: linux-ide@vger.kernel.org
Subject: Re: Problems with "frozen drives" on sil3124 + sil3726
Date: Mon, 22 Oct 2007 10:44:27 +0900 [thread overview]
Message-ID: <471C007B.30006@gmail.com> (raw)
In-Reply-To: <471A0070.2080403@jogback.se>
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
Lars Michael Jogbäck wrote:
> Hi Tejun et. al.
>
> I'm running a server with Linux 2.6.18.1+Debian's Xen-patches and the
> sata+pmp-patches from
> http://home-tj.org/files/libata-tj-stable/libata-tj-2.6.18.1-20061020.tar.bz2
>
> Unfortunately I can't upgrade to anything newer than 2.6.18 since there
> is no Xen Dom0-patches that I'm aware of to anything newer.
>
> I have successfully for a long time together, but a couple of weeks ago
> my motherboard gave in, and I installed a new one (along with new
> processor/memory).
> I'm running the very same kernel, the same sil3124-controller and the
> same sil3726-PMP-board. The only difference is that instead of a
> Supermicro P4SC8 w/ Intel P4 (and PCI-X slot of 66MHz) I'm currently
> using Supermicro PDSME+ w/ E6600 (and PCI-X slot of 133MHz)
There was a bug in PCI-X irq loss quirk code which went unnoticed for
quite some time bug was fixed recently. Patch attached. Patch might
not apply directly. Just hand edit and move WOC clearing before
SLOT_STAT reading.
--
tejun
[-- Attachment #2: 0001-sata_sil24-fix-IRQ-clearing-race-when-PCIX_IRQ_WOC.patch --]
[-- Type: text/x-patch, Size: 2707 bytes --]
>From 228f47b959a0cf2e24c9696757c7e6510334e499 Mon Sep 17 00:00:00 2001
From: Tejun Heo <htejun@gmail.com>
Date: Sun, 23 Sep 2007 12:37:05 +0900
Subject: [PATCH] sata_sil24: fix IRQ clearing race when PCIX_IRQ_WOC is used
When PCIX_IRQ_WOC is used, sil24 has an inherent race condition
between clearing IRQ pending and reading IRQ status. If IRQ pending
is cleared after reading IRQ status, there's possibility of lost IRQ.
If IRQ pending is cleared before reading IRQ status, spurious IRQs
will occur.
sata_sil24 till now cleared IRQ pending after reading IRQ status thus
losing IRQs on machines where PCIX_IRQ_WOC was used. Reverse the
order and ignore spurious IRQs if PCIX_IRQ_WOC.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index ef83e6b..233e886 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -881,43 +881,51 @@ static void sil24_finish_qc(struct ata_queued_cmd *qc)
if (qc->flags & ATA_QCFLAG_RESULT_TF)
sil24_read_tf(ap, qc->tag, &pp->tf);
}
static inline void sil24_host_intr(struct ata_port *ap)
{
void __iomem *port = ap->ioaddr.cmd_addr;
u32 slot_stat, qc_active;
int rc;
+ /* If PCIX_IRQ_WOC, there's an inherent race window between
+ * clearing IRQ pending status and reading PORT_SLOT_STAT
+ * which may cause spurious interrupts afterwards. This is
+ * unavoidable and much better than losing interrupts which
+ * happens if IRQ pending is cleared after reading
+ * PORT_SLOT_STAT.
+ */
+ if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
+ writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
+
slot_stat = readl(port + PORT_SLOT_STAT);
if (unlikely(slot_stat & HOST_SSTAT_ATTN)) {
sil24_error_intr(ap);
return;
}
- if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC)
- writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT);
-
qc_active = slot_stat & ~HOST_SSTAT_ATTN;
rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc);
if (rc > 0)
return;
if (rc < 0) {
struct ata_eh_info *ehi = &ap->eh_info;
ehi->err_mask |= AC_ERR_HSM;
ehi->action |= ATA_EH_SOFTRESET;
ata_port_freeze(ap);
return;
}
- if (ata_ratelimit())
+ /* spurious interrupts are expected if PCIX_IRQ_WOC */
+ if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit())
ata_port_printk(ap, KERN_INFO, "spurious interrupt "
"(slot_stat 0x%x active_tag %d sactive 0x%x)\n",
slot_stat, ap->active_tag, ap->sactive);
}
static irqreturn_t sil24_interrupt(int irq, void *dev_instance)
{
struct ata_host *host = dev_instance;
void __iomem *host_base = host->iomap[SIL24_HOST_BAR];
unsigned handled = 0;
--
1.5.2.4
prev parent reply other threads:[~2007-10-22 1:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-20 13:19 Problems with "frozen drives" on sil3124 + sil3726 Lars Michael Jogbäck
2007-10-22 1:44 ` Tejun Heo [this message]
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=471C007B.30006@gmail.com \
--to=htejun@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=lm@jogback.se \
/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 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).