On Sat, Feb 24, 2018 at 08:54:47PM -0500, trondd wrote: > On Sat, February 24, 2018 4:05 pm, Stefan Sperling wrote: > > On Sat, Feb 24, 2018 at 03:21:14PM -0500, trondd wrote: > >> Went back to HEAD and reporduced the problem immediatly. Applied the > >> patch and > >> that seems to fix it. Running the patch without IWM_DEBUG for now to > >> verify > >> stability. > > > >> Feb 24 14:42:07 portabsd /bsd: iwm0: 0000001C | hcmd > > > > This "host command" code is the command used to transmit a frame: > > > > #define IWM_TX_CMD 0x1c > > > > So it seems the firmware is crashing during an attempt to send a frame > > while a background scan is in progress. > > It's unclear why this is happening. It could be a firmware bug, or it > > could be misuse of the firmware's API by the driver. > > > > Your observation that my diff fixes it means that setting the SSID of a > > an AP in the background scan command is somehow related to this crash. > > > > One possibility is that a firmware upgrade could fix this. > > But in any case, setting the SSID during a background scan is not > > necessary. > > So if my diff works, we can just commit it and stop worrying about the > > firwmare's problems. > > > > It's been running without any problems all day. Thanks Stefan. > > Tim. >
Hi again, Can you still reproduce this problem (firmware error on Tx during bgscan) with -current and this diff? Index: if_iwm.c =================================================================== RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v retrieving revision 1.230 diff -u -p -r1.230 if_iwm.c --- if_iwm.c 23 May 2018 17:49:20 -0000 1.230 +++ if_iwm.c 25 May 2018 17:32:41 -0000 @@ -4719,7 +4719,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 && !bgscan) + if (n_ssids != 0) chan->flags |= htole32(1 << 1); /* select SSID 0 */ chan++; nchan++; @@ -4746,7 +4746,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 && !bgscan) + if (n_ssids != 0) chan->flags = htole32(1 << 0); /* select SSID 0 */ chan++; nchan++; @@ -4898,9 +4898,6 @@ iwm_lmac_scan(struct iwm_softc *sc, int IWM_LMAC_SCAN_FLAG_EXTENDED_DWELL); if (ic->ic_des_esslen == 0) req->scan_flags |= htole32(IWM_LMAC_SCAN_FLAG_PASSIVE); - else - req->scan_flags |= - htole32(IWM_LMAC_SCAN_FLAG_PRE_CONNECTION); if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->scan_flags |= htole32(IWM_LMAC_SCAN_FLAGS_RRM_ENABLED); @@ -5098,8 +5095,6 @@ iwm_umac_scan(struct iwm_softc *sc, int tail->direct_scan[0].len = ic->ic_des_esslen; memcpy(tail->direct_scan[0].ssid, ic->ic_des_essid, ic->ic_des_esslen); - req->general_flags |= - htole32(IWM_UMAC_SCAN_GEN_FLAGS_PRE_CONNECT); } else req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE);