From owner-freebsd-bugs@FreeBSD.ORG Sat May 15 12:50:05 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 722B81065676 for ; Sat, 15 May 2010 12:50:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 110078FC1F for ; Sat, 15 May 2010 12:50:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o4FCo4T8049071 for ; Sat, 15 May 2010 12:50:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o4FCo4Lj049070; Sat, 15 May 2010 12:50:04 GMT (envelope-from gnats) Resent-Date: Sat, 15 May 2010 12:50:04 GMT Resent-Message-Id: <201005151250.o4FCo4Lj049070@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Taku YAMAMOTO Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFF5B106566B for ; Sat, 15 May 2010 12:40:05 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7528FC0C for ; Sat, 15 May 2010 12:40:05 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o4FCe39P076731 for ; Sat, 15 May 2010 12:40:03 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o4FCe3Ph076719; Sat, 15 May 2010 12:40:03 GMT (envelope-from nobody) Message-Id: <201005151240.o4FCe3Ph076719@www.freebsd.org> Date: Sat, 15 May 2010 12:40:03 GMT From: Taku YAMAMOTO To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/146614: if_em.c prevents the 2nd time resuming X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2010 12:50:05 -0000 >Number: 146614 >Category: kern >Synopsis: if_em.c prevents the 2nd time resuming >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat May 15 12:50:04 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Taku YAMAMOTO >Release: 9.0-CURRENT(after r206001), 8.0-STABLE(after r206211) >Organization: Confortune Co., Ltd. >Environment: FreeBSD biotite.tackymt.homeip.net 9.0-CURRENT FreeBSD 9.0-CURRENT #190: Thu May 13 13:16:18 JST 2010 taku@biotite.tackymt.homeip.net:/home/taku/work/build/biotite/usr/src/sys/BIOTITE i386 FreeBSD truth.mskc.confortune.co.jp 8.0-STABLE FreeBSD 8.0-STABLE #10: Tue May 11 15:31:50 JST 2010 root@:/home/tackymt/work/build/truth/usr/src/sys/TRUTH i386 >Description: If we let a machine with an em interface suspend, resume then suspend again, the machine panics on the next resume. It seems this bug have got introduced by the changeset r206001(head) and r206211(stable/8). >How-To-Repeat: On a machine with em interface and working suspend, to suspend, resume, suspend again and then resume again will result to a panic. >Fix: The attached patch seems to fix the bug. (Tested on Thinkpad X60 and X61, 9.0-CURRENT and 8.0-STABLE respectively) I'm not so confident of the correctness of em_resume() part of the fix, though. Patch attached with submission follows: --- sys/dev/e1000/if_em.c.orig 2010-04-29 04:22:52.000000000 +0900 +++ sys/dev/e1000/if_em.c 2010-05-08 19:19:43.587862831 +0900 @@ -705,6 +705,9 @@ em_detach(device_t dev) return (EBUSY); } + if (adapter->led_dev != NULL) + led_destroy(adapter->led_dev); + #ifdef DEVICE_POLLING if (ifp->if_capenable & IFCAP_POLLING) ether_poll_deregister(ifp); @@ -779,9 +782,6 @@ em_resume(device_t dev) struct adapter *adapter = device_get_softc(dev); struct ifnet *ifp = adapter->ifp; - if (adapter->led_dev != NULL) - led_destroy(adapter->led_dev); - EM_CORE_LOCK(adapter); em_init_locked(adapter); em_init_manageability(adapter); >Release-Note: >Audit-Trail: >Unformatted: