From owner-freebsd-bugs@FreeBSD.ORG Sat Aug 31 00:50:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CD7BB7C8 for ; Sat, 31 Aug 2013 00:50:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AC5802B10 for ; Sat, 31 Aug 2013 00:50:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r7V0o0JL073220 for ; Sat, 31 Aug 2013 00:50:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r7V0o0k4073209; Sat, 31 Aug 2013 00:50:00 GMT (envelope-from gnats) Resent-Date: Sat, 31 Aug 2013 00:50:00 GMT Resent-Message-Id: <201308310050.r7V0o0k4073209@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, Brandon Gooch Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6475D5B4 for ; Sat, 31 Aug 2013 00:45:10 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 52B362AE5 for ; Sat, 31 Aug 2013 00:45:10 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r7V0j9cR091033 for ; Sat, 31 Aug 2013 00:45:09 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r7V0j9Ha091032; Sat, 31 Aug 2013 00:45:09 GMT (envelope-from nobody) Message-Id: <201308310045.r7V0j9Ha091032@oldred.freebsd.org> Date: Sat, 31 Aug 2013 00:45:09 GMT From: Brandon Gooch To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: kern/181694: Initialize hardware in iwn(4) resume code X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Aug 2013 00:50:01 -0000 >Number: 181694 >Category: kern >Synopsis: Initialize hardware in iwn(4) resume code >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Aug 31 00:50:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Brandon Gooch >Release: 10-CURRENT >Organization: >Environment: FreeBSD m6500.m6500 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r254635M: Thu Aug 22 04:25:59 CDT 2013 root@:/usr/obj/usr/home/brandon/wc/freebsd-base-head/sys/DELL_M6500 amd64 >Description: When resuming from sleep, the iwn(4) doesn't properly restore the hardware to a fully working state. >How-To-Repeat: On a computer with a mechanical "RF Kill" switch (which disables the wireless device radio), enter ACPI S3 (sleep) state with the switch in the "off" position. Then, before resuming, move the switch to the "on" position. Finally, resume the computer from sleep, and realize that the device is not enabled, nor does toggling the switch effect the state. The only "total" fix for this seems to be kldunloading the iwn(4) module, then reloading it with the switch in the "on" position. >Fix: Call the iwn_init() function from iwn_resume(), re-initializing the hardware to a good, working state after resume. Patch attached with submission follows: Index: if_iwn.c =================================================================== --- if_iwn.c (revision 254635) +++ if_iwn.c (working copy) @@ -1030,6 +1030,10 @@ /* Clear device-specific "PCI retry timeout" register (41h). */ pci_write_config(dev, 0x41, 0, 1); + /* Initialize the hardware */ + if (sc->sc_ifp->if_flags & IFF_UP) { + iwn_init(sc); + } ieee80211_resume_all(ic); return 0; } >Release-Note: >Audit-Trail: >Unformatted: