On Thu, 2020-11-26 at 11:39 +0100, Finn Behrens wrote: > reset the regdom when NL80211_CMD_RELOAD_REGDB is send Please add a bit more commit message, saying why this is needed. > err = request_firmware(&fw, "regulatory.db", ®_pdev->dev); > - if (err) > + if (err) { > + pr_info("failed to load regulatory.db\n"); > return err; > + } > > if (!valid_regdb(fw->data, fw->size)) { > + pr_info("loaded regulatory.db is malformed or signature is missing/invalid\n"); > err = -ENODATA; > goto out; > } These changes seem unrelated. > @@ -1101,6 +1105,28 @@ int reg_reload_regdb(void) > regdb = db; > rtnl_unlock(); > > + // reset regulatory For whatever reason, the kernel doesn't use C99 comments. > + const struct ieee80211_regdomain *current_regdomain = NULL; This should've given you a compiler warning that you shouldn't declare variables in the middle of the code. > + current_regdomain = get_cfg80211_regdom(); > + > + struct regulatory_request *request = NULL; > + > + request = kzalloc(sizeof(*request), GFP_KERNEL); > + if (!request) { > + err = -ENOMEM; > + goto out; > + } > + > + request->wiphy_idx = WIPHY_IDX_INVALID; > + request->alpha2[0] = current_regdomain->alpha2[0]; > + request->alpha2[1] = current_regdomain->alpha2[1]; > + request->initiator = NL80211_USER_REG_HINT_USER; > + request->user_reg_hint_type = NL80211_USER_REG_HINT_USER; > + request->reload = true; > + > + queue_regulatory_request(request); > Why does it even need to be queued - we're in a process context where we can sleep? johannes