From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) (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 D2B6E36EA93 for ; Tue, 16 Jun 2026 14:16:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619413; cv=none; b=dY4D2M+33937eRq+2BCqu04awkIfLdl6xJ8vYyiaNYwiBseghTmZD/gH3U+/XBY8Q7m1WNxjCbZ/sluU/qWht0Qccago5to/W2v4NIuwGUY2Sl71ICtMXMidZQW/9RPd5kF5B//vpw726jADJKWawAwDpteZKyUwzr9jBhyvr/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781619413; c=relaxed/simple; bh=rJyACaiama/hH0/dDvDxgISPef9RXUZwHeUgkb9Fzbo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nBGQi6C5gxDzwvl9p0weSI4fYVGcwkGdcEsG6k2rjyS7gHGLVt09nlfkf6npi5pMHDE4loCQRJBCufaQLY3PfEL6a2xo8tGeEUH+EkARWw3tVthkK7YCSxbJPpCtyqgQKZatg5wRG2Jl2PjEr8yTYIGaR0+KaUvsRnVEnoO9Eio= 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=rIrLKTW+; arc=none smtp.client-ip=209.85.208.41 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="rIrLKTW+" Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-68c19f1f3ceso7286322a12.2 for ; Tue, 16 Jun 2026 07:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781619410; x=1782224210; 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=u2a9hA+PF0fA31kviGfm+Sq4O7e9fjo85MgaBgSex4U=; b=rIrLKTW+uO0kOSW7GvebQxsM1lRqXJX/NH7r/bMcX8zQ3kR+0dy79/6G0150AlBDap VMc2mEAz8HzfpyKFUnCWGlUCGyrkwTCFDxn+SJzJ0RALkOK3jrtrZyCByarNVQfAqmSP Doy/m8SKJQRvgihZv4s7akK1FJ9eKXDJtx9FrEhK/Y7NKlxx/azGvUjm3EpgAAeu5H2P CEL9apQ5+se0R0Y8TGB/6/S/azODv3X+Y/DbzZzaX0IFBj1SfD62xV5OXfL17Gz4q9gl 3oRdeCS/Ao2F7rz3tyFoAyaGfbkqWuOBTDx5pwKGLpYQvdfGomNfCz8QBCjPUVl2fi1k htHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781619410; x=1782224210; 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=u2a9hA+PF0fA31kviGfm+Sq4O7e9fjo85MgaBgSex4U=; b=sJAnI9RjVb1l3vSF1Gd70EhZvYzbLXdGtMJXwwO0Imrbw4NIhDtAlBpIVqQrlfhtQV iwbXz3spGtJKVHmnSd7VYKU+zjO6HCyYMqZI6lKIImpOsUXMAO1NMNHSiCobqm9sLTXt neDd0rPctNZSwyEKkPhHJNCq/67FO4qPcFsaoCjJYy0hgbwM9CjHrkUyK1H+QNhOH5CN CHb6Awu4QD908LrWtnuTDvbT39CSroTUfxOm7MklaNJagLkyVMmozqRRdzYS0dt9c+Y+ OgD1WuG/1oh155pRHzCB+gfIhvdJh/ZMkxYhG8cayJO//iz0PCcaX9EY6l2M+nfi/4wR WJ+w== X-Forwarded-Encrypted: i=1; AFNElJ9q1gW34TDUABL+sd7tzTJaRRFTQ2EmB9jEF55od3BNNkUyop6iiPfbWJLwAdf5095WAHw2GjgK0AAF37s=@vger.kernel.org X-Gm-Message-State: AOJu0Yw2T9hlDPtvKuEGCqhFUm+uwhSanQM24xyykcK+IPT8vxj2TTjm qGNzKAkARZ6jSGPgOjth0EzNkFrlk8JfRdk7O3wqIfKGfd7vnG5jr03GfQ1yNFanzac= X-Gm-Gg: Acq92OGi4HZSHlKWRc8AMmDFVimrn5cCbFZKdZfBiENhRe8FDr9Ja+W134O6JUBeJZV Ib/XpSGr2I5ezHA0Ws1B02ZYY4ICep3fVJZclFD7/w0BeEp8YEArESVjff0orUfINOWhaCC7hy2 EWlnG6GG57DCOQ3CnbYbdnr9WwM0uyK3Ny+uftfuUDdG4DN2Gs8hK9Yz81G01KYH8BP4VEOaCST icfJ1TEekwHTTHi1InTGSKrAnqHiz7pfWy8yzZGmOTNkPlyrrwqht9UI+PNrCrCBDMplof2LrD3 07I49EXWeaIYrD2ASORtfEEWIGML1APmsPBc/O4omGCHbmqP0uHK7oVouVmT05F+B1DQR3R6GI2 B295MWpCnMxQursRnII4Jahq3ac8AQV9IwGOqnEmTSovR5utC3AOYscr27eRBEeGDFnzCTYBpOA MLqymJMiwxQt2zfLETMRKgENENH36Im+945zEywcUW3Ldm X-Received: by 2002:a05:6402:5246:b0:691:b0f8:f2c6 with SMTP id 4fb4d7f45d1cf-695087ce047mr2026138a12.17.1781619409987; Tue, 16 Jun 2026 07:16:49 -0700 (PDT) Received: from localhost ([80.208.66.169]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6937949bc64sm5122136a12.26.2026.06.16.07.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 07:16:49 -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 v2 1/3] wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding Date: Tue, 16 Jun 2026 16:16:18 +0200 Message-ID: <20260616141620.91081-2-william.hansen.baird@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260616141620.91081-1-william.hansen.baird@gmail.com> References: <20260614135508.70307-1-william.hansen.baird@gmail.com> <20260616141620.91081-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. Fixes: 77a6407c6ab2 ("wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723") Signed-off-by: William Hansen-Baird --- drivers/net/wireless/realtek/rtlwifi/pci.c | 38 ++++++++++++++-------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 73018a0498b4..a5bab06f2b61 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,24 @@ static void rtl_pci_parse_configuration(struct pci_dev *pdev, static void rtl_pci_init_aspm(struct ieee80211_hw *hw) { + struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); + struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(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