From patchwork Sun Apr 17 14:51:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thibaut_VAR=C3=88NE?= X-Patchwork-Id: 563083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A4BBC433EF for ; Sun, 17 Apr 2022 14:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234251AbiDQOyy (ORCPT ); Sun, 17 Apr 2022 10:54:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229496AbiDQOyx (ORCPT ); Sun, 17 Apr 2022 10:54:53 -0400 Received: from vps.slashdirt.org (vps.slashdirt.org [144.91.108.218]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 726789FD5 for ; Sun, 17 Apr 2022 07:52:17 -0700 (PDT) Received: from supercopter.milliways.lan (82-64-212-153.subs.proxad.net [82.64.212.153]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vps.slashdirt.org (Postfix) with ESMTPSA id 8EF3D60140; Sun, 17 Apr 2022 16:52:15 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 vps.slashdirt.org 8EF3D60140 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=slashdirt.org; s=mail; t=1650207135; bh=nietznB6ZgTnFg0C9cBqE28wMNc+jFjgA4EF0khtlIs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lzHZ7+umWyAIt1hLdMGBuneJSjQgHn7ubFcB8kuQT/b/DANXamUh/j2nHs42ap+Mu kFpbOIMDpqUxTcCHICPQ6V21mhP+8RBWjzvrBckZe7FW9mrBksq6jIn7UKupOtJicl aiuSQ0+LpvSCzZfgtKM+ZSAEuZlv65mNjQArD9k4= From: =?utf-8?q?Thibaut_VAR=C3=88NE?= To: =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rgensen?= , Kalle Valo , linux-wireless@vger.kernel.org Cc: Felix Fietkau , =?utf-8?q?Petr_=C5=A0tetiar?= , Clemens Hopfer , =?utf-8?q?Thibaut_VAR=C3=88NE?= Subject: [PATCH v2] ath9k: fix QCA9561 PA bias level Date: Sun, 17 Apr 2022 16:51:45 +0200 Message-Id: <20220417145145.1847-1-hacks+kernel@slashdirt.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This patch fixes an invalid TX PA DC bias level on QCA9561, which results in a very low output power and very low throughput as devices are further away from the AP (compared to other 2.4GHz APs). This patch was suggested by Felix Fietkau, who noted[1]: "The value written to that register is wrong, because while the mask definition AR_CH0_TOP2_XPABIASLVL uses a different value for 9561, the shift definition AR_CH0_TOP2_XPABIASLVL_S is hardcoded to 12, which is wrong for 9561." In real life testing, without this patch the 2.4GHz throughput on Yuncore XD3200 is around 10Mbps sitting next to the AP, and closer to practical maximum with the patch applied. [1] https://lore.kernel.org/all/91c58969-c60e-2f41-00ac-737786d435ae@nbd.name Signed-off-by: Thibaut VARÈNE Acked-by: Toke Høiland-Jørgensen --- v2: Adjust #define per Felix's suggestion --- drivers/net/wireless/ath/ath9k/ar9003_phy.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.h b/drivers/net/wireless/ath/ath9k/ar9003_phy.h index a171dbb29..ad949eb02 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.h @@ -720,7 +720,7 @@ #define AR_CH0_TOP2 (AR_SREV_9300(ah) ? 0x1628c : \ (AR_SREV_9462(ah) ? 0x16290 : 0x16284)) #define AR_CH0_TOP2_XPABIASLVL (AR_SREV_9561(ah) ? 0x1e00 : 0xf000) -#define AR_CH0_TOP2_XPABIASLVL_S 12 +#define AR_CH0_TOP2_XPABIASLVL_S (AR_SREV_9561(ah) ? 9 : 12) #define AR_CH0_XTAL (AR_SREV_9300(ah) ? 0x16294 : \ ((AR_SREV_9462(ah) || AR_SREV_9565(ah)) ? 0x16298 : \