Patchwork commit 0bdb0bd0 breaks shutdown/reboot

login
register
mail settings
Submitter stephen hemminger
Date Nov. 7, 2011, 4:13 p.m.
Message ID <20111107081316.2e1cc2cb@nehalam.linuxnetplumber.net>
Download mbox | patch
Permalink /patch/124124/
State RFC
Delegated to: David Miller
Headers show

Comments

stephen hemminger - Nov. 7, 2011, 4:13 p.m.
Does this help?

Subject: sky2: block irq's on down

Need to block IRQ's from phy changes to prevent stray IRQ's when
device is down.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dominik Brodowski - Nov. 7, 2011, 4:32 p.m.
On Mon, Nov 07, 2011 at 08:13:16AM -0800, Stephen Hemminger wrote:
> Does this help?

Unfortunately, no. Reboots still fail.

> 
> Subject: sky2: block irq's on down
> 
> Need to block IRQ's from phy changes to prevent stray IRQ's when
> device is down.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

Thanks anyway,
	Dominik
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Nov. 7, 2011, 4:45 p.m.
On Mon, 7 Nov 2011 17:32:27 +0100
Dominik Brodowski <linux@dominikbrodowski.net> wrote:

> On Mon, Nov 07, 2011 at 08:13:16AM -0800, Stephen Hemminger wrote:
> > Does this help?
> 
> Unfortunately, no. Reboots still fail.
> 
> > 
> > Subject: sky2: block irq's on down
> > 
> > Need to block IRQ's from phy changes to prevent stray IRQ's when
> > device is down.
> > 
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> Thanks anyway,
> 	Dominik

Are you using Wake On Lan?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dominik Brodowski - Nov. 7, 2011, 5:08 p.m.
On Mon, Nov 07, 2011 at 08:45:40AM -0800, Stephen Hemminger wrote:
> On Mon, 7 Nov 2011 17:32:27 +0100
> Dominik Brodowski <linux@dominikbrodowski.net> wrote:
> 
> > On Mon, Nov 07, 2011 at 08:13:16AM -0800, Stephen Hemminger wrote:
> > > Does this help?
> > 
> > Unfortunately, no. Reboots still fail.
> > 
> > > 
> > > Subject: sky2: block irq's on down
> > > 
> > > Need to block IRQ's from phy changes to prevent stray IRQ's when
> > > device is down.
> > > 
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > 
> > Thanks anyway,
> > 	Dominik
> 
> Are you using Wake On Lan?

Not that I'm aware of. Explicitly disabling WOL by

	$ ethtool -s eth0 wol d

does not help, though.

Best,
	Dominik
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Nov. 8, 2011, 12:57 a.m.
I can reproduce on my laptop, let me investigate.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

--- a/drivers/net/ethernet/marvell/sky2.c	2011-11-04 15:01:51.310888300 -0700
+++ b/drivers/net/ethernet/marvell/sky2.c	2011-11-07 08:10:05.065118917 -0800
@@ -2106,15 +2106,20 @@  static int sky2_down(struct net_device *
 
 	netif_info(sky2, ifdown, dev, "disabling interface\n");
 
-	/* Disable port IRQ */
-	sky2_write32(hw, B0_IMSK,
-		     sky2_read32(hw, B0_IMSK) & ~portirq_msk[sky2->port]);
-	sky2_read32(hw, B0_IMSK);
-
 	if (hw->ports == 1) {
+		sky2_write32(hw, B0_IMSK, 0);
+		sky2_read32(hw, B0_IMSK);
+
 		napi_disable(&hw->napi);
 		free_irq(hw->pdev->irq, hw);
 	} else {
+		/* Disable port IRQ */
+		u32 imsk = sky2_read32(hw, B0_IMSK);
+
+		imsk &= ~portirq_msk[sky2->port];
+		sky2_write32(hw, B0_IMSK, imsk);
+		sky2_read32(hw, B0_IMSK);
+
 		synchronize_irq(hw->pdev->irq);
 		napi_synchronize(&hw->napi);
 	}
@@ -5017,19 +5022,19 @@  static void __devexit sky2_remove(struct
 	for (i = hw->ports-1; i >= 0; --i)
 		unregister_netdev(hw->dev[i]);
 
-	sky2_write32(hw, B0_IMSK, 0);
-	sky2_read32(hw, B0_IMSK);
-
 	sky2_power_aux(hw);
 
-	sky2_write8(hw, B0_CTST, CS_RST_SET);
-	sky2_read8(hw, B0_CTST);
-
 	if (hw->ports > 1) {
+		sky2_write32(hw, B0_IMSK, 0);
+		sky2_read32(hw, B0_IMSK);
+
 		napi_disable(&hw->napi);
 		free_irq(pdev->irq, hw);
 	}
 
+	sky2_write8(hw, B0_CTST, CS_RST_SET);
+	sky2_read8(hw, B0_CTST);
+
 	if (hw->flags & SKY2_HW_USE_MSI)
 		pci_disable_msi(pdev);
 	pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),