From patchwork Thu Dec 12 17:14:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 11288763 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E3A1138D for ; Thu, 12 Dec 2019 17:14:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6325821655 for ; Thu, 12 Dec 2019 17:14:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=candelatech.com header.i=@candelatech.com header.b="NXY1HEWa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730106AbfLLROR (ORCPT ); Thu, 12 Dec 2019 12:14:17 -0500 Received: from mail2.candelatech.com ([208.74.158.173]:50186 "EHLO mail3.candelatech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730054AbfLLROR (ORCPT ); Thu, 12 Dec 2019 12:14:17 -0500 Received: from ben-dt4.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id BA15A13C283; Thu, 12 Dec 2019 09:14:16 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com BA15A13C283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1576170856; bh=8pY1HIK3azgho2bzhpGrhM5tbAYHFJtFAzH+baIVhIs=; h=From:To:Cc:Subject:Date:From; b=NXY1HEWaU8dPlykutxnS1CVj7uoylNJGVLJLhkhY16+6T9DmRu22CR6zpmQnbItEd n2GnwiGtc29MJdki4911XyeZUjEOeeP+8UMWvV1/6ChykzqcuyR7C6GKjgYDe1hORi JfgNMy6+FowfloyGkqNeF+F5B9r7rsFtmRMiFx+U= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org, kvalo@qca.qualcomm.com, ath10k@lists.infradead.org Cc: Ben Greear Subject: [PATCH] ath10k: Fix setting txpower to zero. Date: Thu, 12 Dec 2019 09:14:09 -0800 Message-Id: <20191212171409.21041-1-greearb@candelatech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Do not ignore 0 txpower setting unless the vif is of type p2p. This should fix regression in: commit 88407beb1b1462f706a1950a355fd086e1c450b6 Author: Ryan Hsu Date: Tue Dec 13 14:55:19 2016 -0800 ath10k: fix incorrect txpower set by P2P_DEVICE interface Tested (without p2p in use) on 9984 with ath10k-ct firmware, but I don't think this is firmware specific. Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath10k/mac.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 289d03da14b2..1c5e1b5570f8 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -5902,11 +5902,18 @@ static int ath10k_mac_txpower_recalc(struct ath10k *ar) { struct ath10k_vif *arvif; int ret, txpower = -1; + int p2p_st; + + p2p_st = ath10k_wmi_get_vdev_subtype(ar, WMI_VDEV_SUBTYPE_P2P_DEVICE); lockdep_assert_held(&ar->conf_mutex); list_for_each_entry(arvif, &ar->arvifs, list) { - if (arvif->txpower <= 0) + /* p2p may not initialize txpower, and we should ignore it + * in that case. + */ + if ((arvif->txpower < 0) || + ((arvif->txpower == 0) && (arvif->vdev_subtype == p2p_st))) continue; if (txpower == -1)