Message ID | 20100517122236.7f33101f@nehalam |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
Hi Stephen, On Mon, May 17, 2010 at 03:22:36PM -0400, Stephen Hemminger wrote: > On Mon, 17 May 2010 20:52:28 +0200 > Joerg Roedel <joerg.roedel@amd.com> wrote: > > I experience the following crash with 2.6.34 in the sky2 code on my > > laptop when I plug off the lan-cable and then plug-off the power cable > > and switching to battery. It does not happen with acpi=off. > > So you have a busted BIOS that powers off the device. Yeah you are right, its a BIOS issue. I tried to find out how the OS is informed about the device taken away. But none of the hotplug drivers or enabling acpi debug showed anything here. I wonder how this is done in the "other" operating system. Or how the device could be re-enabled, plugging the wires back doesn't help. Very weird. Anyway, I found a BIOS option to disable this behavior and now things work unpatched. Thanks for your help. Joerg -- 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
--- a/drivers/net/sky2.c 2010-05-17 12:09:22.721738360 -0700 +++ b/drivers/net/sky2.c 2010-05-17 12:19:52.845893670 -0700 @@ -2904,6 +2904,16 @@ static int sky2_poll(struct napi_struct int work_done = 0; u16 idx; + if (unlikely(status == ~0)) { + int i; + dev_err(&hw->pdev->dev, + "device no longer available (powered off?)\n"); + + for (i = 0; i < hw->ports; i++) + netif_device_detach(hw->dev[i]); + goto complete; + } + if (unlikely(status & Y2_IS_ERROR)) sky2_err_intr(hw, status); @@ -2922,7 +2932,7 @@ static int sky2_poll(struct napi_struct if (work_done >= work_limit) goto done; } - +complete: napi_complete(napi); sky2_read32(hw, B0_Y2_SP_LISR); done: