On Sat, Feb 24, 2018 at 10:42:40AM -0500, trondd wrote:
> Stefan Sperling <[email protected]> wrote:
>
> > On Fri, Feb 23, 2018 at 12:16:54AM -0500, trondd wrote:
> > > >Synopsis: Since if_iwm.c r1.224 iwm constantly reports fatal
> > > >firmware error
> > > >Category: kernel
> > > >Environment:
> > > System : OpenBSD 6.2
> > > Details : OpenBSD 6.2-current (GENERIC.MP) #1: Tue Jan 23 20:28:22
> > > EST 2018
> > >
> > > [email protected]:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> > >
> > > Architecture: OpenBSD.amd64
> > > Machine : amd64
> > > >Description:
> > > Since trying to update on Feb 16, trying snapshots and building
> > > current, I've been getting fatal firmware errors as soon as the iwm device
> > > is brought up. Last good kernel I have is from Jan 23 as shown in the
> > > dmesg.
> > >
> > > Rolling back the only commit to if_iwm.c since Jan 23 to r1.223 seems to
> > > fix
> > > the problem.
> >
> > This doesn't make much sense because r1.224 only moved debug prints around.
> > Commit r1.223 is a more likely candidate.
>
> Yup. It started to fail again a shortly after but wasn't back on this laptop
> until the next evening. I rolled back to 1.222 and that fixed it again. It's
> been about 14 hours without the problem returning.
Can you please move it back to HEAD and check if you can still reproduce the
problem reliably? And if so, can you compile a kernel with 'option IWM_DEBUG'
and show us the resulting more verbose firmware error message?
This diff might be worth a try, but it is just a blind guess and
I have no idea if it will change anything.
Index: if_iwm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.224
diff -u -p -r1.224 if_iwm.c
--- if_iwm.c 31 Jan 2018 12:36:13 -0000 1.224
+++ if_iwm.c 24 Feb 2018 16:39:28 -0000
@@ -418,7 +418,7 @@ int iwm_rm_sta_cmd(struct iwm_softc *, s
uint16_t iwm_scan_rx_chain(struct iwm_softc *);
uint32_t iwm_scan_rate_n_flags(struct iwm_softc *, int, int);
uint8_t iwm_lmac_scan_fill_channels(struct iwm_softc *,
- struct iwm_scan_channel_cfg_lmac *, int);
+ struct iwm_scan_channel_cfg_lmac *, int, int);
int iwm_fill_probe_req(struct iwm_softc *, struct iwm_scan_probe_req *);
int iwm_lmac_scan(struct iwm_softc *, int);
int iwm_config_umac_scan(struct iwm_softc *);
@@ -4724,7 +4724,7 @@ iwm_scan_rate_n_flags(struct iwm_softc *
uint8_t
iwm_lmac_scan_fill_channels(struct iwm_softc *sc,
- struct iwm_scan_channel_cfg_lmac *chan, int n_ssids)
+ struct iwm_scan_channel_cfg_lmac *chan, int n_ssids, int bgscan)
{
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_channel *c;
@@ -4741,7 +4741,7 @@ iwm_lmac_scan_fill_channels(struct iwm_s
chan->iter_count = htole16(1);
chan->iter_interval = 0;
chan->flags = htole32(IWM_UNIFIED_SCAN_CHANNEL_PARTIAL);
- if (n_ssids != 0)
+ if (n_ssids != 0 && !bgscan)
chan->flags |= htole32(1 << 1); /* select SSID 0 */
chan++;
nchan++;
@@ -4752,7 +4752,7 @@ iwm_lmac_scan_fill_channels(struct iwm_s
uint8_t
iwm_umac_scan_fill_channels(struct iwm_softc *sc,
- struct iwm_scan_channel_cfg_umac *chan, int n_ssids)
+ struct iwm_scan_channel_cfg_umac *chan, int n_ssids, int bgscan)
{
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_channel *c;
@@ -4768,7 +4768,7 @@ iwm_umac_scan_fill_channels(struct iwm_s
chan->channel_num = ieee80211_mhz2ieee(c->ic_freq, 0);
chan->iter_count = 1;
chan->iter_interval = htole16(0);
- if (n_ssids != 0)
+ if (n_ssids != 0 && !bgscan)
chan->flags = htole32(1 << 0); /* select SSID 0 */
chan++;
nchan++;
@@ -4957,7 +4957,7 @@ iwm_lmac_scan(struct iwm_softc *sc, int
req->n_channels = iwm_lmac_scan_fill_channels(sc,
(struct iwm_scan_channel_cfg_lmac *)req->data,
- ic->ic_des_esslen != 0);
+ ic->ic_des_esslen != 0, bgscan);
err = iwm_fill_probe_req(sc,
(struct iwm_scan_probe_req *)(req->data +
@@ -5104,7 +5104,7 @@ iwm_umac_scan(struct iwm_softc *sc, int
req->n_channels = iwm_umac_scan_fill_channels(sc,
(struct iwm_scan_channel_cfg_umac *)req->data,
- ic->ic_des_esslen != 0);
+ ic->ic_des_esslen != 0, bgscan);
req->general_flags = htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASS_ALL |
IWM_UMAC_SCAN_GEN_FLAGS_ITER_COMPLETE |