From owner-svn-src-all@freebsd.org Wed May 4 12:51:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C282B2B304; Wed, 4 May 2016 12:51:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E845F1D9E; Wed, 4 May 2016 12:51:28 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u44CpSO0075435; Wed, 4 May 2016 12:51:28 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u44CpRD2075433; Wed, 4 May 2016 12:51:27 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201605041251.u44CpRD2075433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 4 May 2016 12:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r299063 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 May 2016 12:51:29 -0000 Author: avos Date: Wed May 4 12:51:27 2016 New Revision: 299063 URL: https://svnweb.freebsd.org/changeset/base/299063 Log: iwn: fix device reset after watchdog timeout. Simple device reset (stop/start) is not enough here; post-init state changes must be applied too. Modified: head/sys/dev/iwn/if_iwn.c head/sys/dev/iwn/if_iwnvar.h Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Wed May 4 11:53:30 2016 (r299062) +++ head/sys/dev/iwn/if_iwn.c Wed May 4 12:51:27 2016 (r299063) @@ -344,7 +344,6 @@ static void iwn_scan_end(struct ieee8021 static void iwn_set_channel(struct ieee80211com *); static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void iwn_scan_mindwell(struct ieee80211_scan_state *); -static void iwn_hw_reset(void *, int); #ifdef IWN_DEBUG static char *iwn_get_csr_string(int); static void iwn_debug_register(struct iwn_softc *); @@ -677,7 +676,6 @@ iwn_attach(device_t dev) callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0); callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0); - TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc); TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc); TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc); TASK_INIT(&sc->sc_panic_task, 0, iwn_panicked, sc); @@ -1400,7 +1398,6 @@ iwn_detach(device_t dev) iwn_xmit_queue_drain(sc); IWN_UNLOCK(sc); - ieee80211_draintask(&sc->sc_ic, &sc->sc_reinit_task); ieee80211_draintask(&sc->sc_ic, &sc->sc_radioon_task); ieee80211_draintask(&sc->sc_ic, &sc->sc_radiooff_task); iwn_stop(sc); @@ -4972,7 +4969,7 @@ iwn_watchdog(void *arg) if (sc->sc_tx_timer > 0) { if (--sc->sc_tx_timer == 0) { ic_printf(ic, "device timeout\n"); - ieee80211_runtask(ic, &sc->sc_reinit_task); + ieee80211_restart_all(ic); return; } } @@ -8907,19 +8904,6 @@ iwn_scan_mindwell(struct ieee80211_scan_ { /* NB: don't try to abort scan; wait for firmware to finish */ } - -static void -iwn_hw_reset(void *arg0, int pending) -{ - struct iwn_softc *sc = arg0; - struct ieee80211com *ic = &sc->sc_ic; - - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); - - iwn_stop(sc); - iwn_init(sc); - ieee80211_notify_radio(ic, 1); -} #ifdef IWN_DEBUG #define IWN_DESC(x) case x: return #x Modified: head/sys/dev/iwn/if_iwnvar.h ============================================================================== --- head/sys/dev/iwn/if_iwnvar.h Wed May 4 11:53:30 2016 (r299062) +++ head/sys/dev/iwn/if_iwnvar.h Wed May 4 12:51:27 2016 (r299063) @@ -304,7 +304,6 @@ struct iwn_softc { int sc_cap_off; /* PCIe Capabilities. */ /* Tasks used by the driver */ - struct task sc_reinit_task; struct task sc_radioon_task; struct task sc_radiooff_task; struct task sc_panic_task;