Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1076533ybh; Wed, 18 Mar 2020 14:36:20 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkvbCqbRUeHdt+FFiwf7ZUYuiaMoyNziL60VSnfd4ZieNxOf+jjweTJMhpmJwttqBZmobU X-Received: by 2002:a9d:17ec:: with SMTP id j99mr5517075otj.213.1584567380259; Wed, 18 Mar 2020 14:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584567380; cv=none; d=google.com; s=arc-20160816; b=eac5aNR2dCygaFzA6gcFKYraffb1igBX7gMHjGCujfivWLb9Y3jTs1UO+RytNhSq3K DAlQvTpGxmUUwa1FewN0IAhir1QYVFMNiU8iqCM48IgsqBTLA45grE2hICbDHX2vZGJX XaI0cVej4n3/EIOMED7IDZrEcQBcJc9Bv0p8f7WBTLswNvId8aSzUJsHylAxhakVaZ65 KIZSe3kqJF7blF6czU/45byK0AaHHo4KNGjucmgVSJn2P5lqOvuJ6QVghIRNJDW94AeO ss32QUzPyQqNtDv1v21HXath3NpBxHywDTAtM/ci1/LfwXxqZaypLyOGO7mw5CYyU5LE TP/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e25JK8fF5LtigMkLxNmEl1NMJCMEEzOfon65uy5ebKo=; b=L73PbIkWmY1P5vp5yz86Rz23ypUVmNXr65U996vT4JZwxcSb4MitHQ3sHxd84L9GSU JTwtz6ApKWefIBkxq5UDdOPDEeezqu3BrXXRdzXItPAUlT2S+g3ksrnuAtdHADNwmRW+ FJpC1qwydfVAfHUARYR7PBDykSOS8c5e/y0F/krjqEsoB5+dYbkQvZTCQuGbkEp12Trx 1Q7mKOFWG8zH+4ajghmHDQT2ShdfohkLyF5F5dfFGtHEhlbCFc0/o89BwuLbmlT1q6TZ HmQFJQqMx1kVKDmdeNfdwnKNK6RWjpD70VzraUzvkt7+JOKPvbE2goLmVrwtt7EoMmPk 9bTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@earth.li header.s=the header.b=EJ8sWMyA; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-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 q126si4014663oia.8.2020.03.18.14.36.07; Wed, 18 Mar 2020 14:36:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@earth.li header.s=the header.b=EJ8sWMyA; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726777AbgCRVer (ORCPT + 99 others); Wed, 18 Mar 2020 17:34:47 -0400 Received: from the.earth.li ([93.93.131.124]:53762 "EHLO the.earth.li" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbgCRVer (ORCPT ); Wed, 18 Mar 2020 17:34:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=earth.li; s=the; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject :Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=e25JK8fF5LtigMkLxNmEl1NMJCMEEzOfon65uy5ebKo=; b=EJ8sWMyAqK3JiWpt32gK+tQe6l K7pWKz/vLwaJ+atlzwzkjW3acoVp9N/BMk1q4kkY9xcPwIfX5hqaULKjmAqZTjf8wqi3i3RIJIwlw 1doUMpMWJUZSDp4Uq7SkHRQ7Zavm1DazOgLe+wllKtNtbCj6RJAfCQgcYZnUcQYgyJJ6DXQ7Vj93Y 4uchqcaTFc9cuxLLU5ZfUqOXFj1/IQ8njiybn43HnrB1ZwpK/sKd1gTHjfpdc8U2uZDZcDUdSoR3U CKMwmaPEkuy2DquR6LUVEGaZUQOopeJqKxX2AsoCjp+9aZ7A3Zet5csfJ6bJM23YDnGc3yYpjE6/8 7no2dEIw==; Received: from noodles by the.earth.li with local (Exim 4.92) (envelope-from ) id 1jEgKm-0006TI-Ab; Wed, 18 Mar 2020 21:34:40 +0000 Date: Wed, 18 Mar 2020 21:34:40 +0000 From: Jonathan McDowell To: Luca Coelho Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org, lenb@kernel.org Subject: Re: [PATCH v5.6] iwlwifi: don't send GEO_TX_POWER_LIMIT if no wgds table Message-ID: <20200318213440.GO311@earth.li> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Mar 18, 2020 at 08:12:54AM +0200, Luca Coelho wrote: > From: Golan Ben Ami > > The GEO_TX_POWER_LIMIT command was sent although > there is no wgds table, so the fw got wrong SAR values > from the driver. > > Fix this by avoiding sending the command if no wgds > tables are available. > > Signed-off-by: Golan Ben Ami > Fixes: 39c1a9728f93 ("iwlwifi: refactor the SAR tables from mvm to acpi") > Signed-off-by: Luca Coelho Thanks Luca. Works for me on an AC 3168 with firmware 29.1044073957.0 Tested-By: Jonathan McDowell Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206395 Cc: stable@vger.kernel.org # 5.5.10+ > --- > drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 14 ++++++++------ > drivers/net/wireless/intel/iwlwifi/fw/acpi.h | 14 ++++++++------ > drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 ++++++++- > 3 files changed, 24 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c > index 48d375a86d86..ba2aff3af0fe 100644 > --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c > +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c > @@ -6,7 +6,7 @@ > * GPL LICENSE SUMMARY > * > * Copyright(c) 2017 Intel Deutschland GmbH > - * Copyright (C) 2019 Intel Corporation > + * Copyright (C) 2019 - 2020 Intel Corporation > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of version 2 of the GNU General Public License as > @@ -27,7 +27,7 @@ > * BSD LICENSE > * > * Copyright(c) 2017 Intel Deutschland GmbH > - * Copyright (C) 2019 Intel Corporation > + * Copyright (C) 2019 - 2020 Intel Corporation > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -491,13 +491,13 @@ int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt, > } > IWL_EXPORT_SYMBOL(iwl_validate_sar_geo_profile); > > -void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > - struct iwl_per_chain_offset_group *table) > +int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > + struct iwl_per_chain_offset_group *table) > { > int ret, i, j; > > if (!iwl_sar_geo_support(fwrt)) > - return; > + return -EOPNOTSUPP; > > ret = iwl_sar_get_wgds_table(fwrt); > if (ret < 0) { > @@ -505,7 +505,7 @@ void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > "Geo SAR BIOS table invalid or unavailable. (%d)\n", > ret); > /* we don't fail if the table is not available */ > - return; > + return -ENOENT; > } > > BUILD_BUG_ON(ACPI_NUM_GEO_PROFILES * ACPI_WGDS_NUM_BANDS * > @@ -530,5 +530,7 @@ void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > i, j, value[1], value[2], value[0]); > } > } > + > + return 0; > } > IWL_EXPORT_SYMBOL(iwl_sar_geo_init); > diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h > index 4a6e8262974b..5590e5cc8fbb 100644 > --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h > +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h > @@ -6,7 +6,7 @@ > * GPL LICENSE SUMMARY > * > * Copyright(c) 2017 Intel Deutschland GmbH > - * Copyright(c) 2018 - 2019 Intel Corporation > + * Copyright(c) 2018 - 2020 Intel Corporation > * > * This program is free software; you can redistribute it and/or modify > * it under the terms of version 2 of the GNU General Public License as > @@ -27,7 +27,7 @@ > * BSD LICENSE > * > * Copyright(c) 2017 Intel Deutschland GmbH > - * Copyright(c) 2018 - 2019 Intel Corporation > + * Copyright(c) 2018 - 2020 Intel Corporation > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -171,8 +171,9 @@ bool iwl_sar_geo_support(struct iwl_fw_runtime *fwrt); > int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt, > struct iwl_host_cmd *cmd); > > -void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > - struct iwl_per_chain_offset_group *table); > +int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > + struct iwl_per_chain_offset_group *table); > + > #else /* CONFIG_ACPI */ > > static inline void *iwl_acpi_get_object(struct device *dev, acpi_string method) > @@ -243,9 +244,10 @@ static inline int iwl_validate_sar_geo_profile(struct iwl_fw_runtime *fwrt, > return -ENOENT; > } > > -static inline void iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > - struct iwl_per_chain_offset_group *table) > +static inline int iwl_sar_geo_init(struct iwl_fw_runtime *fwrt, > + struct iwl_per_chain_offset_group *table) > { > + return -ENOENT; > } > > #endif /* CONFIG_ACPI */ > diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c > index 54c094e88474..98263cd37944 100644 > --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c > +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c > @@ -762,10 +762,17 @@ static int iwl_mvm_sar_geo_init(struct iwl_mvm *mvm) > u16 cmd_wide_id = WIDE_ID(PHY_OPS_GROUP, GEO_TX_POWER_LIMIT); > union geo_tx_power_profiles_cmd cmd; > u16 len; > + int ret; > > cmd.geo_cmd.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES); > > - iwl_sar_geo_init(&mvm->fwrt, cmd.geo_cmd.table); > + ret = iwl_sar_geo_init(&mvm->fwrt, cmd.geo_cmd.table); > + /* > + * It is a valid scenario to not support SAR, or miss wgds table, > + * but in that case there is no need to send the command. > + */ > + if (ret) > + return 0; > > cmd.geo_cmd.table_revision = cpu_to_le32(mvm->fwrt.geo_rev); > > -- > 2.25.1 > J. -- I don't know. I'm a dog. | .''`. Debian GNU/Linux Developer | : :' : Happy to accept PGP signed | `. `' or encrypted mail - RSA | `- key on the keyservers.