diff options
author | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-05-31 08:43:08 +0000 |
---|---|---|
committer | Stefan Sperling <stsp@cvs.openbsd.org> | 2021-05-31 08:43:08 +0000 |
commit | 395aacc000fad9d048ed4682ca8174dd5dd22a5b (patch) | |
tree | efd3aa85e804785c1f9f989803c634d53ad52437 /sys/dev/pci | |
parent | 01d9caf76f27daaefacc211cf861b313e5a1d0ac (diff) |
Avoid "mac clock not ready" panic in iwx(4).
The same change was just made in iwm(4):
The point of iwm_nic_assert_locked() is to verify that iwm_nic_lock() has
been called somewhere up in the call stack. Checking our own lock counter
is sufficient for this purpose.
If locking the device worked then these registers had the expected state at
that time and our lock counter was incremented. Apparently if the device runs
into some issue later the state of these registers may change and trigger
these panics. Instead we want to handle such failures gracefully and reset
the device.
problem reported by steven@
ok kettenis@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_iwx.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sys/dev/pci/if_iwx.c b/sys/dev/pci/if_iwx.c index a37ba57c905..603040437b7 100644 --- a/sys/dev/pci/if_iwx.c +++ b/sys/dev/pci/if_iwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwx.c,v 1.56 2021/05/16 15:10:20 deraadt Exp $ */ +/* $OpenBSD: if_iwx.c,v 1.57 2021/05/31 08:43:07 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -1454,11 +1454,6 @@ iwx_nic_lock(struct iwx_softc *sc) void iwx_nic_assert_locked(struct iwx_softc *sc) { - uint32_t reg = IWX_READ(sc, IWX_CSR_GP_CNTRL); - if ((reg & IWX_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY) == 0) - panic("%s: mac clock not ready", DEVNAME(sc)); - if (reg & IWX_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP) - panic("%s: mac gone to sleep", DEVNAME(sc)); if (sc->sc_nic_locks <= 0) panic("%s: nic locks counter %d", DEVNAME(sc), sc->sc_nic_locks); } |