From: stsp Date: Thu, 7 Dec 2017 14:12:39 +0000 (+0000) Subject: Make iwm_newstate() recover from state transition errors. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6c1bddc001a9e9ebdeded168d1976a2f0eba6d61;p=openbsd 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@ --- 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 @@ -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); }