Message ID | 20230918103055.5471-1-victorshihgli@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp2938415vqi; Mon, 18 Sep 2023 13:37:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG1wm/SCay96P4lIjjoQXhHE1LuWX/+Pun9FQcvkfSKkr+ZMBFe6gtc86yrQtezhjwMmL0z X-Received: by 2002:a17:902:e54c:b0:1bf:2e5c:7367 with SMTP id n12-20020a170902e54c00b001bf2e5c7367mr12368572plf.42.1695069478298; Mon, 18 Sep 2023 13:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695069478; cv=none; d=google.com; s=arc-20160816; b=F/dupv6JOalfml0FWagAqG4q43wdVQGo3xn9uAC3pdIJ1DqQb4gyCyMxcGYLbq/tyd 3uUMnU+BXOcnZ4D0cCi+4LJoPBqo8FYrRpLX5UHQirHb2ZxsrAK6tEFY4E2q0eeJ+0xF jS8yvL/TUjoCs5ZbaVqDzNqs11HEue6DKoPmTAIms2SvnICzjq9uF37rXbtwiZaE4Wnm DLUocxsGZZXZ+f1+i8Vr1OOAiGDJaOYbu41mIbj1uc1dCsahd2sTE1lbwh99qWNZFDdK m9dW+k64vW8S/EQt5GRgEtDuyXj1naSl1pFN1NqdC2CG7HWTCDwQ9p9hlyYb5MzEo1Cv ZSJw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=QLJZOub4/BAt+7IdwydIQJYY2CoSBI6D30tEHY6X3RQ=; fh=OTUrbQP0s3S/kW502z6Ti3fUHA4zpHu/VcYFaJiaIP8=; b=rXa8LHvQ7R6LjDi65FZLq5qmuIBKVduUzpc8lVI7DF+njfT+fbOiL5OpGZhTVuhedx aRg5NYjqvwA2rlCw9IhfGaYk+78QXOToRA78adi4ZcHHKBHADx8DiBLiOz6DTuv5bwiL DTzJ5OQivHfGZE0UiK95Ga1u+uOlr42vzGjkVtiOIUjYOlZFXdktDnksPiPwL2L/zW/Q QgEzxeuXPa4R0lwxBcVBAzWlnRSJe63D7/32xNhPEQxhLcNxQVh32HiXjjIb0++JgK+P nMcn85CeDKTHUWm+wG2BP3SKa97hItoh1nC7IDj6BNxIMz4Oz0wWiDzqrBoerBGEeKQA DvEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h+eH0bWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id b11-20020a170902d50b00b001c1e1fe16cbsi4371950plg.255.2023.09.18.13.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=h+eH0bWo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 46845804C4A0; Mon, 18 Sep 2023 03:32:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241013AbjIRKbY (ORCPT <rfc822;kernel.ruili@gmail.com> + 27 others); Mon, 18 Sep 2023 06:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241354AbjIRKbO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 06:31:14 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F33D8; Mon, 18 Sep 2023 03:31:05 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68fb6fd2836so4017759b3a.0; Mon, 18 Sep 2023 03:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695033065; x=1695637865; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QLJZOub4/BAt+7IdwydIQJYY2CoSBI6D30tEHY6X3RQ=; b=h+eH0bWoHTaoVPU6K6DN3xfxwyjiDF/Ea/f/NoeGPSlCf77uz4OF7CmxA0C/Np9D/m tGTu9zQjinJN7BjHrEm+BxY8zPhG9hKPJc621cWKWhua/JA2kPM4Qr+zMGr4T3Dbbjnp LA+Cljb8nqKPiKVvrP2tWMMjRv9dZXmqrNU12f3flRuMvPnrb0s/2rLHoVHJ5BvFBaq0 FgbEjjFr37fbwteR42vkK05S/SkThHFJlpyWSw3qJ8TZsu8wuTaSW1q1nXQoCjFCsFN+ 5KsbZ7nrlOAlp3aZe3w0I6YOZqo75em+jtb6zwC/WHRfzleKs3y5tDr9XJNCcPZBcUuf Pseg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695033065; x=1695637865; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QLJZOub4/BAt+7IdwydIQJYY2CoSBI6D30tEHY6X3RQ=; b=pENKH6qmPDviYdDgKOZdwSZDqsZzZB6ViPhv9ukQnyXpHw2Bc2y8kKTOifmHyCZDvf lWgedWMHk13p6oLdjq/acDb6ZpYfIR7rPHFuEIaPCbLkUvMMtxSRrScEeZ5hbujL6UP1 KColWCViP4+S/hLzw4TDRMbhpu5W8a5PMt/Z7oX1Uid9JIC7n7H69nfk3x0TgRxLqG3v Mo15AqcLZV4iHds8mqx7Qd8K+3ttnjjcc9SzD1plyjdHtM0EqUud212XdSPyAegeV7l5 ed9dS7P4juMwGPOYwwIGP6UR2MdbJvzoW2sNAP8M5/1+fOvh+fnowqy8O52Di7uzGrY6 cEgw== X-Gm-Message-State: AOJu0Yxn86ALdMhOPXLdSjZrV+sCUppPjnb4JCGvjWN9veTK+UqEm/pn Yx7oY35XJry5g5fU3YrCB1M= X-Received: by 2002:a05:6a00:3994:b0:690:2ecd:a593 with SMTP id fi20-20020a056a00399400b006902ecda593mr10089185pfb.26.1695033064750; Mon, 18 Sep 2023 03:31:04 -0700 (PDT) Received: from localhost.localdomain (2001-b400-e2a7-a325-4595-6688-c34c-2ae9.emome-ip6.hinet.net. [2001:b400:e2a7:a325:4595:6688:c34c:2ae9]) by smtp.gmail.com with ESMTPSA id o17-20020a639211000000b0056c3a4a3ca5sm6616292pgd.36.2023.09.18.03.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 03:31:04 -0700 (PDT) From: Victor Shih <victorshihgli@gmail.com> To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: 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, kai.heng.feng@canonical.com, Victor Shih <victorshihgli@gmail.com>, Victor Shih <victor.shih@genesyslogic.com.tw> Subject: [PATCH V1] mmc: sdhci-pci-gli: GL975[05]: Mask the replay timer timeout of AER Date: Mon, 18 Sep 2023 18:30:55 +0800 Message-Id: <20230918103055.5471-1-victorshihgli@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 18 Sep 2023 03:32:04 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777409173167141406 X-GMAIL-MSGID: 1777409173167141406 |
Series |
[V1] mmc: sdhci-pci-gli: GL975[05]: Mask the replay timer timeout of AER
|
|
Commit Message
Victor Shih
Sept. 18, 2023, 10:30 a.m. UTC
From: Victor Shih <victor.shih@genesyslogic.com.tw> 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 replay timer timeout must be masked. Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> --- drivers/mmc/host/sdhci-pci-gli.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
Comments
Hi Victor, On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > 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 replay timer > 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 received: 0000:00:1c.0 [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: severity=Corrected, type=Data Link Layer, (Transmitter ID) [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error status/mask=00001000/00002000 [ 1100.326996] pcieport 0000:00:1c.0: [12] Timeout Kai-Heng > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > --- > 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 0x510 > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > value &= ~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_MASK, &value); > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > + > gl9750_wt_off(host); > } > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > value &= ~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_MASK, &value); > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > + > gl9755_wt_off(pdev); > } > > -- > 2.25.1 >
On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > > Hi Victor, > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > 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 replay timer > > 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 received: > 0000:00:1c.0 > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > severity=Corrected, type=Data Link Layer, (Transmitter ID) > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > status/mask=00001000/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? 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 instructions, please provide me with your environment and I will verify it again. Thanks, Victor Shih > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > --- > > 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 0x510 > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > value &= ~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_MASK, &value); > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > + > > gl9750_wt_off(host); > > } > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > value &= ~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_MASK, &value); > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > + > > gl9755_wt_off(pdev); > > } > > > > -- > > 2.25.1 > >
Hi Victor, On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > <kai.heng.feng@canonical.com> wrote: > > > > Hi Victor, > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > 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 replay timer > > > 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 received: > > 0000:00:1c.0 > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > status/mask=00001000/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 instructions, > please provide me with your environment and I will verify it again. The patch gets applied on top of next-20230918. Please let me know what else you want to know. Kai-Heng > > Thanks, Victor Shih > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > --- > > > 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 0x510 > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > value &= ~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_MASK, &value); > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > + > > > gl9750_wt_off(host); > > > } > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > value &= ~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_MASK, &value); > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > + > > > gl9755_wt_off(pdev); > > > } > > > > > > -- > > > 2.25.1 > > >
On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > > Hi Victor, > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > <kai.heng.feng@canonical.com> wrote: > > > > > > Hi Victor, > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > 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 replay timer > > > > 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 received: > > > 0000:00:1c.0 > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > status/mask=00001000/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 instructions, > > please provide me with your environment and I will verify it 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 layer root port, could you give me some suggestions? Or could you provide sample code for my reference? Thanks, Victor Shih > > > > Thanks, Victor Shih > > > > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > --- > > > > 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 0x510 > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > value &= ~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_MASK, &value); > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > + > > > > gl9750_wt_off(host); > > > > } > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > value &= ~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_MASK, &value); > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > + > > > > gl9755_wt_off(pdev); > > > > } > > > > > > > > -- > > > > 2.25.1 > > > >
Hi Victor, On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > <kai.heng.feng@canonical.com> wrote: > > > > Hi Victor, > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > Hi Victor, > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > 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 replay timer > > > > > 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 received: > > > > 0000:00:1c.0 > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > status/mask=00001000/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 instructions, > > > please provide me with your environment and I will verify it 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 layer 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 when ASPM L1.2 is enabled? Kai-Heng > > Thanks, Victor Shih > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > --- > > > > > 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 0x510 > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > value &= ~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_MASK, &value); > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > + > > > > > gl9750_wt_off(host); > > > > > } > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > value &= ~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_MASK, &value); > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > + > > > > > gl9755_wt_off(pdev); > > > > > } > > > > > > > > > > -- > > > > > 2.25.1 > > > > >
On Fri, Sep 22, 2023 at 3:11 PM Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > > Hi Victor, > > On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > > <kai.heng.feng@canonical.com> wrote: > > > > > > Hi Victor, > > > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > Hi Victor, > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > > > 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 replay timer > > > > > > 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 received: > > > > > 0000:00:1c.0 > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > > status/mask=00001000/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 instructions, > > > > please provide me with your environment and I will verify it 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 layer 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 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? The device supports D3hot. Thanks, Victor Shih > > > > Thanks, Victor Shih > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > --- > > > > > > 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 0x510 > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > > value &= ~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_MASK, &value); > > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > > + > > > > > > gl9750_wt_off(host); > > > > > > } > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > > value &= ~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_MASK, &value); > > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > > + > > > > > > gl9755_wt_off(pdev); > > > > > > } > > > > > > > > > > > > -- > > > > > > 2.25.1 > > > > > >
Hi Victor, On Tue, Sep 26, 2023 at 4:21 PM Victor Shih <victorshihgli@gmail.com> wrote: > > On Fri, Sep 22, 2023 at 3:11 PM Kai-Heng Feng > <kai.heng.feng@canonical.com> wrote: > > > > Hi Victor, > > > > On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > Hi Victor, > > > > > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > > > > > 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 replay timer > > > > > > > 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 received: > > > > > > 0000:00:1c.0 > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > > > status/mask=00001000/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 instructions, > > > > > please provide me with your environment and I will verify it 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 layer 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 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 timeout'. > The device supports D3hot. Do you think such error plays any crucial rule? Otherwise disable 'correctable' errors may be plausible. Kai-Heng > > Thanks, Victor Shih > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > --- > > > > > > > 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 0x510 > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > > > value &= ~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_MASK, &value); > > > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > > > + > > > > > > > gl9750_wt_off(host); > > > > > > > } > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > > > value &= ~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_MASK, &value); > > > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > > > + > > > > > > > gl9755_wt_off(pdev); > > > > > > > } > > > > > > > > > > > > > > -- > > > > > > > 2.25.1 > > > > > > >
On Mon, Oct 2, 2023 at 10:18 AM Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > > Hi Victor, > > On Tue, Sep 26, 2023 at 4:21 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > On Fri, Sep 22, 2023 at 3:11 PM Kai-Heng Feng > > <kai.heng.feng@canonical.com> wrote: > > > > > > Hi Victor, > > > > > > On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > Hi Victor, > > > > > > > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > > > > > > > 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 replay timer > > > > > > > > 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 received: > > > > > > > 0000:00:1c.0 > > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > > > > status/mask=00001000/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 instructions, > > > > > > please provide me with your environment and I will verify it 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 layer 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 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 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 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 timeout? 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 <victor.shih@genesyslogic.com.tw> > > > > > > > > --- > > > > > > > > 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 0x510 > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > > > > + > > > > > > > > gl9750_wt_off(host); > > > > > > > > } > > > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > > > > + > > > > > > > > gl9755_wt_off(pdev); > > > > > > > > } > > > > > > > > > > > > > > > > -- > > > > > > > > 2.25.1 > > > > > > > >
On Fri, Oct 6, 2023 at 6:30 PM Victor Shih <victorshihgli@gmail.com> wrote: > > On Mon, Oct 2, 2023 at 10:18 AM Kai-Heng Feng > <kai.heng.feng@canonical.com> wrote: > > > > Hi Victor, > > > > On Tue, Sep 26, 2023 at 4:21 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > On Fri, Sep 22, 2023 at 3:11 PM Kai-Heng Feng > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > Hi Victor, > > > > > > > > On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > > > > > > > > > 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 replay timer > > > > > > > > > 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 received: > > > > > > > > 0000:00:1c.0 > > > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > > > > > status/mask=00001000/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 instructions, > > > > > > > please provide me with your environment and I will verify it 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 layer 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 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 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 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. 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 timeout? > 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 > > Thanks, Victor Shih > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > > > > Thanks, Victor Shih > > > > > > > > > > > > > > > > > > > > > > > > > Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > --- > > > > > > > > > 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 0x510 > > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > > > > > + > > > > > > > > > gl9750_wt_off(host); > > > > > > > > > } > > > > > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > > > > > + > > > > > > > > > gl9755_wt_off(pdev); > > > > > > > > > } > > > > > > > > > > > > > > > > > > -- > > > > > > > > > 2.25.1 > > > > > > > > >
On Wed, Oct 11, 2023 at 2:35 PM Kai-Heng Feng <kai.heng.feng@canonical.com> wrote: > > On Fri, Oct 6, 2023 at 6:30 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > On Mon, Oct 2, 2023 at 10:18 AM Kai-Heng Feng > > <kai.heng.feng@canonical.com> wrote: > > > > > > Hi Victor, > > > > > > On Tue, Sep 26, 2023 at 4:21 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > On Fri, Sep 22, 2023 at 3:11 PM Kai-Heng Feng > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > Hi Victor, > > > > > > > > > > On Wed, Sep 20, 2023 at 4:54 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > On Tue, Sep 19, 2023 at 3:31 PM Kai-Heng Feng > > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > On Tue, Sep 19, 2023 at 3:10 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > > > On Tue, Sep 19, 2023 at 12:24 PM Kai-Heng Feng > > > > > > > > <kai.heng.feng@canonical.com> wrote: > > > > > > > > > > > > > > > > > > Hi Victor, > > > > > > > > > > > > > > > > > > On Mon, Sep 18, 2023 at 6:31 PM Victor Shih <victorshihgli@gmail.com> wrote: > > > > > > > > > > > > > > > > > > > > From: Victor Shih <victor.shih@genesyslogic.com.tw> > > > > > > > > > > > > > > > > > > > > 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 replay timer > > > > > > > > > > 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 received: > > > > > > > > > 0000:00:1c.0 > > > > > > > > > [ 1100.326991] pcieport 0000:00:1c.0: PCIe Bus Error: > > > > > > > > > severity=Corrected, type=Data Link Layer, (Transmitter ID) > > > > > > > > > [ 1100.326993] pcieport 0000:00:1c.0: device [8086:7ab9] error > > > > > > > > > status/mask=00001000/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 instructions, > > > > > > > > please provide me with your environment and I will verify it 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 layer 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 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 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 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. > > 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 timeout? > > 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 suspension, 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 <victor.shih@genesyslogic.com.tw> > > > > > > > > > > --- > > > > > > > > > > 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 0x510 > > > > > > > > > > #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) > > > > > > > > > > > > > > > > > > > > @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) > > > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > > > + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); > > > > > > > > > > + > > > > > > > > > > gl9750_wt_off(host); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) > > > > > > > > > > value &= ~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_MASK, &value); > > > > > > > > > > + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > > > > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); > > > > > > > > > > + > > > > > > > > > > gl9755_wt_off(pdev); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > 2.25.1 > > > > > > > > > >
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 0x510 #define SDHCI_GLI_9767_GM_BURST_SIZE_AXI_ALWAYS_SET BIT(8) @@ -561,6 +567,11 @@ static void gl9750_hw_setting(struct sdhci_host *host) value &= ~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_MASK, &value); + value |= PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, value); + gl9750_wt_off(host); } @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_pci_slot *slot) value &= ~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_MASK, &value); + value |= PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, value); + gl9755_wt_off(pdev); }