From nobody@FreeBSD.org  Sat Aug 31 00:45:10 2013
Return-Path: <nobody@FreeBSD.org>
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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <freebsd-gnats-submit@FreeBSD.org>; 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 <jamesbrandongooch@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Initialize hardware in iwn(4) resume code
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181694
>Category:       kern
>Synopsis:       [iwn] [suspend/resume] [patch] Initialize hardware in iwn(4) resume code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>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:  Tue Apr 22 05:34:54 UTC 2014
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Aug 31 02:08:57 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181694 
>Unformatted:
