svn commit: r343376 - head/sys/dev/iwm
Kyle Evans
kevans at FreeBSD.org
Thu Jan 24 03:43:00 UTC 2019
Author: kevans
Date: Thu Jan 24 03:42:59 2019
New Revision: 343376
URL: https://svnweb.freebsd.org/changeset/base/343376
Log:
if_iwm - Check sc->sc_attached flag in suspend/resume callbacks.
* There is (almost) nothing to do in suspend/resume if if_iwm has failed
during initialization (e.g. because of firmware load failure) and was
already uninitialized by iwm_detach_local().
Submitted by: Augustin Cavalier <waddlesplash at gmail.com> (Haiku)
Obtained from: DragonFlyBSD (67b5e090efb225654815fed91020db6cfc16bb19)
Modified:
head/sys/dev/iwm/if_iwm.c
Modified: head/sys/dev/iwm/if_iwm.c
==============================================================================
--- head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:23 2019 (r343375)
+++ head/sys/dev/iwm/if_iwm.c Thu Jan 24 03:42:59 2019 (r343376)
@@ -6301,6 +6301,10 @@ iwm_resume(device_t dev)
* PCI Tx retries from interfering with C3 CPU state.
*/
pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1);
+
+ if (!sc->sc_attached)
+ return 0;
+
iwm_init_task(device_get_softc(dev));
IWM_LOCK(sc);
@@ -6323,6 +6327,9 @@ iwm_suspend(device_t dev)
struct iwm_softc *sc = device_get_softc(dev);
do_stop = !! (sc->sc_ic.ic_nrunning > 0);
+
+ if (!sc->sc_attached)
+ return (0);
ieee80211_suspend_all(&sc->sc_ic);
More information about the svn-src-head
mailing list