Message ID | 20231113043454.10053-2-jhp@endlessos.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp996183vqg; Sun, 12 Nov 2023 20:37:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEcmQmdgw84sq7DaETYOvSPhefGqxR0v5wSvsjYCntMBe5X57+I1mf3fZt7HPqbhL5kKMlp X-Received: by 2002:a17:902:ee93:b0:1cc:37b9:4953 with SMTP id a19-20020a170902ee9300b001cc37b94953mr3438074pld.67.1699850253377; Sun, 12 Nov 2023 20:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699850253; cv=none; d=google.com; s=arc-20160816; b=TJg5iFSwdE1UICpnnlQDwh6MGh3jVIOWpQH6csoLALMv/0lp8r8FQpwnqASWogpjvv TL2BUu+6ZJ+lhK0j0qedEupTmnnbowgdpMAeSmWIUzf/B5Sdv1baiKlV+JOnMDR0dtQ2 2mO44naUNfpEMt5EBPchqdCUBDK2m4/tdEtW1V9bwtR0tZ2OcGc72f2iw+0A/IcZvrui SQLrupVmtXvsDyzAAENof+v2l2/DpKCiQB8OmAmUWLoyWAhdWaPjrmaE4FJwEJ28eXT6 EkN1N3dfTiIW/QHhbq75Hm8OlGtVAcrXG/V+GwB/mX4Gb+q8PQUhf6mVBHGsSfckGPMP JRSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=d7VAuuJUScsrG8D+oIxoYLreMolx9A0hdp1gM6zx9CU=; fh=9mR7amsgykc186fQPKcpcfBjT1k+OvkMt0EUJyXFGOA=; b=ei74i3SDXkwmtLHK23hT+J0JGv25EhVtJWIHrUqFqewEnL5o5ULanap9Qjb0cfLCqu xBI22j8InOQ5Z5/U2CQaXTBZefc7wd8UbbanyG9/J5KeiTAKBJ5hvimBwYyC+un147R+ 8DwbckA9328iHxN8EIqDguSfmhx7stPObZ/px99KX5IeTcX3QST0msv4tm8yNPowpyY2 WL4tnxfs4+EW9QyTbXBKuQccia1w0dXDJDmgvaaKsTX44gMrXUduLE1tAMzzfCD5DId8 qvrWVAr4ANA7YVj1Z/XjL/RA2327o/xzU7M/DmAAcQLxeZ5bWuAm3jpqKjj37c7yh2sO MlAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=S1oVAvrB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id b12-20020a170902b60c00b001ae40e07fb0si4796442pls.216.2023.11.12.20.37.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 20:37:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessos.org header.s=google header.b=S1oVAvrB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=endlessos.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 44C3B80A58D7; Sun, 12 Nov 2023 20:37:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233147AbjKMEhP (ORCPT <rfc822;heyuhang3455@gmail.com> + 29 others); Sun, 12 Nov 2023 23:37:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229793AbjKMEhN (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 12 Nov 2023 23:37:13 -0500 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06E131718 for <linux-kernel@vger.kernel.org>; Sun, 12 Nov 2023 20:37:10 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1cc0d0a0355so28030105ad.3 for <linux-kernel@vger.kernel.org>; Sun, 12 Nov 2023 20:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessos.org; s=google; t=1699850229; x=1700455029; 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=d7VAuuJUScsrG8D+oIxoYLreMolx9A0hdp1gM6zx9CU=; b=S1oVAvrBv+aVgFpWlYUu5JXisa8Dwhe5i2oR7SJqAQ6kDD20csWc0a1W4c8403/T+t GlgXa9R3lQiNHHnfrFPp4yDQee7hJnCDdfZrQ9Ip4qvYREs/yUtCBVDg62wCTX+jtxlc DfIF5vhulmbZMpHWfvlhHX2U6SSwnBY0UbOlcZ3o/uYjbM3U4ZwVTHxJo7FMVwadhMP7 Tt/nyCQOzlxi45UzPx59hcrdOnOICpzmxvDmvt3lli93WSykg2v1ms4VVtriQqnNNFym I1m977JAUWJ2ca/VUJ15s7pst9T0Itkg2EvhWMWMrthhAH/fPRMkB4kKt/brIExwK4I/ +LwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699850229; x=1700455029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d7VAuuJUScsrG8D+oIxoYLreMolx9A0hdp1gM6zx9CU=; b=kY4jm7uFH5xFEcBF7tcHS8XuDzqkdveGmU5lmUATBcK2xQSkqTzg7ARYWqKZthXUFq Lv+IlPpHxZjA85iQCV1iy3MsihFa+kdHMa/byEspIXoatHhLAyXXpg/5vD/KVcXdivaH /VJEAqPaFwVr/ZWtu8Uhl52vmYS9GjtlNB4+r4BOd2aKOfCLPY8dG4vQ9bsd57e54Jix M9O6U2q49e2CKBMJQsT/2m5Xa9jqEVEf0zK34Fg+sVFbPRJXrucCCmG/tPk9EzJaEBzk xNIUS2uKGSbZ2cxJ25PO7BPlFAVBWK/lLVksn3zBlv8c3O1oChet/ZV3omlD2/FXN7gu jEQw== X-Gm-Message-State: AOJu0YzoQ2MRB2GJ/72UbWR3Y6s7cQeTqwRDy83esO5CX78fNKKOn+eE WF0VpZPmuFtSXjYU/qJND5etpg== X-Received: by 2002:a17:902:d50a:b0:1ca:4092:7200 with SMTP id b10-20020a170902d50a00b001ca40927200mr3546686plg.54.1699850229373; Sun, 12 Nov 2023 20:37:09 -0800 (PST) Received: from localhost.localdomain ([123.51.167.56]) by smtp.googlemail.com with ESMTPSA id l18-20020a170902eb1200b001cc3b988fd6sm3245181plb.265.2023.11.12.20.37.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Nov 2023 20:37:08 -0800 (PST) From: Jian-Hong Pan <jhp@endlessos.org> To: Larry Finger <Larry.Finger@lwfinger.net>, Ping-Ke Shih <pkshih@realtek.com> Cc: Kalle Valo <kvalo@kernel.org>, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessos.org, Jian-Hong Pan <jhp@endlessos.org> Subject: [PATCH v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge Date: Mon, 13 Nov 2023 12:34:55 +0800 Message-ID: <20231113043454.10053-2-jhp@endlessos.org> X-Mailer: git-send-email 2.42.1 In-Reply-To: <05390e0b-27fd-4190-971e-e70a498c8221@lwfinger.net> References: <05390e0b-27fd-4190-971e-e70a498c8221@lwfinger.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 12 Nov 2023 20:37:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782422179241507692 X-GMAIL-MSGID: 1782422179241507692 |
Series |
[v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge
|
|
Commit Message
Jian-Hong Pan
Nov. 13, 2023, 4:34 a.m. UTC
Disable rtl8723be's ASPM if the Realtek RTL8723BE PCIe Wireless adapter
connects to some Intel PCI bridges, such as Skylake and Kabylake.
Otherwise, the PCI AER flood hangs system:
pcieport 0000:00:1c.5: PCIe Bus Error: severity=Corrected, 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 (First)
pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5
pcieport 0000:00:1c.5: AER: can't find device of ID00e5
pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5
pcieport 0000:00:1c.5: AER: can't find device of ID00e5
pcieport 0000:00:1c.5: AER: Multiple Corrected error received: 0000:00:1c.5
pcieport 0000:00:1c.5: AER: can't find device of ID00e5
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=218127
Signed-off-by: Jian-Hong Pan <jhp@endlessos.org>
---
v2: Add the switch case's default condition with comment:
"The ASPM has already been enabled by initializing
rtl8723be_mod_params' aspm_support as 1."
.../wireless/realtek/rtlwifi/rtl8723be/sw.c | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
Comments
> -----Original Message----- > From: Jian-Hong Pan <jhp@endlessos.org> > Sent: Monday, November 13, 2023 12:35 PM > To: Larry Finger <Larry.Finger@lwfinger.net>; Ping-Ke Shih <pkshih@realtek.com> > Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; > linux@endlessos.org; Jian-Hong Pan <jhp@endlessos.org> > Subject: [PATCH v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge > > Disable rtl8723be's ASPM if the Realtek RTL8723BE PCIe Wireless adapter > connects to some Intel PCI bridges, such as Skylake and Kabylake. > Otherwise, the PCI AER flood hangs system: > > pcieport 0000:00:1c.5: PCIe Bus Error: severity=Corrected, 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 (First) > pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > pcieport 0000:00:1c.5: AER: Multiple Corrected error received: 0000:00:1c.5 > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=218127 Seemingly, you can use "Link" or "Closes" tag. > Signed-off-by: Jian-Hong Pan <jhp@endlessos.org> Acked-by: Ping-Ke Shih <pkshih@realtek.com> > --- > v2: Add the switch case's default condition with comment: > "The ASPM has already been enabled by initializing > rtl8723be_mod_params' aspm_support as 1." > > .../wireless/realtek/rtlwifi/rtl8723be/sw.c | 24 +++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > index 43b611d5288d..b20c0b9d8393 100644 > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > @@ -25,10 +25,34 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) > { > struct rtl_priv *rtlpriv = rtl_priv(hw); > struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); > + struct pci_dev *bridge_pdev; > > /*close ASPM for AMD defaultly */ > rtlpci->const_amdpci_aspm = 0; > > + /* Disable ASPM if RTL8723BE connects to some Intel PCI bridges, such as > + * Skylake and Kabylake. Otherwise, the PCI AER flood hangs system. > + */ > + bridge_pdev = rtlpci->pdev->bus->self; > + if (bridge_pdev->vendor == PCI_VENDOR_ID_INTEL) { > + switch(bridge_pdev->device) { > + case 0x9d15: > + /* PCI bridges on Skylake */ > + case 0xa110 ... 0xa11f: > + case 0xa167 ... 0xa16a: > + /* PCI bridges on Kabylake */ > + case 0xa290 ... 0xa29f: > + case 0xa2e7 ... 0xa2ee: Out of curiosity, do you have so many real platforms to test?
Ping-Ke Shih <pkshih@realtek.com> 於 2023年11月14日 週二 上午9:41寫道: > > > > > -----Original Message----- > > From: Jian-Hong Pan <jhp@endlessos.org> > > Sent: Monday, November 13, 2023 12:35 PM > > To: Larry Finger <Larry.Finger@lwfinger.net>; Ping-Ke Shih <pkshih@realtek.com> > > Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; > > linux@endlessos.org; Jian-Hong Pan <jhp@endlessos.org> > > Subject: [PATCH v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge > > > > Disable rtl8723be's ASPM if the Realtek RTL8723BE PCIe Wireless adapter > > connects to some Intel PCI bridges, such as Skylake and Kabylake. > > Otherwise, the PCI AER flood hangs system: > > > > pcieport 0000:00:1c.5: PCIe Bus Error: severity=Corrected, 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 (First) > > pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > > pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > > pcieport 0000:00:1c.5: AER: Multiple Corrected error received: 0000:00:1c.5 > > pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > > > > Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=218127 > > Seemingly, you can use "Link" or "Closes" tag. > > > Signed-off-by: Jian-Hong Pan <jhp@endlessos.org> > > Acked-by: Ping-Ke Shih <pkshih@realtek.com> > > > > --- > > v2: Add the switch case's default condition with comment: > > "The ASPM has already been enabled by initializing > > rtl8723be_mod_params' aspm_support as 1." > > > > .../wireless/realtek/rtlwifi/rtl8723be/sw.c | 24 +++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > > b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > > index 43b611d5288d..b20c0b9d8393 100644 > > --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > > +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > > @@ -25,10 +25,34 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) > > { > > struct rtl_priv *rtlpriv = rtl_priv(hw); > > struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); > > + struct pci_dev *bridge_pdev; > > > > /*close ASPM for AMD defaultly */ > > rtlpci->const_amdpci_aspm = 0; > > > > + /* Disable ASPM if RTL8723BE connects to some Intel PCI bridges, such as > > + * Skylake and Kabylake. Otherwise, the PCI AER flood hangs system. > > + */ > > + bridge_pdev = rtlpci->pdev->bus->self; > > + if (bridge_pdev->vendor == PCI_VENDOR_ID_INTEL) { > > + switch(bridge_pdev->device) { > > + case 0x9d15: > > + /* PCI bridges on Skylake */ > > + case 0xa110 ... 0xa11f: > > + case 0xa167 ... 0xa16a: > > + /* PCI bridges on Kabylake */ > > + case 0xa290 ... 0xa29f: > > + case 0xa2e7 ... 0xa2ee: > > Out of curiosity, do you have so many real platforms to test? We have tested those platforms before, because of the hardware enablement. They all have the same error, and the error bothers people many years. https://groups.google.com/g/fa.linux.kernel/c/0uz8Nr_NVOI However, most of them are returned back to the owner now. By accident, we keep the ASUS X555UQ equipped with Intel i7-6500U CPU and Realtek RTL8723BE PCIe Wireless adapter on hands for more test. Jian-Hong Pan
On 11/13/23 22:01, Jian-Hong Pan wrote: > Ping-Ke Shih <pkshih@realtek.com> 於 2023年11月14日 週二 上午9:41寫道: >> >> >>> -----Original Message----- >>> From: Jian-Hong Pan <jhp@endlessos.org> >>> Sent: Monday, November 13, 2023 12:35 PM >>> To: Larry Finger <Larry.Finger@lwfinger.net>; Ping-Ke Shih <pkshih@realtek.com> >>> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; >>> linux@endlessos.org; Jian-Hong Pan <jhp@endlessos.org> >>> Subject: [PATCH v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge >>> >>> Disable rtl8723be's ASPM if the Realtek RTL8723BE PCIe Wireless adapter >>> connects to some Intel PCI bridges, such as Skylake and Kabylake. >>> Otherwise, the PCI AER flood hangs system: >>> >>> pcieport 0000:00:1c.5: PCIe Bus Error: severity=Corrected, 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 (First) >>> pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 >>> pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 >>> pcieport 0000:00:1c.5: AER: Multiple Corrected error received: 0000:00:1c.5 >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 >>> >>> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=218127 >> Seemingly, you can use "Link" or "Closes" tag. >> >>> Signed-off-by: Jian-Hong Pan <jhp@endlessos.org> >> Acked-by: Ping-Ke Shih <pkshih@realtek.com> >> >> >>> --- >>> v2: Add the switch case's default condition with comment: >>> "The ASPM has already been enabled by initializing >>> rtl8723be_mod_params' aspm_support as 1." >>> >>> .../wireless/realtek/rtlwifi/rtl8723be/sw.c | 24 +++++++++++++++++++ >>> 1 file changed, 24 insertions(+) >>> >>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c >>> b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c >>> index 43b611d5288d..b20c0b9d8393 100644 >>> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c >>> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c >>> @@ -25,10 +25,34 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) >>> { >>> struct rtl_priv *rtlpriv = rtl_priv(hw); >>> struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); >>> + struct pci_dev *bridge_pdev; >>> >>> /*close ASPM for AMD defaultly */ >>> rtlpci->const_amdpci_aspm = 0; >>> >>> + /* Disable ASPM if RTL8723BE connects to some Intel PCI bridges, such as >>> + * Skylake and Kabylake. Otherwise, the PCI AER flood hangs system. >>> + */ >>> + bridge_pdev = rtlpci->pdev->bus->self; >>> + if (bridge_pdev->vendor == PCI_VENDOR_ID_INTEL) { >>> + switch(bridge_pdev->device) { >>> + case 0x9d15: >>> + /* PCI bridges on Skylake */ >>> + case 0xa110 ... 0xa11f: >>> + case 0xa167 ... 0xa16a: >>> + /* PCI bridges on Kabylake */ >>> + case 0xa290 ... 0xa29f: >>> + case 0xa2e7 ... 0xa2ee: >> Out of curiosity, do you have so many real platforms to test? > We have tested those platforms before, because of the hardware > enablement. They all have the same error, and the error bothers > people many years. > https://groups.google.com/g/fa.linux.kernel/c/0uz8Nr_NVOI > > However, most of them are returned back to the owner now. By > accident, we keep the ASUS X555UQ equipped with Intel i7-6500U CPU and > Realtek RTL8723BE PCIe Wireless adapter on hands for more test. The device matching that you're doing follows what was also done in commit 7184f5b451cf3dc61de79091d235b5d2bba2782d for an ACS quirk on the same chipsets. I'm just curious if the issue is a more universal Intel one and can/should be resolved with a pci quirk as opposed to inside an individual driver. > > Jian-Hong Pan
Jonathan Bither <jonbither@gmail.com> 於 2023年11月14日 週二 下午11:01寫道: > > > On 11/13/23 22:01, Jian-Hong Pan wrote: > > Ping-Ke Shih <pkshih@realtek.com> 於 2023年11月14日 週二 上午9:41寫道: > >> > >> > >>> -----Original Message----- > >>> From: Jian-Hong Pan <jhp@endlessos.org> > >>> Sent: Monday, November 13, 2023 12:35 PM > >>> To: Larry Finger <Larry.Finger@lwfinger.net>; Ping-Ke Shih <pkshih@realtek.com> > >>> Cc: Kalle Valo <kvalo@kernel.org>; linux-wireless@vger.kernel.org; linux-kernel@vger.kernel.org; > >>> linux@endlessos.org; Jian-Hong Pan <jhp@endlessos.org> > >>> Subject: [PATCH v2] rtlwifi: rtl8723be: Disable ASPM if RTL8723BE connects to Intel PCI bridge > >>> > >>> Disable rtl8723be's ASPM if the Realtek RTL8723BE PCIe Wireless adapter > >>> connects to some Intel PCI bridges, such as Skylake and Kabylake. > >>> Otherwise, the PCI AER flood hangs system: > >>> > >>> pcieport 0000:00:1c.5: PCIe Bus Error: severity=Corrected, 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 (First) > >>> pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > >>> pcieport 0000:00:1c.5: AER: Corrected error received: 0000:00:1c.5 > >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > >>> pcieport 0000:00:1c.5: AER: Multiple Corrected error received: 0000:00:1c.5 > >>> pcieport 0000:00:1c.5: AER: can't find device of ID00e5 > >>> > >>> Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=218127 > >> Seemingly, you can use "Link" or "Closes" tag. > >> > >>> Signed-off-by: Jian-Hong Pan <jhp@endlessos.org> > >> Acked-by: Ping-Ke Shih <pkshih@realtek.com> > >> > >> > >>> --- > >>> v2: Add the switch case's default condition with comment: > >>> "The ASPM has already been enabled by initializing > >>> rtl8723be_mod_params' aspm_support as 1." > >>> > >>> .../wireless/realtek/rtlwifi/rtl8723be/sw.c | 24 +++++++++++++++++++ > >>> 1 file changed, 24 insertions(+) > >>> > >>> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > >>> b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > >>> index 43b611d5288d..b20c0b9d8393 100644 > >>> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > >>> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c > >>> @@ -25,10 +25,34 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) > >>> { > >>> struct rtl_priv *rtlpriv = rtl_priv(hw); > >>> struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); > >>> + struct pci_dev *bridge_pdev; > >>> > >>> /*close ASPM for AMD defaultly */ > >>> rtlpci->const_amdpci_aspm = 0; > >>> > >>> + /* Disable ASPM if RTL8723BE connects to some Intel PCI bridges, such as > >>> + * Skylake and Kabylake. Otherwise, the PCI AER flood hangs system. > >>> + */ > >>> + bridge_pdev = rtlpci->pdev->bus->self; > >>> + if (bridge_pdev->vendor == PCI_VENDOR_ID_INTEL) { > >>> + switch(bridge_pdev->device) { > >>> + case 0x9d15: > >>> + /* PCI bridges on Skylake */ > >>> + case 0xa110 ... 0xa11f: > >>> + case 0xa167 ... 0xa16a: > >>> + /* PCI bridges on Kabylake */ > >>> + case 0xa290 ... 0xa29f: > >>> + case 0xa2e7 ... 0xa2ee: > >> Out of curiosity, do you have so many real platforms to test? > > We have tested those platforms before, because of the hardware > > enablement. They all have the same error, and the error bothers > > people many years. > > https://groups.google.com/g/fa.linux.kernel/c/0uz8Nr_NVOI > > > > However, most of them are returned back to the owner now. By > > accident, we keep the ASUS X555UQ equipped with Intel i7-6500U CPU and > > Realtek RTL8723BE PCIe Wireless adapter on hands for more test. > > The device matching that you're doing follows what was also done in > commit 7184f5b451cf3dc61de79091d235b5d2bba2782d for an ACS quirk on the > same chipsets. > > I'm just curious if the issue is a more universal Intel one and > can/should be resolved with a pci quirk as opposed to inside an > individual driver. Interesting idea. I did some test like: diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c index 43b611d5288d..edb08247760c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c @@ -26,6 +26,10 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); + /* Disable ASPM if the link control disables it */ + if (!pcie_aspm_enabled(rtlpci->pdev)) + rtlpriv->cfg->mod_params->aspm_support = 0; + /*close ASPM for AMD defaultly */ rtlpci->const_amdpci_aspm = 0; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index eeec1d6f9023..239ae945df00 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3606,6 +3606,37 @@ DECLARE_PCI_FIXUP_FINAL(0x1b7c, 0x0004, /* Ceton InfiniTV4 */ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REALTEK, 0x8169, quirk_broken_intx_masking); + +static void quirk_disable_rtl_aspm(struct pci_dev *dev) +{ + struct pci_dev *pdev; + u16 val; + + if (dev->bus && dev->bus->self) + pdev = dev->bus->self; + else + return; + + if (pdev->vendor == PCI_VENDOR_ID_INTEL) { + switch (pdev->device) { + case 0x9d15: + /* PCI bridges on Skylake */ + case 0xa110 ... 0xa11f: + case 0xa167 ... 0xa16a: + /* PCI bridges on Kabylake */ + case 0xa290 ... 0xa29f: + case 0xa2e7 ... 0xa2ee: + pci_info(dev, "quirk: disable the device's ASPM\n"); + pcie_capability_read_word(pdev, PCI_EXP_LNKCTL, &val); + val &= ~PCI_EXP_LNKCTL_ASPMC; + pcie_capability_write_word(dev, PCI_EXP_LNKCTL, val); + break; + } + } +} + +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_REALTEK, 0xb723, quirk_disable_rtl_aspm); + /* * Intel i40e (XL710/X710) 10/20/40GbE NICs all have broken INTx masking, * DisINTx can be set but the interrupt status bit is non-functional. Even quirk_disable_rtl_aspm() disables the PCIe's ASPM in Link Control and Status Register, we still have to clear the aspm_support in rtl8723be module. Otherwise, the PCIe's ASPM will be enabled again, then the AER flood comes again. If the rtl8723be module should check the PCIe's ASPM feature first generally, then using the PCI quirk way is feasible. Ping-Ke Shih, any suggestion? If this is a better approach, I can prepare a new version patch. Jian-Hong Pan
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c index 43b611d5288d..b20c0b9d8393 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8723be/sw.c @@ -25,10 +25,34 @@ static void rtl8723be_init_aspm_vars(struct ieee80211_hw *hw) { struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); + struct pci_dev *bridge_pdev; /*close ASPM for AMD defaultly */ rtlpci->const_amdpci_aspm = 0; + /* Disable ASPM if RTL8723BE connects to some Intel PCI bridges, such as + * Skylake and Kabylake. Otherwise, the PCI AER flood hangs system. + */ + bridge_pdev = rtlpci->pdev->bus->self; + if (bridge_pdev->vendor == PCI_VENDOR_ID_INTEL) { + switch(bridge_pdev->device) { + case 0x9d15: + /* PCI bridges on Skylake */ + case 0xa110 ... 0xa11f: + case 0xa167 ... 0xa16a: + /* PCI bridges on Kabylake */ + case 0xa290 ... 0xa29f: + case 0xa2e7 ... 0xa2ee: + rtlpriv->cfg->mod_params->aspm_support = 0; + break; + default: + /* The ASPM has already been enabled by initializing + * rtl8723be_mod_params' aspm_support as 1. + */ + break; + } + } + /* ASPM PS mode. * 0 - Disable ASPM, * 1 - Enable ASPM without Clock Req,