From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 49DF031F9AA for ; Tue, 30 Jun 2026 14:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782828969; cv=none; b=lqlsLY7j/UrO1meaCGcC8M8h9J392UI5bKYCJmI2VggY+6h5SjZCb+Xu4RhyQkkiruQ0sKc3gxVhLnb1XWB3IX15yNgb+jSxBNRzpo8q1gjqe63muTvN/rvy8VOcyeafBk/MZHcgkqI013DKwuuO4XsM50k6KdQimUincMgEK8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782828969; c=relaxed/simple; bh=tto2rfCYdsH4DCmsQ3VkPbRQvNS9U5GQfTh6DJwpX2Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jBBZTNU7Gy+JZeUMKDD0CVidj6aiDLBYjLWnKAqo5peUof/7Vb94vvCkttIiwpmGn6DDJpUDhzJhmdcAkgEIUKHCLoaac6PVCdlezUkYi/pHJfyiu+fa1e99r95e2rfpq/JfUYz5w252sfOY2v69yUaG0WLajlZJtLVuzzTbSAo= 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=bi1ZlCRY; arc=none smtp.client-ip=209.85.208.52 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="bi1ZlCRY" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-6986578d8c0so3928393a12.1 for ; Tue, 30 Jun 2026 07:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782828967; x=1783433767; 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=hK+dNZ8FTunYuRNHjOXWfA8/Iqk2Bd3g0hrdFJP9Rrc=; b=bi1ZlCRY5sC+bsdR3llLt5I6yFwKj7hlBVHqPCbNMSQUqO/ZCKgjjahXJeC0x8Lp3U JA2EhuR5wPv9rcPXwoXwzoKs6zzoreaFe0T17OzqQ7gM+8hWhp9Gxvlnq1pw46nItT9i uZv7hYAT3/eV92Grhi/gecTORsAPowtI4toP/zlXj56UR+fmvbxV+0sFpriAvHwPTXf+ vCenawWksoCaO+aSqm+0gbBupi3XP/kmCmHR7z6/m8EKz9RMWDLIk3s1YMkeHSbWzo0U wcR4nv9+dmIGEQkxjtnKdgYFQwag8H7hhJliybwdlRffB8nDPuIDpr0ZamxXP+JoKpc9 atwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782828967; x=1783433767; 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=hK+dNZ8FTunYuRNHjOXWfA8/Iqk2Bd3g0hrdFJP9Rrc=; b=sFDioECXL/lyhVPTvd8cPFtdaivVcFXL+WUPJIfT1IB0OQUPcKhTuvzWjXHJEj0bon 13BtshizCiKsoWHAeRVGdHLSvRGmWV4OfWD8OOhQ32G+eD7EjSZEtvDooAI6tprpgJ5M kMEdhpP6xxX1RiHxTMv0eDtiNNGzeLfdSvnv9JppoVWlkPFX4hq9A+PN+eMNTvdghb+T F/bLd7iw7XLlWQA6+bs2hpOGJH61mtl4yNE3budZNjrJFKPBOvuKkb0Un9jqw7MdwGil +ISanCjxqiPxM4Ks36qcschPoGHlgtRRMDPvtDmaG/fBsCeTQorA5MSqQFVRNyfripI3 5SFA== X-Forwarded-Encrypted: i=1; AHgh+RpVWMu1UaQ1BF5CCxIxrNcH9oF83nWQrOjC1hkQgbdb0SocL0ivEPiQMxf2QQdORTlA2eUM0+9KiQ7ex68=@vger.kernel.org X-Gm-Message-State: AOJu0YyZOfdECJ6ufXyVRmZZNhAc+hJTXJVEggWvAAOIYAx9egmPFOeB fw6n+Xz3lv+ITwL7tqjSmNMwKmHIb9TAUA83KIz+NLF/8A9bgVWs52vm X-Gm-Gg: AfdE7cns9nISNHeXp9DzQIYH7JpdR5BTf1N/x24Dr0HfjkxvF60JcvKTBQKCkdHsbVv UhdZxubmTR20R1EJGfiHd+q3f5gtdKCy6PSeIGWEaCpXl/uUKf+gB3lA7OybbKs65gLHkhRrS/s 0Ua1apIzWkBxTrzF7k6s/8YM0HWtVREMpYtnSGXpMsqM+rDKyULvYGUnI23B1rDtaDXFHa8rmNn LFfvz/KSUDJTtAE017+LQEYDZBaBMbra/u2P1eXCc3gluu2LBcMJBd9inJ8v1yYW5RK+psK8qPv zcaUZKyGbzJDtEalNj0DUtdrENyayspWOnl0gc777RpON50kBfeA1jSnbIKEXuA1EeZq/0LTGL3 Fe3AjLFdY9FoHgI+ap9+xx26hSYoOlxDfB+B581swKwOD81ZtT/bXElHI4XSsLWA6NRh/sF6syH 3MPkb6iWOEzi/dUByKpwVgLGGNRusFWCWZyw== X-Received: by 2002:a17:907:6ea4:b0:be2:7f13:8e33 with SMTP id a640c23a62f3a-c128730a922mr190485566b.45.1782828966333; Tue, 30 Jun 2026 07:16:06 -0700 (PDT) Received: from localhost ([80.208.66.169]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1288f4a137sm135831866b.50.2026.06.30.07.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jun 2026 07:16:05 -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 v4 1/3] wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding Date: Tue, 30 Jun 2026 16:15:51 +0200 Message-ID: <20260630141553.785769-2-william.hansen.baird@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260630141553.785769-1-william.hansen.baird@gmail.com> References: <20260626095648.1124924-1-william.hansen.baird@gmail.com> <20260630141553.785769-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 Acked-by: Ping-Ke Shih --- 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..f706575f92ce 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