Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2528393imu; Thu, 29 Nov 2018 06:27:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wm2T5al1HbyXvr2iXBVrSjEc0jLEd2t2S8FIClD2YieSaW7dO0/lgnB/Eu44dGLdmXNOUR X-Received: by 2002:a17:902:6948:: with SMTP id k8mr1672063plt.2.1543501623612; Thu, 29 Nov 2018 06:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543501623; cv=none; d=google.com; s=arc-20160816; b=mGo7xFutfKSpVEPxh7YEQvH3y1XgMJTrAvStiaimpZFjCzaJiyUVxNdJd0pLmGHklS n5vhbqdt8f7V5ENxfg4LeF8xXZiNJSKSX19gtr3+MD0eXob16YuiFrgEChvbWhZ3DWa2 YWyrn3oJpR/9ATTB6IHwqzeBKxNYlpUWQqn4pDV5a6rhlwI7ECGjN8/dIjWY2miNbqz3 TXGFps5sNhs9cKdtcDBxKYU0yHyo7nr4JSorPOf1jLereSdE9liZRSB8fs3e57QqlQi/ IOnA2v6CbMeTrGIwBBbW78adnElh+QIypFj4zjmFUsLh+B2WCCKeVsBLWYUcYSAPd7i/ wv3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XlWd41d9YzIDBYN98Xl43XSpKzHyy7pGAIq0WJbfD2s=; b=OmPEe0WtaYPnAJrPOo/l618l5AGh9DaM7579qvN6Z/N0I3DnO3FgiU8kH81Mm/uiga uEhvHXWktCiv8X0z0rWydNy0pmXczhADHwpedWjOlgxGAqMOWXOQ4Fw2MOClkBFYBn9o DUBDxTizh5MNRonzSdCrgBIaCPI7IpQwf9EgO4bG1AOJ380SDU5/VnMdFEKtuvma5sdD BDDZN3dbpW+518R6iY0JS4HzOEjZrBiR90VZnxq46ohX0lf9/bStPjQceeCCOFVt/U1l bzpNwXejGd0b2zPvA12SNuWEz5iRnoBAgoj1C/yyM4WYidpw/bv0Q+8FWH+Xj7nWx59F tkww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vGnSkk7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si2360097pfw.66.2018.11.29.06.26.48; Thu, 29 Nov 2018 06:27:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vGnSkk7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733219AbeK3Bbp (ORCPT + 99 others); Thu, 29 Nov 2018 20:31:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:59448 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbeK3Bbo (ORCPT ); Thu, 29 Nov 2018 20:31:44 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13C23213A2; Thu, 29 Nov 2018 14:26:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501572; bh=K40okUInr6f/r0vMi+uA4SqKFLacxyK3tjxtreYW3XE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vGnSkk7fguT/ec822CTUDkNn/DBir26FeX+y2fFiWXvQ/BJ6DqAginA4S4Q0jL2Br JYTqY8C+CwARLuF9mXWA2nR3qLCINl2rhehAvzOsaThpJDdV7h3iWCJm8ZpYnWMzR2 +37vHs5g1FA8FUhZ2Ld49RhbVg3Ux+1n2zMZgbaY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Luca Coelho Subject: [PATCH 4.14 017/100] iwlwifi: mvm: fix regulatory domain update when the firmware starts Date: Thu, 29 Nov 2018 15:11:47 +0100 Message-Id: <20181129140100.369156971@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181129140058.768942700@linuxfoundation.org> References: <20181129140058.768942700@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Emmanuel Grumbach commit 82715ac71e6b94a2c2136e31f3a8e6748e33aa8c upstream. When the firmware starts, it doesn't have any regulatory information, hence it uses the world wide limitations. The driver can feed the firmware with previous knowledge that was kept in the driver, but the firmware may still not update its internal tables. This happens when we start a BSS interface, and then the firmware can change the regulatory tables based on our location and it'll use more lenient, location specific rules. Then, if the firmware is shut down (when the interface is brought down), and then an AP interface is created, the firmware will forget the country specific rules. The host will think that we are in a certain country that may allow channels and will try to teach the firmware about our location, but the firmware may still not allow to drop the world wide limitations and apply country specific rules because it was just re-started. In this case, the firmware will reply with MCC_RESP_ILLEGAL to the MCC_UPDATE_CMD. In that case, iwlwifi needs to let the upper layers (cfg80211 / hostapd) know that the channel list they know about has been updated. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=201105 Cc: stable@vger.kernel.org Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 8 ++++++-- drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 5 ++--- 2 files changed, 8 insertions(+), 5 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -328,8 +328,12 @@ struct ieee80211_regdomain *iwl_mvm_get_ goto out; } - if (changed) - *changed = (resp->status == MCC_RESP_NEW_CHAN_PROFILE); + if (changed) { + u32 status = le32_to_cpu(resp->status); + + *changed = (status == MCC_RESP_NEW_CHAN_PROFILE || + status == MCC_RESP_ILLEGAL); + } regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg, __le32_to_cpu(resp->n_channels), --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c @@ -732,9 +732,8 @@ iwl_mvm_update_mcc(struct iwl_mvm *mvm, } IWL_DEBUG_LAR(mvm, - "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') change: %d n_chans: %d\n", - status, mcc, mcc >> 8, mcc & 0xff, - !!(status == MCC_RESP_NEW_CHAN_PROFILE), n_channels); + "MCC response status: 0x%x. new MCC: 0x%x ('%c%c') n_chans: %d\n", + status, mcc, mcc >> 8, mcc & 0xff, n_channels); exit: iwl_free_resp(&cmd);