From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 4FD9E3EB113 for ; Fri, 26 Jun 2026 09:56:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782467820; cv=none; b=q0LLHDha56WUkfi/tCOcTKQMxsAIDbSD5PmL/KoEDVih4V+azQlm3o7ejBCVPid1YWRGjqraBURFivCu5MgfWWpMPO/Ac3MemMkirmJ1Lrmjz2VcTM1msKGsuwnrXI5c8J8nFUH2ogu9gK+7aN/ovIVMAA9Uo1KjG1rVDOmyc4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782467820; c=relaxed/simple; bh=Kd+TnaDGPJyWK7v4ONuf2eQp5WbJgJhQDgrvEIGvASU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQddR9qfN9j2ayMX4vqgroO4cZ7qgLDMJy+QxQtwiBTFI/mVgDsA8Z7n0E/kradnGXwiKO4IHIoE5sF/NJT/oWkg5TNi4b6RWComfOnhbLnnAa9UqkBSgz16tNL+amlLh0KlTvBkJfrh+Tc/qGr6S/+dnZBq4DkAfqga6QBbipY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KiROF9ai; arc=none smtp.client-ip=209.85.208.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KiROF9ai" Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-69531108f25so1383292a12.2 for ; Fri, 26 Jun 2026 02:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782467818; x=1783072618; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FL6Sc/C42ZpW30JL0f7H1Tdck+5JPnz3ydDM2HzSp1I=; b=KiROF9aiH298o6PYM3ZUcfn/2+0GBA9pNcvyTdKBduE3zjMCb+1/9A/DXGzSxmbzch RG7A5Hb5VZ1XwApjQE8kH3ZEoyXeIZfh9weBkFQPxR1x1fQNExSD3TT/CqwxrEdWuEKq NhrKqjBzClxTIojEx+2HyOivW/9nDcfO8OGMzkRlXim+Hz1rTW1x+I3fHXsQvKtC2DL+ m26NsFvGiS8O+hVwmlIrynFpHIry6dSAuuiWcuIHxhQ0t6oCkiJbVIC+SxiMIGbWe2l+ Ddn4cV/XRkFhRpvpoaYMAuEVC0okiN69YR0Ra1vATv877QBeZ3QKWjWV0CmBL2RaL/RI kvPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782467818; x=1783072618; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FL6Sc/C42ZpW30JL0f7H1Tdck+5JPnz3ydDM2HzSp1I=; b=FNxaQ7Rnja4vRvy33SuG/em5fvl16yn7w0+dP0aqHNzOaAWlvw4lA4WCwIQqn/LN2I 7BrBSXPq5aUvbflFPCDFGtHFuOkirR35tQLasDAuwUUZ08ae/f5E3bSAxuT77pQD6aSj LjKA6LMenEFmnE2ifzLjtQcvRGhEsUkF2cJ1qH6Ii9ywFLAPrZCBRtvR3h+2OEmc4qpi PBiMp6weVBotHZeCXMIkNXCVN2fSaPofzya+OoIHeG2n2INcK6RIlLJb159nwosOA2nt u6H1iRR7uG6n64llQpayo9+piCrPlrjRxltdU7yn9o/Vu1+z/xYFy7MEXtgOqfiEU88/ j/VA== X-Forwarded-Encrypted: i=1; AHgh+Rpju08f/R6jlYV1/r5Lhlz2Tt4gioNAgs1JqXY1Y2Dll+kVhL8UObG6/5kZqCbJ5e5YieWQN/feojKVqvw=@vger.kernel.org X-Gm-Message-State: AOJu0YxeQZNw+DF536EOlmVszDtC1PlkW67YBraLPiXaDb2y6Aq1h6M1 aBLU42Z1l2PzizsqWuMo+JV8mKmhw6WjQp6gDfLJP3H0itCHHDrtT8BD X-Gm-Gg: AfdE7ckaj66JrnsbtP96kLK05MVPpqhuxCyAECmmcnpM/Sq2JBwfGoIgIWN4+TjzKw+ gbedioacrtiOeWIADv7R1DGbjpKvjpsz7Kj6Kk8Cct94MEInGM9p/PjkoeQJm/R+qSRMVj2zXWZ LJk+UwrBd3WQ8XM4Fbo7D+DJfv0ku8z9hFOds6FPf+7ODXAc6rjZt/9mzBB/k+8IfHtWzAhkJyr GkIQiPWCFDLFsNIor1RXd6Z2YEjHtph7x/EQxMfsYlbcqhn8T82t6pQ6Cw+0fmyM/lNxXrVlaQj CoWUJD0lTa4dea2Wt5L17XJrilSr6v68F0ISdLyiS2fWBSuwSd9iNsMYQQun6LNGgYTU8H/zzoG J2X20EWBgiRLqL4Zfn3lEB6W555W6jCqLmAmQoW9zLj6eU1N35I+zPEsoXbO/pJraMSgqXz+VVX yxvVZjFuoeSDWOw2duQZdj/Jw= X-Received: by 2002:a17:907:7203:b0:c12:1d59:23cf with SMTP id a640c23a62f3a-c121d5936a6mr176524366b.35.1782467817511; Fri, 26 Jun 2026 02:56:57 -0700 (PDT) Received: from localhost ([80.208.66.169]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c11fbe05f9csm311638166b.31.2026.06.26.02.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 02:56:56 -0700 (PDT) From: William Hansen-Baird To: pkshih@realtek.com Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, William Hansen-Baird Subject: [PATCH rtw-next v3 1/3] wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding Date: Fri, 26 Jun 2026 11:56:46 +0200 Message-ID: <20260626095648.1124924-2-william.hansen.baird@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260626095648.1124924-1-william.hansen.baird@gmail.com> References: <20260626095648.1124924-1-william.hansen.baird@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit commit 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723") adds code which sets ppsc->support_aspm to false in _rtl_pci_update_default_setting() in order to disable ASPM. This does not, however, disable ASPM. Rather, it disables driver control of ASPM, and blocks calls to rtl_pci_enable_aspm() and rtl_pci_disable_aspm(). In some cases, the pci device supplied to the probe function has ASPM enabled. The code would therefore not disable ASPM, as it means to, but rather just leave it enabled. This was discovered through testing on a Razer Blade 14 2017. Implement a new __rtl_pci_disable_aspm(hw) function which does not check ppsc->support_aspm before disabling and call it from rtl_pci_disable_aspm(). Then move the code added in the previous commit to rtl_pci_init_aspm() to allow adding a call to __rtl_pci_disable_aspm(hw). This makes sure ASPM is disabled while still disabling driver control of ASPM to block it from being enabled later. Signed-off-by: William Hansen-Baird --- drivers/net/wireless/realtek/rtlwifi/pci.c | 39 ++++++++++++++-------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 73018a0498b4..38eca8d91581 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -156,15 +156,6 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) PCI_EXP_LNKCTL_ASPM_L1 | PCI_EXP_LNKCTL_CCC)) ppsc->support_aspm = false; - /* RTL8723BE found on some ASUSTek laptops, such as F441U and - * X555UQ with subsystem ID 11ad:1723 are known to output large - * amounts of PCIe AER errors during and after boot up, causing - * heavy lags, poor network throughput, and occasional lock-ups. - */ - if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8723BE && - (rtlpci->pdev->subsystem_vendor == 0x11ad && - rtlpci->pdev->subsystem_device == 0x1723)) - ppsc->support_aspm = false; } static bool _rtl_pci_platform_switch_device_pci_aspm( @@ -203,7 +194,7 @@ static void _rtl_pci_switch_clk_req(struct ieee80211_hw *hw, u16 value) } /*Disable RTL8192SE ASPM & Disable Pci Bridge ASPM*/ -static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) +static void __rtl_pci_disable_aspm(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); @@ -215,9 +206,6 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) u16 aspmlevel = 0; u16 tmp_u1b = 0; - if (!ppsc->support_aspm) - return; - if (pcibridge_vendor == PCI_BRIDGE_VENDOR_UNKNOWN) { rtl_dbg(rtlpriv, COMP_POWER, DBG_TRACE, "PCI(Bridge) UNKNOWN\n"); @@ -240,6 +228,16 @@ static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) _rtl_pci_platform_switch_device_pci_aspm(hw, linkctrl_reg); } +static void rtl_pci_disable_aspm(struct ieee80211_hw *hw) +{ + struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); + + if (!ppsc->support_aspm) + return; + + __rtl_pci_disable_aspm(hw); +} + /*Enable RTL8192SE ASPM & Enable Pci Bridge ASPM for *power saving We should follow the sequence to enable *RTL8192SE first then enable Pci Bridge ASPM @@ -330,10 +328,25 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev, static void rtl_pci_init_aspm(struct ieee80211_hw *hw) { + struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); + struct rtl_priv *rtlpriv = rtl_priv(hw); _rtl_pci_update_default_setting(hw); + /* + * RTL8723BE found on some ASUSTek laptops, such as F441U and + * X555UQ with subsystem ID 11ad:1723 are known to output large + * amounts of PCIe AER errors during and after boot up, causing + * heavy lags, poor network throughput, and occasional lock-ups. + */ + if (rtlpriv->rtlhal.hw_type == HARDWARE_TYPE_RTL8723BE && + (rtlpci->pdev->subsystem_vendor == 0x11ad && + rtlpci->pdev->subsystem_device == 0x1723)) { + __rtl_pci_disable_aspm(hw); + ppsc->support_aspm = false; + } + if (ppsc->reg_rfps_level & RT_RF_PS_LEVEL_ALWAYS_ASPM) { /*Always enable ASPM & Clock Req. */ rtl_pci_enable_aspm(hw); -- 2.54.0