netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] sky2/skge bug fix patches for 2.6.22
@ 2007-05-11 18:21 Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 1/4] sky2: fix oops on shutdown Stephen Hemminger
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Stephen Hemminger @ 2007-05-11 18:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

These are all bug fixes for 2.6.22. I'll spin a set for the
2.6.21 stable kernel after that.


--
Stephen Hemminger <shemminger@linux-foundation.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/4] sky2: fix oops on shutdown
  2007-05-11 18:21 [PATCH 0/4] sky2/skge bug fix patches for 2.6.22 Stephen Hemminger
@ 2007-05-11 18:21 ` Stephen Hemminger
  2007-05-11 20:58   ` Jeff Garzik
  2007-05-11 18:21 ` [PATCH 2/4] skge: crash on shutdown/suspend Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2007-05-11 18:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-shutdown.patch --]
[-- Type: text/plain, Size: 1348 bytes --]

If the device is fails during module startup for some reason like
unsupported chip version then the driver would crash dereferencing a
null pointer, on shutdown or suspend/resume.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/sky2.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- sky2-2.6.21.orig/drivers/net/sky2.c	2007-05-10 10:27:48.000000000 -0700
+++ sky2-2.6.21/drivers/net/sky2.c	2007-05-10 11:29:17.000000000 -0700
@@ -3732,6 +3732,7 @@ err_out_free_regions:
 err_out_disable:
 	pci_disable_device(pdev);
 err_out:
+	pci_set_drvdata(pdev, NULL);
 	return err;
 }
 
@@ -3784,6 +3785,9 @@ static int sky2_suspend(struct pci_dev *
 	struct sky2_hw *hw = pci_get_drvdata(pdev);
 	int i, wol = 0;
 
+	if (!hw)
+		return 0;
+
 	del_timer_sync(&hw->idle_timer);
 	netif_poll_disable(hw->dev[0]);
 
@@ -3815,6 +3819,9 @@ static int sky2_resume(struct pci_dev *p
 	struct sky2_hw *hw = pci_get_drvdata(pdev);
 	int i, err;
 
+	if (!hw)
+		return 0;
+
 	err = pci_set_power_state(pdev, PCI_D0);
 	if (err)
 		goto out;
@@ -3861,6 +3868,9 @@ static void sky2_shutdown(struct pci_dev
 	struct sky2_hw *hw = pci_get_drvdata(pdev);
 	int i, wol = 0;
 
+	if (!hw)
+		return;
+
 	del_timer_sync(&hw->idle_timer);
 	netif_poll_disable(hw->dev[0]);
 

--
Stephen Hemminger <shemminger@linux-foundation.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/4] skge: crash on shutdown/suspend
  2007-05-11 18:21 [PATCH 0/4] sky2/skge bug fix patches for 2.6.22 Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 1/4] sky2: fix oops on shutdown Stephen Hemminger
@ 2007-05-11 18:21 ` Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 3/4] sky2: 88e8071 support not ready Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 4/4] sky2: only disable 88e8056 on some boards Stephen Hemminger
  3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2007-05-11 18:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: skge-shutdown.patch --]
[-- Type: text/plain, Size: 1222 bytes --]

If device is not fails during module startup (like unsupported chip
version) then driver would crash dereferencing a null pointer, on shutdown
or suspend/resume.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/skge.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- sky2-2.6.21.orig/drivers/net/skge.c	2007-05-10 10:44:29.000000000 -0700
+++ sky2-2.6.21/drivers/net/skge.c	2007-05-10 10:45:57.000000000 -0700
@@ -3802,6 +3802,9 @@ static int skge_suspend(struct pci_dev *
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
 	int i, err, wol = 0;
 
+	if (!hw)
+		return 0;
+
 	err = pci_save_state(pdev);
 	if (err)
 		return err;
@@ -3830,6 +3833,9 @@ static int skge_resume(struct pci_dev *p
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
 	int i, err;
 
+	if (!hw)
+		return 0;
+
 	err = pci_set_power_state(pdev, PCI_D0);
 	if (err)
 		goto out;
@@ -3868,6 +3874,9 @@ static void skge_shutdown(struct pci_dev
 	struct skge_hw *hw  = pci_get_drvdata(pdev);
 	int i, wol = 0;
 
+	if (!hw)
+		return;
+
 	for (i = 0; i < hw->ports; i++) {
 		struct net_device *dev = hw->dev[i];
 		struct skge_port *skge = netdev_priv(dev);

--
Stephen Hemminger <shemminger@linux-foundation.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/4] sky2: 88e8071 support not ready
  2007-05-11 18:21 [PATCH 0/4] sky2/skge bug fix patches for 2.6.22 Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 1/4] sky2: fix oops on shutdown Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 2/4] skge: crash on shutdown/suspend Stephen Hemminger
@ 2007-05-11 18:21 ` Stephen Hemminger
  2007-05-11 18:21 ` [PATCH 4/4] sky2: only disable 88e8056 on some boards Stephen Hemminger
  3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2007-05-11 18:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-ex-disable.patch --]
[-- Type: text/plain, Size: 892 bytes --]

The driver is not ready to support 88e8071 chip.
If this chip is present, system will hang on boot.

So remove it from PCI device id's for now. 

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/sky2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- sky2-2.6.21.orig/drivers/net/sky2.c	2007-05-10 09:36:15.000000000 -0700
+++ sky2-2.6.21/drivers/net/sky2.c	2007-05-10 09:36:16.000000000 -0700
@@ -130,7 +130,7 @@ static const struct pci_device_id sky2_i
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4368) }, /* 88EC034 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4369) }, /* 88EC042 */
 	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436A) }, /* 88E8058 */
-	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */
+//	{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x436B) }, /* 88E8071 */
 	{ 0 }
 };
 

--
Stephen Hemminger <shemminger@linux-foundation.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/4] sky2: only disable 88e8056 on some boards
  2007-05-11 18:21 [PATCH 0/4] sky2/skge bug fix patches for 2.6.22 Stephen Hemminger
                   ` (2 preceding siblings ...)
  2007-05-11 18:21 ` [PATCH 3/4] sky2: 88e8071 support not ready Stephen Hemminger
@ 2007-05-11 18:21 ` Stephen Hemminger
  3 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2007-05-11 18:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev

[-- Attachment #1: sky2-dmi-gigabyte.patch --]
[-- Type: text/plain, Size: 2630 bytes --]

Use DMI to add a blacklist of broken boards (so far only one).
Hopefully, the problems will be solved later, and the the whole
blacklist can disappear.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>

---
 drivers/net/sky2.c |   41 ++++++++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 11 deletions(-)

--- net-2.6.orig/drivers/net/sky2.c	2007-05-11 11:08:25.000000000 -0700
+++ net-2.6/drivers/net/sky2.c	2007-05-11 11:13:01.000000000 -0700
@@ -40,6 +40,7 @@
 #include <linux/if_vlan.h>
 #include <linux/prefetch.h>
 #include <linux/mii.h>
+#include <linux/dmi.h>
 
 #include <asm/irq.h>
 
@@ -150,6 +151,8 @@ static const char *yukon2_name[] = {
 	"FE",		/* 0xb7 */
 };
 
+static int dmi_blacklisted;
+
 /* Access to external PHY */
 static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val)
 {
@@ -2531,6 +2534,17 @@ static int __devinit sky2_init(struct sk
 		return -EOPNOTSUPP;
 	}
 
+
+	/* Some Gigabyte motherboards have 88e8056 but cause problems
+	 * There is some unresolved hardware related problem that causes
+	 * descriptor errors and receive data corruption.
+	 */
+	if (hw->chip_id == CHIP_ID_YUKON_EC_U && dmi_blacklisted) {
+		dev_err(&hw->pdev->dev,
+			"88E8056 on this motherboard not supported\n");
+		return -EOPNOTSUPP;
+	}
+
 	hw->pmd_type = sky2_read8(hw, B2_PMD_TYP);
 	hw->ports = 1;
 	t8 = sky2_read8(hw, B2_Y2_HW_RES);
@@ -3578,17 +3592,6 @@ static int __devinit sky2_probe(struct p
 		goto err_out;
 	}
 
-	/* Some Gigabyte motherboards have 88e8056 but cause problems
-	 * There is some unresolved hardware related problem that causes
-	 * descriptor errors and receive data corruption.
-	 */
-	if (pdev->vendor == PCI_VENDOR_ID_MARVELL &&
-	    pdev->device == 0x4364 && pdev->subsystem_vendor == 0x1458) {
-		dev_err(&pdev->dev,
-			"88E8056 on Gigabyte motherboards not supported\n");
-		goto err_out_disable;
-	}
-
 	err = pci_request_regions(pdev, DRV_NAME);
 	if (err) {
 		dev_err(&pdev->dev, "cannot obtain PCI resources\n");
@@ -3907,8 +3910,24 @@ static struct pci_driver sky2_driver = {
 	.shutdown = sky2_shutdown,
 };
 
+static struct dmi_system_id __initdata broken_dmi_table[] = {
+	{
+		.ident = "Gigabyte 965P-S3",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Gigabyte Technology Co., Ltd."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "965P-S3"),
+
+		},
+	},
+	{ }
+};
+
 static int __init sky2_init_module(void)
 {
+	/* Look for sick motherboards */
+	if (dmi_check_system(broken_dmi_table))
+		dmi_blacklisted = 1;
+
 	return pci_register_driver(&sky2_driver);
 }
 

--
Stephen Hemminger <shemminger@linux-foundation.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/4] sky2: fix oops on shutdown
  2007-05-11 18:21 ` [PATCH 1/4] sky2: fix oops on shutdown Stephen Hemminger
@ 2007-05-11 20:58   ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-05-11 20:58 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Stephen Hemminger wrote:
> If the device is fails during module startup for some reason like
> unsupported chip version then the driver would crash dereferencing a
> null pointer, on shutdown or suspend/resume.
> 
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
> 
> ---
>  drivers/net/sky2.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)

applied 1-4



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-11 20:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-11 18:21 [PATCH 0/4] sky2/skge bug fix patches for 2.6.22 Stephen Hemminger
2007-05-11 18:21 ` [PATCH 1/4] sky2: fix oops on shutdown Stephen Hemminger
2007-05-11 20:58   ` Jeff Garzik
2007-05-11 18:21 ` [PATCH 2/4] skge: crash on shutdown/suspend Stephen Hemminger
2007-05-11 18:21 ` [PATCH 3/4] sky2: 88e8071 support not ready Stephen Hemminger
2007-05-11 18:21 ` [PATCH 4/4] sky2: only disable 88e8056 on some boards Stephen Hemminger

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).