From owner-freebsd-wireless@freebsd.org Sun Apr 24 17:14:40 2016 Return-Path: Delivered-To: freebsd-wireless@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 A54D0B1B0A1 for ; Sun, 24 Apr 2016 17:14:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 708CC175D for ; Sun, 24 Apr 2016 17:14:40 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id m9so48538842ige.1 for ; Sun, 24 Apr 2016 10:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=MVp/LZRMcSonhWdRfXZ2xAumA+B6EMrwkyYvc/uIwws=; b=hU5oaQjU9wzD/cQfyfb7uoVCPUrKOtn7PWKLemIuXGH99miOAHXkZPg3fhiMUFB383 woFugzEsH5jJkExdPLLQfLGV9Fm8OPy9GE5reFqMt3jp4s7FlTiOhFb7rlGSoZCIrGOV D4YAdL8q7hztlGQ7HTRBkaXYqmaqWfQi0dTm8+CaSupyGjLSGJ/ChUVybKpUUfrmKs6r QHVBY37oar9C78sFqTQtilRNcw6aUwkrfaMkZA3ngD937bv1K/8IXc1/Q6zdqite/82N Yv9riLa82YMq45+9BfRTD6Ii+ox+ATyM8SG8ZxpejaeH7G+p5bBunh+4jZUboDCufYlN z6Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=MVp/LZRMcSonhWdRfXZ2xAumA+B6EMrwkyYvc/uIwws=; b=RECqiB3eu0ySiSJMMF5EPuLoK24PIhIduRdBIhQYZqXpTTCuVGUkSVwdjCcLMo0iTd kJEPA7wlpUFGQVTmJErKKPgzVsHfQSXCsMBLryH3cSLz81t5INrtNacu6QmDYQXDcZwj c++kgN0XKmTriuhFBT0f/zujK7YNuFyXX1pBCUwCzJlruVjdpXhuQ0XFfmVF96b0vV51 vFKQuCNpwdULXlV4fxkm0VivS0quwwNw1KSLH8PKtkKyV9aCt3mcFHeKKyJHfnoUzvrp s2ppsqjhRxtON1H5S9Jdz+HbWfaE1OSemCnZ2i/gQ6juQwks/Uo6bZq988PytP/GM+Nf Dvvg== X-Gm-Message-State: AOPr4FVhvXHufpbK/p048hLzA1VKCDqejyGl/jLUIJ7NXP0na3FR6SCxlRkh6KPFXCl4cPiEyQK1eiIoJSBJFA== MIME-Version: 1.0 X-Received: by 10.50.180.202 with SMTP id dq10mr8128584igc.37.1461518079781; Sun, 24 Apr 2016 10:14:39 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Sun, 24 Apr 2016 10:14:39 -0700 (PDT) In-Reply-To: <20160422.161046.1399384989198011599.ish@amail.plala.or.jp> References: <6E0E9EC8-3035-4443-A495-5981E8C9D4FA@FreeBSD.org> <20160305.193602.2144207354689575871.ish@amail.plala.or.jp> <20160422.161046.1399384989198011599.ish@amail.plala.or.jp> Date: Sun, 24 Apr 2016 10:14:39 -0700 Message-ID: Subject: Re: iwm7265fw: fatal firmware error From: Adrian Chadd To: Masachika ISHIZUKA Cc: "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 17:14:40 -0000 hi! Cool, it looks like you've fixed one of the issues with the bad firmware use. I'll go test this out on an iwm laptop and commit it if it's all good! Would you mind helping me fix some of the other places where the driver calls the firmware wrong? -adrian On 22 April 2016 at 00:10, Masachika ISHIZUKA wrote: >>> May be workaroundable with https://reviews.freebsd.org/D4236 (restarts >>> the device >>> automatically after each failure; but the problem is still here) >> >> Hello, Andriy. >> >> Thank you for good information. >> After applying this patch, my dell notebook with 7260 can restart >> iwm driver automatically and resume connections. > > Hi. > > As my dell xps12 (7260ac) was disconnected after key renewal > interval time, I patched iwm driver. After that, it keeps > connctions. > > # cd /sys/dev/iwm > # patch < iwm.diff > # cd /sys/module/iwm > # make > # make install > # reboot > -- > Masachika ISHIZUKA > > --- /sys/dev/iwm/if_iwm.c.org 2016-02-01 15:01:34.003243000 +0900 > +++ /sys/dev/iwm/if_iwm.c 2016-04-21 14:24:02.691305000 +0900 > @@ -3159,7 +3159,6 @@ > struct iwm_node *in; > struct iwm_vap *iv = IWM_VAP(vap); > uint32_t duration; > - uint32_t min_duration; > int error; > > /* > @@ -3201,7 +3200,25 @@ > if (iv->is_uploaded) { > if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { > device_printf(sc->sc_dev, > - "%s: failed to add MAC\n", __func__); > + "%s: failed to update MAC\n", __func__); > + goto out; > + } > + if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], > + in->in_ni.ni_chan, 1, 1)) != 0) { > + device_printf(sc->sc_dev, > + "%s: failed update phy ctxt\n", __func__); > + goto out; > + } > + in->in_phyctxt = &sc->sc_phyctxt[0]; > + > + if ((error = iwm_mvm_binding_update(sc, in)) != 0) { > + device_printf(sc->sc_dev, > + "%s: binding update cmd\n", __func__); > + goto out; > + } > + if ((error = iwm_mvm_update_sta(sc, in)) != 0) { > + device_printf(sc->sc_dev, > + "%s: failed to update sta\n", __func__); > goto out; > } > } else { > @@ -3210,61 +3227,35 @@ > "%s: failed to add MAC\n", __func__); > goto out; > } > - } > - > - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], > - in->in_ni.ni_chan, 1, 1)) != 0) { > - device_printf(sc->sc_dev, > - "%s: failed add phy ctxt\n", __func__); > - goto out; > - } > - in->in_phyctxt = &sc->sc_phyctxt[0]; > - > - if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { > - device_printf(sc->sc_dev, > - "%s: binding cmd\n", __func__); > - goto out; > - } > - > - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { > - device_printf(sc->sc_dev, > - "%s: failed to add MAC\n", __func__); > - goto out; > - } > - > - /* a bit superfluous? */ > - while (sc->sc_auth_prot) > - msleep(&sc->sc_auth_prot, &sc->sc_mtx, 0, "iwmauth", 0); > - sc->sc_auth_prot = 1; > - > - duration = min(IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS, > - 200 + in->in_ni.ni_intval); > - min_duration = min(IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS, > - 100 + in->in_ni.ni_intval); > - iwm_mvm_protect_session(sc, in, duration, min_duration, 500); > - > - IWM_DPRINTF(sc, IWM_DEBUG_RESET, > - "%s: waiting for auth_prot\n", __func__); > - while (sc->sc_auth_prot != 2) { > - /* > - * well, meh, but if the kernel is sleeping for half a > - * second, we have bigger problems > - */ > - if (sc->sc_auth_prot == 0) { > + if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], > + in->in_ni.ni_chan, 1, 1)) != 0) { > device_printf(sc->sc_dev, > - "%s: missed auth window!\n", __func__); > - error = ETIMEDOUT; > + "%s: failed add phy ctxt\n", __func__); > goto out; > - } else if (sc->sc_auth_prot == -1) { > + } > + in->in_phyctxt = &sc->sc_phyctxt[0]; > + > + if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { > + device_printf(sc->sc_dev, > + "%s: binding add cmd\n", __func__); > + goto out; > + } > + if ((error = iwm_mvm_add_sta(sc, in)) != 0) { > device_printf(sc->sc_dev, > - "%s: no time event, denied!\n", __func__); > - sc->sc_auth_prot = 0; > - error = EAUTH; > + "%s: failed to add sta\n", __func__); > goto out; > } > - msleep(&sc->sc_auth_prot, &sc->sc_mtx, 0, "iwmau2", 0); > } > - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "<-%s\n", __func__); > + > + /* > + * Prevent the FW from wandering off channel during association > + * by "protecting" the session with a time event. > + */ > + /* XXX duration is in units of TU, not MS */ > + duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; > + iwm_mvm_protect_session(sc, in, duration, 500 /* XXX magic number */); > + DELAY(100); > + > error = 0; > out: > ieee80211_free_node(ni); > --- /sys/dev/iwm/if_iwm_binding.c.org 2015-10-23 16:11:37.635797000 +0900 > +++ /sys/dev/iwm/if_iwm_binding.c 2016-04-20 15:17:32.934703000 +0900 > @@ -201,13 +201,13 @@ > } > > int > -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in, int add) > +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in) > { > - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); > + return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_MODIFY); > } > > int > iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in) > { > - return iwm_mvm_binding_update(sc, in, IWM_FW_CTXT_ACTION_ADD); > + return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); > } > --- if_iwm_binding.h.org 2015-10-23 16:11:31.950989000 +0900 > +++ if_iwm_binding.h 2016-04-21 14:29:44.352627000 +0900 > @@ -107,8 +107,7 @@ > > extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, > uint32_t action); > -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in, > - int add); > +extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in); > extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in); > > #endif /* __IF_IWM_BINDING_H__ */ > --- if_iwm_time_event.c.org 2015-10-23 16:11:37.636104000 +0900 > +++ if_iwm_time_event.c 2016-04-21 14:26:11.776447000 +0900 > @@ -244,7 +244,7 @@ > > void > iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, > - uint32_t duration, uint32_t min_duration, uint32_t max_delay) > + uint32_t duration, uint32_t max_delay) > { > struct iwm_time_event_cmd_v2 time_cmd; > > --- /sys/dev/iwm/if_iwm_time_event.h.org 2015-10-23 16:11:35.320341000 +0900 > +++ /sys/dev/iwm/if_iwm_time_event.h 2016-04-21 14:26:54.507584000 +0900 > @@ -108,6 +108,6 @@ > #define __IF_IWM_TIME_EVENT_H__ > > extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, > - uint32_t duration, uint32_t min_duration, uint32_t max_delay); > + uint32_t duration, uint32_t max_delay); > > #endif /* __IF_IWM_TIME_EVENT_H__ */ > > _______________________________________________ > freebsd-wireless@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org"