Jiri Slaby 2a3fe1
From: Christoph Hellwig <hch@lst.de>
Jiri Slaby 2a3fe1
Date: Tue, 5 Sep 2017 18:46:47 +0200
Jiri Slaby 2a3fe1
Subject: [PATCH] ahci: don't use MSI for devices with the silly Intel NVMe
Jiri Slaby 2a3fe1
 remapping scheme
Jiri Slaby 2a3fe1
References: bnc#1060662
Thomas Zimmermann 1d81d2
Patch-mainline: v4.12.12
Jiri Slaby 2a3fe1
Git-commit: f723fa4e69920f6a5dd5fa0d10ce90e2f14d189c
Jiri Slaby 2a3fe1
Jiri Slaby 2a3fe1
commit f723fa4e69920f6a5dd5fa0d10ce90e2f14d189c upstream.
Jiri Slaby 2a3fe1
Jiri Slaby 2a3fe1
Intel AHCI controllers that also hide NVMe devices in their bar
Jiri Slaby 2a3fe1
can't use MSI interrupts, so disable them.
Jiri Slaby 2a3fe1
Jiri Slaby 2a3fe1
Reported-by: John Loy <john.robert.loy@gmail.com>
Jiri Slaby 2a3fe1
Tested-by: John Loy <john.robert.loy@gmail.com>
Jiri Slaby 2a3fe1
Signed-off-by: Christoph Hellwig <hch@lst.de>
Jiri Slaby 2a3fe1
Fixes: d684a90d38e2 ("ahci: per-port msix support")
Jiri Slaby 2a3fe1
Signed-off-by: Tejun Heo <tj@kernel.org>
Jiri Slaby 2a3fe1
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Jiri Slaby 2a3fe1
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Jiri Slaby 2a3fe1
---
Jiri Slaby 2a3fe1
 drivers/ata/ahci.c | 9 ++++++++-
Jiri Slaby 2a3fe1
 1 file changed, 8 insertions(+), 1 deletion(-)
Jiri Slaby 2a3fe1
Jiri Slaby 2a3fe1
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
Jiri Slaby 2a3fe1
index c69954023c2e..13080f1284e8 100644
Jiri Slaby 2a3fe1
--- a/drivers/ata/ahci.c
Jiri Slaby 2a3fe1
+++ b/drivers/ata/ahci.c
Jiri Slaby 2a3fe1
@@ -1467,7 +1467,14 @@ static void ahci_remap_check(struct pci_dev *pdev, int bar,
Jiri Slaby 2a3fe1
 		return;
Jiri Slaby 2a3fe1
 
Jiri Slaby 2a3fe1
 	dev_warn(&pdev->dev, "Found %d remapped NVMe devices.\n", count);
Jiri Slaby 2a3fe1
-	dev_warn(&pdev->dev, "Switch your BIOS from RAID to AHCI mode to use them.\n");
Jiri Slaby 2a3fe1
+	dev_warn(&pdev->dev,
Jiri Slaby 2a3fe1
+		 "Switch your BIOS from RAID to AHCI mode to use them.\n");
Jiri Slaby 2a3fe1
+
Jiri Slaby 2a3fe1
+	/*
Jiri Slaby 2a3fe1
+	 * Don't rely on the msi-x capability in the remap case,
Jiri Slaby 2a3fe1
+	 * share the legacy interrupt across ahci and remapped devices.
Jiri Slaby 2a3fe1
+	 */
Jiri Slaby 2a3fe1
+	hpriv->flags |= AHCI_HFLAG_NO_MSI;
Jiri Slaby 2a3fe1
 }
Jiri Slaby 2a3fe1
 
Jiri Slaby 2a3fe1
 static int ahci_get_irq_vector(struct ata_host *host, int port)
Jiri Slaby 2a3fe1
-- 
Jiri Slaby 2a3fe1
2.14.2
Jiri Slaby 2a3fe1