diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-02-16 10:15:13 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-02-16 10:15:13 +0000 |
commit | 84ee0062632bfb7d2b02950f892bdc20ff689745 (patch) | |
tree | c7352b7082bb392a7c00b46a216db7bf7eac9521 /sys/dev/pci/if_iwn.c | |
parent | a6ff5f627763ade02a6f6f153833f35a7795373e (diff) |
Revert "Release the NET_LOCK() before entering per-driver ioctl() routine".
This is most likely to be the cause of the deadlock seen by port builders
since it's the only changed that happened after a2k17.
Instead bring back pirofti@ original hack to release the NET_LOCK() inside
iwm(4) and iwn(4).
This fixes some splassert reported by bluhm@
Deadlock reported by naddy@ and rpe@ and ajacoutot@ confirmed the deadlock
has been introduced post a2k17.
Tested by and ok tb@
Diffstat (limited to 'sys/dev/pci/if_iwn.c')
-rw-r--r-- | sys/dev/pci/if_iwn.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index 70d08e55408..6f5fd512f3d 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwn.c,v 1.182 2017/01/22 10:17:38 dlg Exp $ */ +/* $OpenBSD: if_iwn.c,v 1.183 2017/02/16 10:15:12 mpi Exp $ */ /*- * Copyright (c) 2007-2010 Damien Bergamini <damien.bergamini@free.fr> @@ -3259,9 +3259,14 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) struct ifreq *ifr; int s, error = 0; + /* XXXSMP breaks atomicity */ + rw_exit_write(&netlock); + error = rw_enter(&sc->sc_rwlock, RW_WRITE | RW_INTR); - if (error) + if (error) { + rw_enter_write(&netlock); return error; + } s = splnet(); switch (cmd) { @@ -3320,6 +3325,7 @@ iwn_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) splx(s); rw_exit_write(&sc->sc_rwlock); + rw_enter_write(&netlock); return error; } |