Blame SOURCES/0002-sky2-Disable-MSI-on-Dell-Inspiron-1545-and-Gateway-P.patch

Kmods SIG 6dd491
From b33b7cd6fd86478dd2890a9abeb6f036aa01fdf7 Mon Sep 17 00:00:00 2001
Kmods SIG 6dd491
From: Kai-Heng Feng <kai.heng.feng@canonical.com>
Kmods SIG 6dd491
Date: Mon, 4 Mar 2019 15:00:03 +0800
Kmods SIG 6dd491
Subject: [Backport b33b7cd6fd86] sky2: Disable MSI on Dell Inspiron 1545 and
Kmods SIG 6dd491
 Gateway P-79
Kmods SIG 6dd491
Kmods SIG 6dd491
Some sky2 chips fire IRQ after S3, before the driver is fully resumed:
Kmods SIG 6dd491
[ 686.804877] do_IRQ: 1.37 No irq handler for vector
Kmods SIG 6dd491
Kmods SIG 6dd491
This is likely a platform bug that device isn't fully quiesced during
Kmods SIG 6dd491
S3. Use MSI-X, maskable MSI or INTx can prevent this issue from
Kmods SIG 6dd491
happening.
Kmods SIG 6dd491
Kmods SIG 6dd491
Since MSI-X and maskable MSI are not supported by this device, fallback
Kmods SIG 6dd491
to use INTx on affected platforms.
Kmods SIG 6dd491
Kmods SIG 6dd491
BugLink: https://bugs.launchpad.net/bugs/1807259
Kmods SIG 6dd491
BugLink: https://bugs.launchpad.net/bugs/1809843
Kmods SIG 6dd491
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Kmods SIG 6dd491
Signed-off-by: David S. Miller <davem@davemloft.net>
Kmods SIG 6dd491
---
Kmods SIG 6dd491
 src/sky2.c | 24 +++++++++++++++++++++++-
Kmods SIG 6dd491
 1 file changed, 23 insertions(+), 1 deletion(-)
Kmods SIG 6dd491
Kmods SIG 6dd491
diff --git a/src/sky2.c b/src/sky2.c
Kmods SIG 6dd491
index 57727fe1501ee851ec5ca3e4dfe45d54ee5934e9..8b3495ee2b6eb7aeeabdb4449e21e05f61562435 100644
Kmods SIG 6dd491
--- a/src/sky2.c
Kmods SIG 6dd491
+++ b/src/sky2.c
Kmods SIG 6dd491
@@ -46,6 +46,7 @@
Kmods SIG 6dd491
 #include <linux/mii.h>
Kmods SIG 6dd491
 #include <linux/of_device.h>
Kmods SIG 6dd491
 #include <linux/of_net.h>
Kmods SIG 6dd491
+#include <linux/dmi.h>
Kmods SIG 6dd491
 
Kmods SIG 6dd491
 #include <asm/irq.h>
Kmods SIG 6dd491
 
Kmods SIG 6dd491
@@ -93,7 +94,7 @@ static int copybreak __read_mostly = 128;
Kmods SIG 6dd491
 module_param(copybreak, int, 0);
Kmods SIG 6dd491
 MODULE_PARM_DESC(copybreak, "Receive copy threshold");
Kmods SIG 6dd491
 
Kmods SIG 6dd491
-static int disable_msi = 0;
Kmods SIG 6dd491
+static int disable_msi = -1;
Kmods SIG 6dd491
 module_param(disable_msi, int, 0);
Kmods SIG 6dd491
 MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)");
Kmods SIG 6dd491
 
Kmods SIG 6dd491
@@ -4917,6 +4918,24 @@ static const char *sky2_name(u8 chipid, char *buf, int sz)
Kmods SIG 6dd491
 	return buf;
Kmods SIG 6dd491
 }
Kmods SIG 6dd491
 
Kmods SIG 6dd491
+static const struct dmi_system_id msi_blacklist[] = {
Kmods SIG 6dd491
+	{
Kmods SIG 6dd491
+		.ident = "Dell Inspiron 1545",
Kmods SIG 6dd491
+		.matches = {
Kmods SIG 6dd491
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
Kmods SIG 6dd491
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1545"),
Kmods SIG 6dd491
+		},
Kmods SIG 6dd491
+	},
Kmods SIG 6dd491
+	{
Kmods SIG 6dd491
+		.ident = "Gateway P-79",
Kmods SIG 6dd491
+		.matches = {
Kmods SIG 6dd491
+			DMI_MATCH(DMI_SYS_VENDOR, "Gateway"),
Kmods SIG 6dd491
+			DMI_MATCH(DMI_PRODUCT_NAME, "P-79"),
Kmods SIG 6dd491
+		},
Kmods SIG 6dd491
+	},
Kmods SIG 6dd491
+	{}
Kmods SIG 6dd491
+};
Kmods SIG 6dd491
+
Kmods SIG 6dd491
 static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
Kmods SIG 6dd491
 {
Kmods SIG 6dd491
 	struct net_device *dev, *dev1;
Kmods SIG 6dd491
@@ -5028,6 +5047,9 @@ static int sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
Kmods SIG 6dd491
 		goto err_out_free_pci;
Kmods SIG 6dd491
 	}
Kmods SIG 6dd491
 
Kmods SIG 6dd491
+	if (disable_msi == -1)
Kmods SIG 6dd491
+		disable_msi = !!dmi_check_system(msi_blacklist);
Kmods SIG 6dd491
+
Kmods SIG 6dd491
 	if (!disable_msi && pci_enable_msi(pdev) == 0) {
Kmods SIG 6dd491
 		err = sky2_test_msi(hw);
Kmods SIG 6dd491
 		if (err) {
Kmods SIG 6dd491
-- 
Kmods SIG 6dd491
2.31.1
Kmods SIG 6dd491