Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2609762rdd; Fri, 12 Jan 2024 15:43:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IFEk35MfTaGe9hPOHP+Q7Phn6LSzV6q0OjfCySJQIpm/y1ECXm2CedZvu44KzmGYm8hhvHG X-Received: by 2002:a17:903:1ca:b0:1d5:5984:df51 with SMTP id e10-20020a17090301ca00b001d55984df51mr2515181plh.119.1705103014852; Fri, 12 Jan 2024 15:43:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705103014; cv=none; d=google.com; s=arc-20160816; b=pGy2nyGZZr062bVw08q2wRqx+VeRepS9nA/Hzl8ZDJhUjH9vL9B2xYDby0UptNBXOg rbHk8A3SrVk6cYqKN52zZrJc9fPT33SCsr05w6phru9xibiPFSgtXnPLWaVZBrIIcaKO dW/VqiD8isLN5thPS8r45d77CWIkrc1qdGbAymWKA1YijWJlajf8cEU+2q7LO83xIIac zi1YgnSoLk6uU4mJDfRE7PPh2eoHW3eFH15IPen9Zqb0wz3lSrV4Pgzu078tv8Hh3cnB Yl9KTJelsh+Ss4jCgRLO1tcUNS30L43/svlJGYiAAPxEJg3qq69hARyxir3KqYp+w5Bg tPug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=0RIte2y7M1FzOvcoNgzcBwvhRHKktRIdQOz1wPsAZgM=; fh=rkIxfIjFzB5Og97966ENSJbwrt8pkS9AnSY/zHDVTmQ=; b=TrLq9aWmFJZBuqAt94YZH9RUtKCstVT9t5OI9U1tb4cDn9XInQ0u/5F8aLyimIZ149 Qa5F97TMm8TcKJOfWLR4y0QuOXZudd2lZjN5G2I7GgoQ05TxozGe+OQrC9rjon8ThPU9 UlytUHVMRr3mjYJWHFik6ll7tYElDgxD405WhiVVWMeEFOW6F1tdYYRj49SUV6U0XVKx Awcqaz+LRvwClofMYBUKd7c+XI7zu8ShbzTON2uGdqqCQRpALwXaMzX0T6R+GBCPSM8R iOBiZ94U2eWGcYJl5TUFpQlxmw5+KckF5fL2cNnaM/99u0O1I00s6TmKdM5wiO7nFEMV AqTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W9kUiCYH; spf=pass (google.com: domain of linux-wireless+bounces-1848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1848-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y12-20020a170902700c00b001d42a95ec21si4043981plk.365.2024.01.12.15.43.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 15:43:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-1848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=W9kUiCYH; spf=pass (google.com: domain of linux-wireless+bounces-1848-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-1848-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C65EFB23D7E for ; Fri, 12 Jan 2024 23:43:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6C3741BDE0; Fri, 12 Jan 2024 23:42:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W9kUiCYH" X-Original-To: linux-wireless@vger.kernel.org Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9DA21BDC6 for ; Fri, 12 Jan 2024 23:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-40e586a62f7so40454565e9.2 for ; Fri, 12 Jan 2024 15:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705102954; x=1705707754; darn=vger.kernel.org; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=0RIte2y7M1FzOvcoNgzcBwvhRHKktRIdQOz1wPsAZgM=; b=W9kUiCYHaxEAUOMWeHxNaHIjQIf7I63kWWdQroQdzBp+9moijsCUS5+Xt7smfr+FKn a+b0URi0VKk8zenn9mVzvPyVwU3un+tjppcOPkeM8+3gjASB2s98RmQiMOKWE+3/Luo8 tpyIksnrorJEapdmhjkagKZscixnmYj8Wk8jWEqapdOvw0pS62/QJvZTvPHk/FQVmkCL +xnwBo3Gf3TlVirRucHCYyU48h4j2HlivxMxXL5QSg3ISrw7kowm/+Q3I+CnvJ5W9RGq XBE92iTiR+614Uth+lg1AL7aC2a77c1GduVUPzaSKLX+3jcJQlTNGsSdBROExjuSM+5M Yn7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705102954; x=1705707754; h=content-transfer-encoding:subject:from:cc:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0RIte2y7M1FzOvcoNgzcBwvhRHKktRIdQOz1wPsAZgM=; b=NzkRsOH8w24xfofENU7qo77dxXEzvHcdjIKjk7NJ3q0w7pEcekGChIOBM/xrzsPhv5 qwHO/xuGkdKr6rqc03DUP3n2E7+8tCEPeqR5c/Af1IksY9u0HeR4r4nwQFbQ51jx5VaP sDR5F6JiUb/u5WtKBf7a5XtcjDHc1X3SgKCaq6ymKLghXD6TwLv/NPWr2duLgcHaEgiY wOQkMIHRYxA0g4j+nQV6IR3vjbd4lVWkPYje8N3rJ8k+lEv0p06i8ErQZ0SlEBln7CWU NzZl3+uAXJDQq49/OWPRLP9CSMa90wJUjq7mvpcSsyio46Efdx88Nf5yN+az3oS351Ti Br4w== X-Gm-Message-State: AOJu0YyLU9CZRd/xcCIxFNDgLm4gbPPsPFwRVHtKU7VoUx/VZQYqIVJq 7DwxpirPTdKhgfonPHdDdrvAbRgHNMQ= X-Received: by 2002:a05:600c:6a06:b0:40e:66ac:dfd7 with SMTP id jj6-20020a05600c6a0600b0040e66acdfd7mr963474wmb.87.1705102953703; Fri, 12 Jan 2024 15:42:33 -0800 (PST) Received: from [192.168.1.50] ([81.196.40.51]) by smtp.gmail.com with ESMTPSA id l22-20020a05600c4f1600b0040d6b91efd9sm11180319wmq.44.2024.01.12.15.42.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jan 2024 15:42:33 -0800 (PST) Message-ID: <19a3e023-0eaa-4096-9f78-a2c8e909cb54@gmail.com> Date: Sat, 13 Jan 2024 01:42:29 +0200 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "linux-wireless@vger.kernel.org" Cc: Ping-Ke Shih , Larry Finger From: Bitterblue Smith Subject: [PATCH] wifi: rtlwifi: rtl8192de: Don't read register in _rtl92de_query_rxphystatus Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Instead of reading bit 9 of RFPGA0_XA_HSSIPARAMETER2 every time a frame is received, just use rtlphy->cck_high_power, which is initialised in _rtl92d_phy_bb_config(). That bit never changes anyway. With this change _rtl92de_query_rxphystatus() can be shared with the upcoming USB driver. The USB driver can't read registers in this function because register reading can sleep. Compile tested only. Signed-off-by: Bitterblue Smith --- "That bit never changes anyway." <- I'm 99% sure this is true. --- drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c index 02ac69c08ed3..192982ec8152 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c @@ -42,6 +42,7 @@ static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw, bool packet_beacon) { struct rtl_priv *rtlpriv = rtl_priv(hw); + struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv); struct phy_sts_cck_8192d *cck_buf; s8 rx_pwr_all, rx_pwr[4]; @@ -62,9 +63,7 @@ static void _rtl92de_query_rxphystatus(struct ieee80211_hw *hw, u8 report, cck_highpwr; cck_buf = (struct phy_sts_cck_8192d *)p_drvinfo; if (ppsc->rfpwr_state == ERFON) - cck_highpwr = (u8) rtl_get_bbreg(hw, - RFPGA0_XA_HSSIPARAMETER2, - BIT(9)); + cck_highpwr = rtlphy->cck_high_power; else cck_highpwr = false; if (!cck_highpwr) { -- 2.43.0