Bug 181694

Summary: [iwn] [suspend/resume] [patch] Initialize hardware in iwn(4) resume code
Product: Base System Reporter: Brandon Gooch <jamesbrandongooch>
Component: wirelessAssignee: freebsd-wireless (Nobody) <wireless>
Status: Closed FIXED    
Severity: Affects Only Me CC: gonzo
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Brandon Gooch 2013-08-31 01:50:00 UTC
When resuming from sleep, the iwn(4) doesn't properly restore the hardware to a fully working state.

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:
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.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2013-08-31 03:08:57 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-wireless

Over to maintainer(s).
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-02-25 00:41:23 UTC
A commit references this bug:

Author: avos
Date: Sat Feb 25 00:40:50 UTC 2017
New revision: 314234
URL: https://svnweb.freebsd.org/changeset/base/314234

Log:
  iwn: some initialization / RF switch state change fixes.

  - Check return code from initialization path; otherwise, vap state
  may be wrong after an error.
  - Do not try to run iwn_stop() / iwn_init() multiple times.
  - Merge iwn_radio_on/off() and move RFKILL bit check into the task.
  - Try to handle possible RF switch state change in S3 state (PR 181694).

  PR:		181694
  Reviewed by:	adrian
  Differential Revision:	https://reviews.freebsd.org/D9797

Changes:
  head/sys/dev/iwn/if_iwn.c
  head/sys/dev/iwn/if_iwnvar.h
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:48:00 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 4 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 09:21:36 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks