From patchwork Tue Apr 22 06:17:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mingcong Bai X-Patchwork-Id: 883570 Received: from relay2.mymailcheap.com (relay2.mymailcheap.com [217.182.66.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D599EE56F; Tue, 22 Apr 2025 06:18:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.182.66.162 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745302702; cv=none; b=TDTfUd9Nq+p+YCSWMmJnA7WEFrS7i/sZmSrGAf8koJWJCq2TOXPa7EhLURMcQlr2Z5l7tt5OUB5RFCB6W3ZNqLFY9d3eBEJphlo9Q1tIeIy19j3utMBcKi7BEZ5URM7MP9O/54mDkciqfQ8neA57VUfxgt4y8kqaI63aSxeOqjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745302702; c=relaxed/simple; bh=r6vl2FpaPYnpaqdusFI5msn9JVcDcophXwwsZfaOChQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DYwtIPbgUq0LzlUm1fhsKrNyd8qm+NxLorRJqga2usFg+LOX2rYwKO2FG7192tn/LkAXZEUcdGCxCoPv8DlJCUFgfbH/Jeh/ocm6NNjhYJfyj0GZA3o27ate0cPEg9449byNE7JnXEwhJQ/bIRMdwRLGYYUTjB3YAWLfx4Hv6TA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aosc.io; spf=pass smtp.mailfrom=aosc.io; dkim=pass (1024-bit key) header.d=aosc.io header.i=@aosc.io header.b=vjtgOsEa; arc=none smtp.client-ip=217.182.66.162 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aosc.io Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aosc.io Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aosc.io header.i=@aosc.io header.b="vjtgOsEa" Received: from nf1.mymailcheap.com (nf1.mymailcheap.com [51.75.14.91]) by relay2.mymailcheap.com (Postfix) with ESMTPS id E200B3E885; Tue, 22 Apr 2025 06:18:18 +0000 (UTC) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) by nf1.mymailcheap.com (Postfix) with ESMTPSA id 8868E40047; Tue, 22 Apr 2025 06:18:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1745302698; bh=r6vl2FpaPYnpaqdusFI5msn9JVcDcophXwwsZfaOChQ=; h=From:To:Cc:Subject:Date:From; b=vjtgOsEaupt/Djm7Yo24ehIcw7gIHpuh6J6DjzJLrp5M5SpIezJiUKEe7mI/y1dkD YN9YN4j0QiJUiTx5LfHMLdX9FhnYmgeo3HjHLdeX3GeuwUtvIXkW39u2SAjSXXzBWp z6kySvKlSC7bRVTqiAacRvvL85szxaYBm2acoY4M= Received: from JellyZhongke.localdomain (unknown [203.175.14.48]) (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 mail20.mymailcheap.com (Postfix) with ESMTPSA id 8FC1141F59; Tue, 22 Apr 2025 06:18:14 +0000 (UTC) From: Mingcong Bai To: Ping-Ke Shih Cc: Kexy Biscuit , Mingcong Bai , stable@vger.kernel.org, Liangliang Zou , Larry Finger , "John W. Linville" , linux-wireless@vger.kernel.org (open list:REALTEK WIRELESS DRIVER (rtlwifi family)), linux-kernel@vger.kernel.org (open list) Subject: [PATCH rtw-next v2] wifi: rtlwifi: disable ASPM for RTL8723BE with subsystem ID 11ad:1723 Date: Tue, 22 Apr 2025 14:17:54 +0800 Message-ID: <20250422061755.356535-1-jeffbai@aosc.io> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spamd-Result: default: False [3.50 / 10.00]; FORGED_RECIPIENTS(2.00)[m:kexybiscuit@aosc.io,m:jeffbai@aosc.io,s:linux-kernel@vger.kernel.org]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; SUBJECT_RANDOM_CHARS_1(0.10)[]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ASN(0.00)[asn:16276, ipnet:51.83.0.0/16, country:FR]; ARC_NA(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; SPFBL_URIBL_EMAIL_FAIL(0.00)[rawdiamondmc.outlook.com:server fail,jeffbai.aosc.io:server fail,stable.vger.kernel.org:server fail]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; FREEMAIL_ENVRCPT(0.00)[outlook.com]; FREEMAIL_CC(0.00)[aosc.io,vger.kernel.org,outlook.com,lwfinger.net,tuxdriver.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Server: nf1.mymailcheap.com X-Rspamd-Action: no action X-Rspamd-Queue-Id: 8868E40047 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 and at times lock-ups: pcieport 0000:00:1c.5: AER: Correctable error message received from 0000:00:1c.5 pcieport 0000:00:1c.5: PCIe Bus Error: severity=Correctable, type=Physical Layer, (Receiver ID) pcieport 0000:00:1c.5: device [8086:9d15] error status/mask=00000001/00002000 pcieport 0000:00:1c.5: [ 0] RxErr Disable ASPM on this combo as a quirk. This patch is a revision of a previous patch (linked below) which attempted to disable ASPM for RTL8723BE on all Intel Skylake and Kaby Lake PCIe bridges. I take a more conservative approach as all known reports point to ASUSTek laptops of these two generations with this particular wireless card. Please note, however, before the rtl8723be finishes probing, the AER errors remained. After the module finishes probing, all AER errors would indeed be eliminated, along with heavy lags, poor network throughput, and/or occasional lock-ups. Cc: Fixes: a619d1abe20c ("rtlwifi: rtl8723be: Add new driver") Reported-by: Liangliang Zou Link: https://bugzilla.kernel.org/show_bug.cgi?id=218127 Link: https://lore.kernel.org/lkml/05390e0b-27fd-4190-971e-e70a498c8221@lwfinger.net/T/ Tested-by: Liangliang Zou Signed-off-by: Mingcong Bai --- drivers/net/wireless/realtek/rtlwifi/pci.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 0eafc4d125f9..898f597f70a9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -155,6 +155,16 @@ static void _rtl_pci_update_default_setting(struct ieee80211_hw *hw) ((u8)init_aspm) == (PCI_EXP_LNKCTL_ASPM_L0S | 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(