From 5ae9823c62a94d858cce9b175d4e1c505f7a9164 Mon Sep 17 00:00:00 2001 From: stsp Date: Fri, 16 Jun 2017 08:45:34 +0000 Subject: [PATCH] In iwm_init() save the generation counter once before looping over tsleep(9), instead of saving it during every iteration. --- sys/dev/pci/if_iwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index cc4fcf44980..d25dbc9695b 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.196 2017/06/14 16:58:28 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.197 2017/06/16 08:45:34 stsp Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh @@ -6126,8 +6126,8 @@ iwm_init(struct ifnet *ifp) * ieee80211_begin_scan() ends up scheduling iwm_newstate_task(). * Wait until the transition to SCAN state has completed. */ + generation = sc->sc_generation; do { - generation = sc->sc_generation; err = tsleep(&ic->ic_state, PCATCH, "iwminit", hz); if (generation != sc->sc_generation) return ENXIO; -- 2.20.1