Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3099308ybl; Fri, 20 Dec 2019 03:59:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyi8cYaoHhuYs7CH3CdcHzMz5V2bkNypPDxS/87fIsuCV8K3PxcllixrdHIGmgMljTB+8A8 X-Received: by 2002:a05:6830:594:: with SMTP id c20mr14869172oth.166.1576843147818; Fri, 20 Dec 2019 03:59:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576843147; cv=none; d=google.com; s=arc-20160816; b=gCPn3cqnr+J6xtAhwCdmPCPMHB/7kSD8xIGCeRBx9CJjXssP0PDv91iXptpK3XmNM9 rD2AIqVbjOcATy4Br1TkXXdghD+O4nPwaar7QP7SeEdRhk4/OERAdQLoOH6lmFfSQLRY 02IeQzfdMDrnN5VS7TPhlM1azy9MbzURKrRuc5fCSsdTWkYVVzjleVUf0AgbzF4GI5Hn hxeTFs6VTfi43kZkdUqaSN8/4qWQDkwD38KzhRxOZxCffUABgDCjQxE4v7zNIDmdNtMf urubgNNgI3ImCwBpnO/ZCfEQhbgH7BK2yfD+PR2avt0twf1yPIoNzdRMmkSConHMMgyU zNiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:cc:to:from; bh=yAiSvLUNWEh7IzNvp3IeSgU80t5cTkVHWKgyC3lVeKA=; b=yonFO41mlxj3g650V+RRyrZsJFr0wc/QuaWS9rE+ysuDP8SII1WLhEssCZLUWGzYOo LgJLNTH7bo4/ouV3omcHbPX9hYIHtIcsLlm4qPeup7D0i40s2+lOKb0Ggxb5/kqHOMaK cEywbrGnDWFTBzqWZOkI+YUi805XkjqShIvSfmrwo7syepm6plYtNSrM9vo115jsI+Ke /gctkBxvprdlXi02CSuPE8yxvx2KxdoLXwVF39f4zU4Nz9TG/sSfi3oj09rJW6XZ6Ha8 vOtw7n4kcHm1uo74p8hpDSsvtYFBOCBm8ErXePsOkPO2hbX2JEAbAQXmDqrmHKl6IFHD 0osQ== ARC-Authentication-Results: i=1; mx.google.com; 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 z194si4772112oia.50.2019.12.20.03.58.58; Fri, 20 Dec 2019 03:59:07 -0800 (PST) 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; 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 S1727184AbfLTL4q (ORCPT + 99 others); Fri, 20 Dec 2019 06:56:46 -0500 Received: from paleale.coelho.fi ([176.9.41.70]:53950 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727252AbfLTL4q (ORCPT ); Fri, 20 Dec 2019 06:56:46 -0500 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.92.2) (envelope-from ) id 1iiGtf-0007ip-Ee; Fri, 20 Dec 2019 13:56:44 +0200 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Fri, 20 Dec 2019 13:56:29 +0200 Message-Id: <20191220115638.1299888-2-luca@coelho.fi> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191220115638.1299888-1-luca@coelho.fi> References: <20191220115638.1299888-1-luca@coelho.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on farmhouse.coelho.fi X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, TVD_RCVD_IP,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Subject: [PATCH v5.5 01/10] iwlwifi: don't send PPAG command if disabled Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Gil Adam we should not send the PPAG (Per-Platform Antenna Gain) command to FW unless the platform has this ACPI table and it was read and validated during the init flow. also no need to send the command if the feature is disabled, so check if enabled before sending, as if there is no valid table the feature is disabled. Signed-off-by: Gil Adam Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index dd685f7eb410..c09624d8d7ee 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -841,9 +841,13 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm) return 0; } + if (!mvm->fwrt.ppag_table.enabled) { + IWL_DEBUG_RADIO(mvm, + "PPAG not enabled, command not sent.\n"); + return 0; + } + IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n"); - IWL_DEBUG_RADIO(mvm, "PPAG is %s\n", - mvm->fwrt.ppag_table.enabled ? "enabled" : "disabled"); for (i = 0; i < ACPI_PPAG_NUM_CHAINS; i++) { for (j = 0; j < ACPI_PPAG_NUM_SUB_BANDS; j++) { -- 2.24.0