Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2553391imu; Thu, 29 Nov 2018 06:48:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/V84bIpzO3LvkEfnWgeBGIlo1+GEqEDeaCncAC3ZDxErxzE67h1Sm2YlZyzXA4Bm5s4mR15 X-Received: by 2002:a17:902:365:: with SMTP id 92mr1633899pld.327.1543502919680; Thu, 29 Nov 2018 06:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543502919; cv=none; d=google.com; s=arc-20160816; b=AE37yBNNt5VNbvyLPR1E5WtqJdqy3kpQ9yXqEk9QkaCQt2z1OVPqtNmNIwbznS6Sw7 Uk01Yy46CRkOsEWK/NJCzEa9jg1fZn1pCGVMWBzmwBKgUl+8cWEmJHRM+Syhmr3XV9Wb XqgNOVbfW06C/dLt7gpxMcde1brlLYxBAzRd/7RNQhiR4zvx0GR87oCBHDkFsyVBPbzT f5BPQ3E14Cpkm49ZFhTp0UGz3oU8k+z/k+B0uLcWePUojx2gAnE3qogrzZMSVFpdwbhD SiNIdnzOlJ6/AilomfZ8gcMkhS+H6A3FAdWswlelag+zE7JWoRu51NBFNWBnPsLvCip6 PlMw== 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=8pIRq+0zVOd7lermg2l6alf72SiChsAP/JBoEomIRX0=; b=xW2aix5g4e+aoZ489RMTNFP8Zslx/76olVsIQxtHuqOOsfiNWDywHOUUcOF2izVE05 9ZR06LmYEChCF/oF1RAYJ9alCCwZTDT9TIQJ4r/HMayQGbZXHNG4SJ3+nMUB93AgyjEv iYEgMi26VcWYWDsrmqbfCuw7yV0V/v6ohpJTeLMQHQjvtcqdZIYlQFq0T6mnn8dpt+Nl +ZOC4aR3JSB3UjP+Ie8b6Pxn1lbPXk/3m2KJRNk3LFGiwEtT7M8TwakTqF5zqZ3ZTPMA ca/qogJJNDa7T75KeU6+mXcTj5FnME/t8nlrfinYVtrVZ2LCJaRKh2WrMll7QXfsKFOU XCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cblflubp; 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 cd16si2619822plb.47.2018.11.29.06.48.25; Thu, 29 Nov 2018 06:48:39 -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=Cblflubp; 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 S1733232AbeK3Bbs (ORCPT + 99 others); Thu, 29 Nov 2018 20:31:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:59510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729984AbeK3Bbr (ORCPT ); Thu, 29 Nov 2018 20:31:47 -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 6C8102133F; Thu, 29 Nov 2018 14:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543501574; bh=iF579ZLJKPdR4kcUUN7lPFPBPsRSC9vTo65Ybmu8CCo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CblflubpNmEPBZmOBHbZuFSLvdfgV+4cGp8TK+mUpr0YcAjFa+++U1gW58zE5FvgH coSVwGWpj6yUavm4/uprLKB+AaRlThoHeMnyzeKIY1+emIUFjkeklyiutzfCh3bNK/ mVToc4+MuviwhTsPrG4sdbwo3hGyYgR1/oAgbep0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luca Coelho Subject: [PATCH 4.14 018/100] iwlwifi: mvm: dont use SAR Geo if basic SAR is not used Date: Thu, 29 Nov 2018 15:11:48 +0100 Message-Id: <20181129140100.423622312@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: Luca Coelho commit 5d041c46ccb9b48acc110e214beff5e2789311df upstream. We can't use SAR Geo if basic SAR is not enabled, since the SAR Geo tables define offsets in relation to the basic SAR table in use. To fix this, make iwl_mvm_sar_init() return one in case WRDS is not available, so we can skip reading WGDS entirely. Fixes: a6bff3cb19b7 ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Luca Coelho Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 36 +++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -997,6 +997,11 @@ static int iwl_mvm_sar_get_ewrd_table(st return -ENOENT; } +static int iwl_mvm_sar_get_wgds_table(struct iwl_mvm *mvm) +{ + return -ENOENT; +} + static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm) { return 0; @@ -1023,8 +1028,11 @@ static int iwl_mvm_sar_init(struct iwl_m IWL_DEBUG_RADIO(mvm, "WRDS SAR BIOS table invalid or unavailable. (%d)\n", ret); - /* if not available, don't fail and don't bother with EWRD */ - return 0; + /* + * If not available, don't fail and don't bother with EWRD. + * Return 1 to tell that we can't use WGDS either. + */ + return 1; } ret = iwl_mvm_sar_get_ewrd_table(mvm); @@ -1037,9 +1045,13 @@ static int iwl_mvm_sar_init(struct iwl_m /* choose profile 1 (WRDS) as default for both chains */ ret = iwl_mvm_sar_select_profile(mvm, 1, 1); - /* if we don't have profile 0 from BIOS, just skip it */ + /* + * If we don't have profile 0 from BIOS, just skip it. This + * means that SAR Geo will not be enabled either, even if we + * have other valid profiles. + */ if (ret == -ENOENT) - return 0; + return 1; return ret; } @@ -1229,11 +1241,19 @@ int iwl_mvm_up(struct iwl_mvm *mvm) iwl_mvm_unref(mvm, IWL_MVM_REF_UCODE_DOWN); ret = iwl_mvm_sar_init(mvm); - if (ret) - goto error; + if (ret == 0) { + ret = iwl_mvm_sar_geo_init(mvm); + } else if (ret > 0 && !iwl_mvm_sar_get_wgds_table(mvm)) { + /* + * If basic SAR is not available, we check for WGDS, + * which should *not* be available either. If it is + * available, issue an error, because we can't use SAR + * Geo without basic SAR. + */ + IWL_ERR(mvm, "BIOS contains WGDS but no WRDS\n"); + } - ret = iwl_mvm_sar_geo_init(mvm); - if (ret) + if (ret < 0) goto error; iwl_mvm_leds_sync(mvm);