summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorStefan Sperling <stsp@cvs.openbsd.org>2017-12-07 14:12:40 +0000
committerStefan Sperling <stsp@cvs.openbsd.org>2017-12-07 14:12:40 +0000
commit99ba969530bbfce5dfca49d0fe0e792906122ccb (patch)
tree69a267a6c7c917b71b0db3a4ff0f98d1453b1bd5 /sys/dev/pci
parent478b24e63c53d8c54e371debe2481bae3a4302c3 (diff)
Make iwm_newstate() recover from state transition errors.
On error, we now schedule the init task which will whack the interface when it gets to run, which prevents the driver from stalling in such situations. ok phessler@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index cf1749b1010..036ecf46eef 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.217 2017/10/26 15:00:28 mpi Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.218 2017/12/07 14:12:39 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -6056,8 +6056,12 @@ iwm_newstate_task(void *psc)
}
out:
- if (err == 0 && (sc->sc_flags & IWM_FLAG_SHUTDOWN) == 0)
- sc->sc_newstate(ic, nstate, arg);
+ if ((sc->sc_flags & IWM_FLAG_SHUTDOWN) == 0) {
+ if (err)
+ task_add(systq, &sc->init_task);
+ else
+ sc->sc_newstate(ic, nstate, arg);
+ }
refcnt_rele_wake(&sc->task_refs);
splx(s);
}