All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Torsten Kaiser <just.for.lkml@googlemail.com>
Cc: linux-kernel@vger.kernel.org, Jeff Garzik <jgarzik@pobox.com>,
	linux-ide@vger.kernel.org
Subject: Re: MSI broken in libata?
Date: Mon, 11 Jan 2010 10:15:51 +0900	[thread overview]
Message-ID: <4B4A7BC7.6060106@kernel.org> (raw)
In-Reply-To: <64bb37e1001092033r1f0b4defw46c1a07101bb2d1b@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

On 01/10/2010 01:33 PM, Torsten Kaiser wrote:
> I did try the patch from Robert Hancock in
> http://lkml.org/lkml/2010/1/6/417 ,but without success.
> 
> if you need any more information, or have something for me to try,
> please just ask. I did look at the code and the documentation about
> enabling MSI, but did not see anything (obvious) wrong, so I don't
> know what to try next.

Can you please try the attached patch?

Thanks.

-- 
tejun

[-- Attachment #2: sil24-msi-possible-fix.patch --]
[-- Type: text/x-patch, Size: 1916 bytes --]

diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 1370df6..b03bc5b 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -102,6 +102,7 @@ enum {
 	HOST_CTRL_STOP		= (1 << 18), /* latched PCI STOP */
 	HOST_CTRL_DEVSEL	= (1 << 19), /* latched PCI DEVSEL */
 	HOST_CTRL_REQ64		= (1 << 20), /* latched PCI REQ64 */
+	HOST_CTRL_MSIACK        = (1 << 30), /* MSI acknowledge */
 	HOST_CTRL_GLOBAL_RST	= (1 << 31), /* global reset */
 
 	/*
@@ -248,6 +249,7 @@ enum {
 				  ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA |
 				  ATA_FLAG_AN | ATA_FLAG_PMP,
 	SIL24_FLAG_PCIX_IRQ_WOC	= (1 << 24), /* IRQ loss errata on PCI-X */
+	SIL24_FLAG_MSI		= (1 << 25), /* MSI enabled */
 
 	IRQ_STAT_4PORTS		= 0xf,
 };
@@ -1144,18 +1146,22 @@ static irqreturn_t sil24_interrupt(int irq, void *dev_instance)
 	u32 status;
 	int i;
 
+	spin_lock(&host->lock);
+
+	if (host->ports[0]->flags & SIL24_FLAG_MSI)
+		writel(IRQ_STAT_4PORTS | HOST_CTRL_MSIACK,
+		       host_base + HOST_CTRL);
+
 	status = readl(host_base + HOST_IRQ_STAT);
 
 	if (status == 0xffffffff) {
 		printk(KERN_ERR DRV_NAME ": IRQ status == 0xffffffff, "
 		       "PCI fault or device removal?\n");
-		goto out;
+		goto out_unlock;
 	}
 
 	if (!(status & IRQ_STAT_4PORTS))
-		goto out;
-
-	spin_lock(&host->lock);
+		goto out_unlock;
 
 	for (i = 0; i < host->n_ports; i++)
 		if (status & (1 << i)) {
@@ -1168,8 +1174,8 @@ static irqreturn_t sil24_interrupt(int irq, void *dev_instance)
 				       ": interrupt from disabled port %d\n", i);
 		}
 
+ out_unlock:
 	spin_unlock(&host->lock);
- out:
 	return IRQ_RETVAL(handled);
 }
 
@@ -1347,6 +1353,7 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	if (sata_sil24_msi && !pci_enable_msi(pdev)) {
 		dev_printk(KERN_INFO, &pdev->dev, "Using MSI\n");
 		pci_intx(pdev, 0);
+		host->ports[0]->flags |= SIL24_FLAG_MSI;
 	}
 
 	pci_set_master(pdev);

  reply	other threads:[~2010-01-11  1:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-25  9:22 MSI broken in libata? Torsten Kaiser
2010-01-09  9:11 ` Tejun Heo
2010-01-10  4:33   ` Torsten Kaiser
2010-01-11  1:15     ` Tejun Heo [this message]
2010-01-11  1:39       ` Robert Hancock
2010-01-11  2:17         ` Tejun Heo
2010-01-16 21:58         ` Torsten Kaiser
2010-01-17 19:22           ` Robert Hancock
2010-01-17 21:11             ` Torsten Kaiser
2010-01-18 20:51               ` Torsten Kaiser
2010-01-19  2:03                 ` Robert Hancock
2010-01-19  7:00                   ` Torsten Kaiser
2010-01-19 20:20                   ` Torsten Kaiser
2010-01-20  3:00                     ` Robert Hancock
2010-01-20  6:48                       ` Torsten Kaiser
2010-01-22  0:53                         ` Robert Hancock
2010-01-11  6:44       ` Torsten Kaiser

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=4B4A7BC7.6060106@kernel.org \
    --to=tj@kernel.org \
    --cc=jgarzik@pobox.com \
    --cc=just.for.lkml@googlemail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@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.