Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp126357lqo; Wed, 27 Mar 2024 08:35:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZMLWbf1C/oYMQuleWXD5pt0ZAdmp5KuvpScwxsYAiS7GCViezIBBqEEoUCJ6uO9+N7vcCPk+E3DtSLeeYmArLl1UbqwbcTTKHxQLDOQ== X-Google-Smtp-Source: AGHT+IHcUCQ9puoLrn2Thg8+fECHfapXClEsa7gyyp26hINzaueQfSOrY6sA7uNptLbPwaDakbD1 X-Received: by 2002:a05:6a00:1813:b0:6ea:afd1:9023 with SMTP id y19-20020a056a00181300b006eaafd19023mr244750pfa.0.1711553746417; Wed, 27 Mar 2024 08:35:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711553746; cv=pass; d=google.com; s=arc-20160816; b=ftdk1cf3bd+uWxPVetxfEUPgFEMNsqM+RDSu6E5lqS5JWOZcVNIrshNbwE1fXuu/4k q4rzxbz6/WAKFP/SPdBmM/0KH14hAMYvW8ZzNJqfNdQxtUc600s5GV7lcA8IXGnM+3Ke Rup2DKDY9Tzv78hMmqfnsQWLqixw9E1/usTxHgFvsPO9B4E7lnZMT/HZ6fnduyCPnbLp zAPu1kDADl/1EbCXPgJvS9uniTrN7AUcbEoGeGJp+Qs+xOg3nL+WWVl7Oi8F6Nj27LZf EXLEfqNejKQ7Fzh2T8ac8UxkBHO8TYq4Dwi149IJyZikJVUnbhn4c/r3K0RGgZybAGyu odZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=2m/95HZN21pdueY3jkG2GCeIIeuGLNHzrUPt0uZOFoc=; fh=mfm33SpsnRImZc4al7lqg6HpVCXAk1UIwArKbOlC9jw=; b=MZqNBgbOb82ymB3xkCBOueLQqxmOknenSMb2cMEh9bSIxoq/4KNM8DAIusr7yHm7II +a23fUnc/LvEQ8yt/My+nT6f2yBNZWXvKUQod3unX6qFh8AF2E/lCsqg9wqwKHWBjgYH Z18t9Wu/lf3Qpz/cECx64TXuXhArrl1Kq8WIQTQGnCXCQB6V5TU9CZlxBXlm9OhFQC2F C78XJE8t2s/x6W2PZjqsvCoUhvfKdOtK9OcRAdZXCkTD1JW1daUC8z+Qv2LyLcwdQSgE 7ACSffFysp7tEnE6kpf7swNEqjBv7Zwsl2xEE4tj2R8JS34UmDZ+x+RA0l8FI0jINH6i lVdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O4I/BuHF"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d28-20020a630e1c000000b005dc484bc9efsi11381311pgl.22.2024.03.27.08.35.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O4I/BuHF"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-121494-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121494-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 99D8A307FF3 for ; Wed, 27 Mar 2024 15:27:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFC3A524A3; Wed, 27 Mar 2024 15:23:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O4I/BuHF" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 01D822557E; Wed, 27 Mar 2024 15:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553012; cv=none; b=VEn40nRgzcESJz/j5jJ+We94A+eJq7La4I8BgNLcKcboeuy7OSwX1QfHvoWNFXnFjnAGDn88xEEm23AXbTiPn2g5Uf7Fap2XEkKGiTSoZCQnu9WyOLCF0I6qmqzxCVY1mFBuPZ6V+AhWkGI788I43DSJhZq0Z10FH0uuApekn98= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553012; c=relaxed/simple; bh=rMv9zxTLOc2gGvdPWGvZBa+aQKrI/aFqAI1di8hyPQw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=idO9ycIoWQ2HzKMYsekE8aBNp/aPYjirj4H/K7o0i3yTzQ500KA8HX2xG4HMbZb59K+ybOk3VW/Zekd71YTNGeyE/6NTtWQd25EbKWljv/EImkEd4Ol5pQ+PpKmEs/sXcBT4unxuIRxVOmSljpwRTIVDMrvHCF+I7HA46sH5+sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O4I/BuHF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91063C433A6; Wed, 27 Mar 2024 15:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711553011; bh=rMv9zxTLOc2gGvdPWGvZBa+aQKrI/aFqAI1di8hyPQw=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=O4I/BuHF490WGur6hj5s8qbEij6Vu/xefRx3Pyhni6+LsfYGaZfW3nPTgP0r7OM6A 4nMvSHfuaGAJYusAVP4Nlohpk+FgMGiFegJX7o1dEDkcRSJqnoTHZJ5YUZ+pTXpzh6 aU5D+Ql/lbKdFFRdw/x4Was5dUMa0oSJ5mcZ5lFcfy5R5ufKGcmvOoUkcxJBKv48uL pqWsWxPw+KPEYpQKC2dpv+1rSBqAnaCpJePtwyOjtXouLguEM684QgLpFLS+hpvt9P WBYTKlV2tJ5m256ffDvs0Mw50yTMAALhp+W6H9b63vY2N0hqA8sypxb2NywF96YlEZ 8lTlFNZdhpF1A== Date: Wed, 27 Mar 2024 10:23:29 -0500 From: Bjorn Helgaas To: Kai-Heng Feng Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Victor Shih , Ben Chuang Subject: Re: [PATCH v3] PCI: Mask replay timer timeout of GL975x's rootport Message-ID: <20240327152329.GA1523226@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240327024509.1071189-1-kai.heng.feng@canonical.com> On Wed, Mar 27, 2024 at 10:45:09AM +0800, Kai-Heng Feng wrote: > Any access to GL975x's config space, like `lspci -vv` or > pci_save_state(), can still trigger the replay timer timeout error even > after commit 015c9cbcf0ad ("mmc: sdhci-pci-gli: GL9750: Mask the replay > timer timeout of AER"), albeit with a lower reproduce rate. > > The AER interrupt can prevent the system from suspending, or can flood > the kernel message. So mask the replay timer timeout to resolve the > issue. > > Cc: Victor Shih > Cc: Ben Chuang > Signed-off-by: Kai-Heng Feng Applied as below to pci/aer for v6.10, thanks! commit eeee3b5e6d0b ("PCI: Mask Replay Timer Timeout errors for Genesys GL975x SD host controller") Author: Kai-Heng Feng Date: Wed Mar 27 10:45:09 2024 +0800 PCI: Mask Replay Timer Timeout errors for Genesys GL975x SD host controller Due to a hardware defect in GL975x, config accesses when ASPM is enabled frequently cause Replay Timer Timeouts in the Port leading to the device. These are Correctable Errors, so the Downstream Port logs it in its AER Correctable Error Status register and, when the error is not masked, sends an ERR_COR message upstream. The message terminates at a Root Port, which may generate an AER interrupt so the OS can log it. The Correctable Error logging is an annoyance but not a major issue itself. But when the AER interrupt happens during suspend, it can prevent the system from suspending. 015c9cbcf0ad ("mmc: sdhci-pci-gli: GL9750: Mask the replay timer timeout of AER") masked these errors in the GL975x itself. Mask these errors in the Port leading to GL975x as well. Note that Replay Timer Timeouts will still be logged in the AER Correctable Error Status register, but they will not cause AER interrupts. Link: https://lore.kernel.org/r/20240327024509.1071189-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng [bhelgaas: commit log, update dmesg note] Signed-off-by: Bjorn Helgaas Cc: Victor Shih Cc: Ben Chuang diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index bf4833221816..5cb0f7fae3b8 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -6261,3 +6261,23 @@ static void pci_fixup_d3cold_delay_1sec(struct pci_dev *pdev) pdev->d3cold_delay = 1000; } DECLARE_PCI_FIXUP_FINAL(0x5555, 0x0004, pci_fixup_d3cold_delay_1sec); + +#ifdef CONFIG_PCIEAER +static void pci_mask_replay_timer_timeout(struct pci_dev *pdev) +{ + struct pci_dev *parent = pci_upstream_bridge(pdev); + u32 val; + + if (!parent || !parent->aer_cap) + return; + + pci_info(parent, "mask Replay Timer Timeout Correctable Errors due to %s hardware defect", + pci_name(pdev)); + + pci_read_config_dword(parent, parent->aer_cap + PCI_ERR_COR_MASK, &val); + val |= PCI_ERR_COR_REP_TIMER; + pci_write_config_dword(parent, parent->aer_cap + PCI_ERR_COR_MASK, val); +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9750, pci_mask_replay_timer_timeout); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_GLI, 0x9755, pci_mask_replay_timer_timeout); +#endif