Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp282978rdb; Fri, 6 Oct 2023 03:30:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmn67gAHo5jw9bEx1bkaw4+AWiVjmGQvXrKv62gnM3aDCmdXcNMovsfKkAOdV5VFTb8ZCj X-Received: by 2002:a05:6358:5e0f:b0:142:fd2b:da2e with SMTP id q15-20020a0563585e0f00b00142fd2bda2emr7373565rwn.31.1696588241993; Fri, 06 Oct 2023 03:30:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696588241; cv=none; d=google.com; s=arc-20160816; b=K+/6bDtX19CM82y38oYRLwWjF4pFYJNqyiJizxNE4MOZK/GUgn7wGfuM/rHUhQrfqy eqGnQXu+BzU3fKIdoDFRlEu2Lzo+tcx8ajqKrlPtnotzH0pxmha/f+CvVCREu4RbsxzV VvEgMApDUndSAWKZ7SfSahGx7YTQCjFF5wayf1EC8k1JcdOPFzAlqHY3Y1Rj9EhAvEMz rG7KSwiQdqBn3DzYrkhRZDD8QJhEEoyoenZTcLMKII/coL/RkYA1cJpgTaO6ffbvLoqd SZ+UwHMDdVthFVJvQHNheilItnof3q0byIFKVjIjFRpxvqwqInYkfbOJIBGSlPjHVSsJ uXnQ== 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=blEZscFcgy/Pf7C3AmtaKvEya+48OGSVdWrJtz/KTDU=; fh=QqDOBK5N7mIyMVGskvnpZW9KBmRbRhYKYgDGlV/3hLg=; b=pZhxUEUZ6qapu+P7c6NGgPfJf/BJs8P/yx7FHSbfK9YAg1ZcmtIIX5lKecYHOZbJgb pvhJReZrnyZyviSW0fGM9K+TnFc5UP7iAlVlPI/xMYaUmBGFvWSRBPjj8uxnDYtXJlyz d23crooP1Tg9HB9tubGoc2CbYo/RznHeBJA9uFMQ3ZhrrZMKj+FBaNgKqxgVLVmhU8DF X2lAQhVrBjaS0jte9QBUItq32KBR9q/+D2ZINd9jGc3CTPEdilQgM8bdl4hKs6L75UJO aSQ/EMy8YX3VlcJXhVyEDrurM5TI/RqnTrhzHmJngNbxgqArTftns8Ft1yoMPIF0YhP/ hVXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eTXdDXxq; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id r37-20020a635165000000b0055e607f1e99si3324242pgl.882.2023.10.06.03.30.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 03:30:41 -0700 (PDT) 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=@gmail.com header.s=20230601 header.b=eTXdDXxq; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 385DD8038B1A; Fri, 6 Oct 2023 03:30:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231721AbjJFKa2 (ORCPT + 99 others); Fri, 6 Oct 2023 06:30:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbjJFKa1 (ORCPT ); Fri, 6 Oct 2023 06:30:27 -0400 Received: from mail-vk1-xa35.google.com (mail-vk1-xa35.google.com [IPv6:2607:f8b0:4864:20::a35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40249E4; Fri, 6 Oct 2023 03:30:24 -0700 (PDT) Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-49d0f24a815so782709e0c.2; Fri, 06 Oct 2023 03:30:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696588223; x=1697193023; 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=blEZscFcgy/Pf7C3AmtaKvEya+48OGSVdWrJtz/KTDU=; b=eTXdDXxqVzzdSJy8ldk6eauPMFg5ahiXt8RNqsAwAYq7ZLgmDly1zGYB13mkeraGC4 ETH88q1EcHoKax2omvC3eqV/iMVvBe6uVfCFLHxVr1m+Mwyt6s4I2OE09trgJT/qJHxa mWP32evSUdhnPqk72yUakRxARo+uBTr6F+OJaCweUlZa/OuGIggmAHd0n9lMJ5OZz3bW eIOO4PgrzpdxIU/CWuejhCxVVMuNDzZRxnU4MIU67bkvuv57yzd3eHut2ZfWEQPuOz/R uJGm8Jmag7TwIh54GGWDzWlWESO4uDtlZzCeha0UKzN2Di6BELaaI/dLhNgE2xZIEYeb O9TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696588223; x=1697193023; 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=blEZscFcgy/Pf7C3AmtaKvEya+48OGSVdWrJtz/KTDU=; b=DVJ2HTCuoVO8vQIdW+EHevSz5uTN2b2MYrzqEIW/Ey/KKx1Ed9ZGiJ4VxE6wwPa2DZ stx7iqru1zVpATBidOw0DeHM/upYfQEMeqvkTG+mAucS8KPSvRMsBi3bFIhMHho6gAd9 WC57q3RAVPrp8k03ekMvEt7L9Xzs1dXMSCTTwTU0eucNDGgrdbD6oFKn6AVy8KnOwZ2I ELROI6Cv8fE6q8KaCXqia7xPlqbjxblPwD3K/gM6wH4GZbzmPbgc4umHxSbAJ8Y0wJxJ XR71NthSZnCOFZx6obRnVwiPxVptXuJZ3wzvFXhsKmVjTMGoyoflNegrqDLqsyY/iP9H SpUQ== X-Gm-Message-State: AOJu0YwP/dHohQAUZg6nxK0BfZnMAZt7835HnSmO4LZNuuMLCL+M6EAy HdXRNayWB1M5HHdR+lccL73eWjQzpubaHaZY+8M= X-Received: by 2002:a1f:4887:0:b0:493:3491:ce89 with SMTP id v129-20020a1f4887000000b004933491ce89mr5920840vka.14.1696588223186; Fri, 06 Oct 2023 03:30:23 -0700 (PDT) MIME-Version: 1.0 References: <20230918103055.5471-1-victorshihgli@gmail.com> In-Reply-To: From: Victor Shih Date: Fri, 6 Oct 2023 18:30:08 +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=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Fri, 06 Oct 2023 03:30:39 -0700 (PDT) X-Spam-Level: ** 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 tim= er frequently > > > > > > > > times out when ASPM is enabled. As a result, the system wil= l resume > > > > > > > > immediately when it enters suspend. Therefore, the replay t= imer > > > > > > > > timeout must be masked. > > > > > > > > > > > > > > This patch solves AER error when its PCI config gets accessed= , 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 error re= ceived: > > > > > > > 0000:00:1c.0 > > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > > severity=3DCorrected, type=3DData Link Layer, (Transmitter ID= ) > > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] er= ror > > > > > > > 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 res= tarting > > > > > > the system? > > > > > > > > > > Same issue happens after coldboot. > > > > > > > > > > > Because I applied the patch and restarted the system and it did= n't happen. > > > > > > The system can enter suspend normally. > > > > > > > > > > > > If you still have the issue after following the above instructi= ons, > > > > > > please provide me with your environment and I will verify it ag= ain. > > > > > > > > > > The patch gets applied on top of next-20230918. Please let me kno= w > > > > > what else you want to know. > > > > > > > > > > Kai-Heng > > > > > > > > > > > > > Hi, Kai-Heng > > > > > > > > If I want to mask the replay timer timeout AER of the upper layer r= oot 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 por= t. > > > I wonder if the device supoprt D3hot? Or should it stay at D0 when > > > 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 tim= eout'. > > > 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 frequently 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. Does your 'correctable' errors mean the AER error of the replay timer timeo= ut? May I ask if you have any other comments on this patch? 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_TIMEOUT = 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_TIMEOUT = BIT(12) > > > > > > > > + > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE 0x5= 10 > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET B= IT(8) > > > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct s= dhci_host *host) > > > > > > > > value &=3D ~PCI_GLI_9750_PM_STATE; > > > > > > > > pci_write_config_dword(pdev, PCI_GLI_9750_PM_CTRL, = value); > > > > > > > > > > > > > > > > + /* mask the replay timer timeout of AER */ > > > > > > > > + pci_read_config_dword(pdev, PCI_GLI_9750_CORRERR_MA= SK, &value); > > > > > > > > + value |=3D PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_T= IMEOUT; > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_M= ASK, value); > > > > > > > > + > > > > > > > > gl9750_wt_off(host); > > > > > > > > } > > > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct s= dhci_pci_slot *slot) > > > > > > > > value &=3D ~PCI_GLI_9755_PM_STATE; > > > > > > > > pci_write_config_dword(pdev, PCI_GLI_9755_PM_CTRL, = value); > > > > > > > > > > > > > > > > + /* mask the replay timer timeout of AER */ > > > > > > > > + pci_read_config_dword(pdev, PCI_GLI_9755_CORRERR_MA= SK, &value); > > > > > > > > + value |=3D PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_T= IMEOUT; > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_M= ASK, value); > > > > > > > > + > > > > > > > > gl9755_wt_off(pdev); > > > > > > > > } > > > > > > > > > > > > > > > > -- > > > > > > > > 2.25.1 > > > > > > > >