From patchwork Mon Nov 13 04:34:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jian-Hong Pan X-Patchwork-Id: 164349 Return-Path: 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 + 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 ); 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 ; Sun, 12 Nov 2023 20:37:10 -0800 (PST) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1cc0d0a0355so28030105ad.3 for ; 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 To: Larry Finger , Ping-Ke Shih Cc: Kalle Valo , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux@endlessos.org, Jian-Hong Pan 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 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: 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 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 Acked-by: Ping-Ke Shih --- 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: + 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,