Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3685022rdg; Wed, 18 Oct 2023 03:06:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGtrhDhYloKbrX1D75JCORTtH1XKRyYyqHUHlQV1WVgCisp832L9zntK0pmdXPbuaPB5TnW X-Received: by 2002:aca:2317:0:b0:3ae:5c48:6f41 with SMTP id e23-20020aca2317000000b003ae5c486f41mr4711098oie.28.1697623575850; Wed, 18 Oct 2023 03:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697623575; cv=none; d=google.com; s=arc-20160816; b=kh0T4fprP6b508xYN4o0NkhOnsX4Y9bZ19UxM0SG8lRCyoyoGaORSETOq2KZ/hj+I6 G4MFlucV3MrTiFCM/6lXUoYQy/cxGq4GO8HjtwIX+LXRhKBrwVC4cVvBf8D9V8uNzPNf r4PV4ctAVNudqwy1UZOCung1F2j+Z4XLWsbK315j9qxxjhtNuyZY4NH25cc0Wx11ewmQ u29tgaqusfrobekrWyAr8TBdhZM3PxftFhbV4iU275DLBrvviu5ts5s7BQoRFpnKMcsj enLEpn0IC4sbDVLLLJDgzA49sD75vCH+R1qNeKstW7PyIeVlhKB7+EehfYfsdo/teOT7 6cLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=tdlcSktSRSHArPajPsys/vHJvl4EcUiEhw2MBXd54bk=; fh=QqDOBK5N7mIyMVGskvnpZW9KBmRbRhYKYgDGlV/3hLg=; b=fnJCuFETybxTonTZiZbJDAFPIBCxN4ys8AkHX5SSwwrKxMxfNn/24a3tvTjoNfFqUu UalbAiVYJ26cRaBUDgYkVnZ+RbmVVZmE9iMpXJ2XmuED+IoS+FCGCF/xCvm2sJsvOy+3 eGgS6C1FZOwJuhyjawLH+1AsF7X5Y4hjV0O3WBEL0roMdrulE8IcezDxWL6WQJ71I315 oGoG21n6Xgr2SS3fj87erKTFvl5BVhvarBzn/2kVR8k/gEt/yFvvnsiGVb0iHrCYd9F0 93FBTFAKhGvgagZPdBOkjOxuXk+P0280gH+fIY5zz4xyRydIfJLKzj2uX7Ub2BQtFTzR +5sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eE56ymFo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id x29-20020a056a00189d00b006be25c80c8fsi3707007pfh.267.2023.10.18.03.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 03:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eE56ymFo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0EB8280BD77C; Wed, 18 Oct 2023 03:06:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbjJRKF6 (ORCPT + 99 others); Wed, 18 Oct 2023 06:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229552AbjJRKF5 (ORCPT ); Wed, 18 Oct 2023 06:05:57 -0400 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E91795; Wed, 18 Oct 2023 03:05:54 -0700 (PDT) Received: by mail-ua1-x933.google.com with SMTP id a1e0cc1a2514c-7b64810aebdso1895558241.2; Wed, 18 Oct 2023 03:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697623553; x=1698228353; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tdlcSktSRSHArPajPsys/vHJvl4EcUiEhw2MBXd54bk=; b=eE56ymFoimrfqyR1lO4pc19NTSQC5YhxT8ZT+EtvpzA/LY6DvhteilVsJ1/m054R+H BlGssjFqy/jjnxvKfnp+nPcp17MZdbDKd8ZxKG7ONHlBzBcfYruUdbI2KZD9eK5gtWSD YTuMxa3VHllYOSbPW3iRrTAdirjURVelixoqhHOxD19qQ9TFUyx2wKemdvxKpI0X8oZm /QT7PXph0Y/ypLAlfWd/HmUIBiwhna1h2hJEEobDD1Uy40kX/fkyaIWReUbZmYsp2Wq6 7iQLBUWRcLn4qg7OBhV5WeIxzlGEJOYTEb/rhrsOmE1PmDPsc4PMxbvNOMtijcEjEbFL 88Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697623553; x=1698228353; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tdlcSktSRSHArPajPsys/vHJvl4EcUiEhw2MBXd54bk=; b=KJlftjUVLQo45XXKw9Ji7sH35zgOA06Zw6/DtN3rEU1nfS/jaUCjaOnwrh415vbtWC jF3DECL7fhdUAQwGfbTzVLpg+lz921wEuMlHWNyIxkEg+KhNRmps2so3H4+orU9Pe4dk vz3IXkdCdDFzxl/PCCqg7zHWmKaBEMK3U3UTtnTGtGKS91nPCzr4o5GNHVPGmTrmVQiG Z9IqWvuQ9tAS4BhovMa6OM5FWTGSTqA6XmBzSSD4YVvzHqYNywsnexA/ppurlUQdi6U/ hAbBglxI1cDVIf0U4zAKVqiza58pd5t6wvCVWDx69eo73dLSkCfRE5DUXOLWFpcYb2qU VRbw== X-Gm-Message-State: AOJu0YyBpDoNg9B41KFm+ZQeRWInRxsS86aS+9Gt+/yoNowrwnuCKweC r9GrVbA/nrBlBI6vtg3sF3L+gEiXJyYdrzd5poo= X-Received: by 2002:a05:6102:2051:b0:457:c650:b810 with SMTP id q17-20020a056102205100b00457c650b810mr5179775vsr.8.1697623553137; Wed, 18 Oct 2023 03:05:53 -0700 (PDT) MIME-Version: 1.0 References: <20230918103055.5471-1-victorshihgli@gmail.com> In-Reply-To: From: Victor Shih Date: Wed, 18 Oct 2023 18:05:40 +0800 Message-ID: Subject: Re: [PATCH V1] mmc: sdhci-pci-gli: GL975[05]: Mask the replay timer timeout of AER To: Kai-Heng Feng Cc: ulf.hansson@linaro.org, adrian.hunter@intel.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, benchuanggli@gmail.com, HL.Liu@genesyslogic.com.tw, Greg.tu@genesyslogic.com.tw, kangzhen.lou@dell.com, Victor Shih Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 03:06:12 -0700 (PDT) On Wed, Oct 11, 2023 at 2:35=E2=80=AFPM Kai-Heng Feng wrote: > > On Fri, Oct 6, 2023 at 6:30=E2=80=AFPM Victor Shih wrote: > > > > On Mon, Oct 2, 2023 at 10:18=E2=80=AFAM Kai-Heng Feng > > wrote: > > > > > > Hi Victor, > > > > > > On Tue, Sep 26, 2023 at 4:21=E2=80=AFPM Victor Shih wrote: > > > > > > > > On Fri, Sep 22, 2023 at 3:11=E2=80=AFPM Kai-Heng Feng > > > > wrote: > > > > > > > > > > Hi Victor, > > > > > > > > > > On Wed, Sep 20, 2023 at 4:54=E2=80=AFPM Victor Shih wrote: > > > > > > > > > > > > On Tue, Sep 19, 2023 at 3:31=E2=80=AFPM Kai-Heng Feng > > > > > > wrote: > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > On Tue, Sep 19, 2023 at 3:10=E2=80=AFPM Victor Shih wrote: > > > > > > > > > > > > > > > > On Tue, Sep 19, 2023 at 12:24=E2=80=AFPM Kai-Heng Feng > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31=E2=80=AFPM Victor Shih wrote: > > > > > > > > > > > > > > > > > > > > From: Victor Shih > > > > > > > > > > > > > > > > > > > > Due to a flaw in the hardware design, the GL975x replay= timer frequently > > > > > > > > > > times out when ASPM is enabled. As a result, the system= will resume > > > > > > > > > > immediately when it enters suspend. Therefore, the repl= ay timer > > > > > > > > > > timeout must be masked. > > > > > > > > > > > > > > > > > > This patch solves AER error when its PCI config gets acce= ssed, but the > > > > > > > > > AER still happens at system suspend: > > > > > > > > > > > > > > > > > > [ 1100.103603] ACPI: EC: interrupt blocked > > > > > > > > > [ 1100.268244] ACPI: EC: interrupt unblocked > > > > > > > > > [ 1100.326960] pcieport 0000:00:1c.0: AER: Corrected erro= r received: > > > > > > > > > 0000:00:1c.0 > > > > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > > > > severity=3DCorrected, type=3DData Link Layer, (Transmitte= r ID) > > > > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9= ] error > > > > > > > > > status/mask=3D00001000/00002000 > > > > > > > > > [ 1100.326996] pcieport 0000:00:1c.0: [12] Timeout > > > > > > > > > > > > > > > > > > Kai-Heng > > > > > > > > > > > > > > > > > > > > > > > > > Hi, Kai-Heng > > > > > > > > > > > > > > > > Could you try applying the patch and re-testing again after= restarting > > > > > > > > the system? > > > > > > > > > > > > > > Same issue happens after coldboot. > > > > > > > > > > > > > > > Because I applied the patch and restarted the system and it= didn't happen. > > > > > > > > The system can enter suspend normally. > > > > > > > > > > > > > > > > If you still have the issue after following the above instr= uctions, > > > > > > > > please provide me with your environment and I will verify i= t again. > > > > > > > > > > > > > > The patch gets applied on top of next-20230918. Please let me= know > > > > > > > what else you want to know. > > > > > > > > > > > > > > Kai-Heng > > > > > > > > > > > > > > > > > > > Hi, Kai-Heng > > > > > > > > > > > > If I want to mask the replay timer timeout AER of the upper lay= er root port, > > > > > > could you give me some suggestions? > > > > > > Or could you provide sample code for my reference? > > > > > > > > > > I am not aware of anyway to mask "replay timer timeout" from root= port. > > > > > I wonder if the device supoprt D3hot? Or should it stay at D0 whe= n > > > > > ASPM L1.2 is enabled? > > > > > > > > > > Kai-Heng > > > > > > > > > > > > > Hi, Kai-Heng > > > > > > > > Do you know any way to mask the replay timer timeout AER of the > > > > upstream port from the device? > > > > > > Per PCIe Spec, I don't think it's possible to only mask 'replay timer= timeout'. > > > > > > > The device supports D3hot. > > > > > > Do you think such error plays any crucial rule? Otherwise disable > > > 'correctable' errors may be plausible. > > > > > > Kai-Heng > > > > > > > Hi, Kai-Heng > > > > Due to a flaw in the hardware design, the GL975x replay timer frequentl= y > > times out when ASPM is enabled. > > This patch solves the AER error of the replay timer timeout for GL975x. > > We have not encountered any other errors so far. > > On the system I tested, this patch reduces the occurrence of the > error, but not completely eliminated. > > > Does your 'correctable' errors mean the AER error of the replay timer t= imeout? > > May I ask if you have any other comments on this patch? > > Spamming `lspci -vv -s` on the device can still observe the AER error. > > I think the "correctable" mask should be optional, let me send a patch > to PCI for comment. > > Kai-Heng > Hi, Kai-Heng As we discussed in another email, if you want to solve the issue of suspens= ion, you only need masking the replay timer timeout on its root port. I haven't seen the PCI patch you submitted yet. If you provide me with the PCI patch, I can help you test it. This patch only solves the warning messages that will often appear in the system log when the system accesses the GL975x PCI config. Therefore, I will revise the commit message and submit the V2 version. Thanks, Victor Shih > > > > Thanks, Victor Shih > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Victor Shih > > > > > > > > > > --- > > > > > > > > > > drivers/mmc/host/sdhci-pci-gli.c | 16 ++++++++++++++++ > > > > > > > > > > 1 file changed, 16 insertions(+) > > > > > > > > > > > > > > > > > > > > diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers= /mmc/host/sdhci-pci-gli.c > > > > > > > > > > index d83261e857a5..d8a991b349a8 100644 > > > > > > > > > > --- a/drivers/mmc/host/sdhci-pci-gli.c > > > > > > > > > > +++ b/drivers/mmc/host/sdhci-pci-gli.c > > > > > > > > > > @@ -28,6 +28,9 @@ > > > > > > > > > > #define PCI_GLI_9750_PM_CTRL 0xFC > > > > > > > > > > #define PCI_GLI_9750_PM_STATE GENMASK(1, 0) > > > > > > > > > > > > > > > > > > > > +#define PCI_GLI_9750_CORRERR_MASK = 0x214 > > > > > > > > > > +#define PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEO= UT BIT(12) > > > > > > > > > > + > > > > > > > > > > #define SDHCI_GLI_9750_CFG2 0x848 > > > > > > > > > > #define SDHCI_GLI_9750_CFG2_L1DLY GENMASK(28, 24) > > > > > > > > > > #define GLI_9750_CFG2_L1DLY_VALUE 0x1F > > > > > > > > > > @@ -152,6 +155,9 @@ > > > > > > > > > > #define PCI_GLI_9755_PM_CTRL 0xFC > > > > > > > > > > #define PCI_GLI_9755_PM_STATE GENMASK(1, 0) > > > > > > > > > > > > > > > > > > > > +#define PCI_GLI_9755_CORRERR_MASK = 0x214 > > > > > > > > > > +#define PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEO= UT BIT(12) > > > > > > > > > > + > > > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE = 0x510 > > > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET = BIT(8) > > > > > > > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(stru= ct sdhci_host *host) > > > > > > > > > > value &=3D ~PCI_GLI_9750_PM_STATE; > > > > > > > > > > pci_write_config_dword(pdev, PCI_GLI_9750_PM_CT= RL, value); > > > > > > > > > > > > > > > > > > > > + /* mask the replay timer timeout of AER */ > > > > > > > > > > + pci_read_config_dword(pdev, PCI_GLI_9750_CORRER= R_MASK, &value); > > > > > > > > > > + value |=3D PCI_GLI_9750_CORRERR_MASK_REPLAY_TIM= ER_TIMEOUT; > > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRE= RR_MASK, value); > > > > > > > > > > + > > > > > > > > > > gl9750_wt_off(host); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(stru= ct sdhci_pci_slot *slot) > > > > > > > > > > value &=3D ~PCI_GLI_9755_PM_STATE; > > > > > > > > > > pci_write_config_dword(pdev, PCI_GLI_9755_PM_CT= RL, value); > > > > > > > > > > > > > > > > > > > > + /* mask the replay timer timeout of AER */ > > > > > > > > > > + pci_read_config_dword(pdev, PCI_GLI_9755_CORRER= R_MASK, &value); > > > > > > > > > > + value |=3D PCI_GLI_9755_CORRERR_MASK_REPLAY_TIM= ER_TIMEOUT; > > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRE= RR_MASK, value); > > > > > > > > > > + > > > > > > > > > > gl9755_wt_off(pdev); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > 2.25.1 > > > > > > > > > >