Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1563004rdb; Wed, 20 Sep 2023 12:41:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFlsyByY6bBiIPcR/2G2Iw/OYnEd3gwc9IKEJ1P2z47/Ae2d6t0dg8FlN5RSp3fPygM0ERq X-Received: by 2002:a05:6a20:258f:b0:153:4ea6:d128 with SMTP id k15-20020a056a20258f00b001534ea6d128mr7953507pzd.13.1695238894785; Wed, 20 Sep 2023 12:41:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695238894; cv=none; d=google.com; s=arc-20160816; b=lBZ009rcFf44u3m9d08GLB4FGZB81F1/LQ+I8Xqxq6q2EthRszlDGiWCYBwP03wpq4 oxm5mj9KJts2KQXPwMa4JQxrtbSgXKjPHy/d9vMsYFDxLsBR3kZ8TAzZ505135/OyIml 5YrumKfSPsgySUgs8EB0SRI57l8mJUeUTaf2WM/6WgAKnUFcAVF52GWkvRg4qBgrUFj/ e6rhwpTaeHLBz3w7ZEZx4hg3CUAzfyIbGST/8bdZMoccElpETtxnUR67Ov3UGgeJqQeO 5blHmLteamsWpivTljgQ2qkfKizIjwFSL94DQ6oXbNVJLBPRGk2NhoB8tAPUd+PoXQZ4 VrKA== 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=IrrQJKkKes28oqech+rUAf+7IG5PdT7LFyD0ckVQ1ag=; fh=QqDOBK5N7mIyMVGskvnpZW9KBmRbRhYKYgDGlV/3hLg=; b=jfxwR/RRHeGWX+9DMteaUAei170PdTTBh8WZ6OCy3zPCoqjnwDErt3pVfhVGZuFh66 ASRZJFldjPUWiubnhXeeHMa5tcWFqSCoqNKMjOY+TY5pVn3nY0fgMT2VzSIL6OHowgEb txbDPcinxFMU7oOBKFfbodPYuGv5G9XWpET/ic04ZZD+kVxXYaKtb+j1Asez7GK2zEgw 2q5X6ZAEdbgRUN9yUDBlxj0ObpMHGcsP01QzvCIV2Usbg8zQRj+JkJsUJq8HG/tg/GQj 1z3P+NI4WqTJEFHoQBnKS8/xQui64HV0NAqpYj6RHWhzdyqQn3MsTXFRIJK+P7WqqCue 9TCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dpweKRhb; 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 193-20020a6301ca000000b00578a2466521si4410703pgb.676.2023.09.20.12.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 12:41:34 -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=dpweKRhb; 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 04FB280F5F03; Wed, 20 Sep 2023 01:54:11 -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 S233771AbjITIyH (ORCPT + 99 others); Wed, 20 Sep 2023 04:54:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233615AbjITIyF (ORCPT ); Wed, 20 Sep 2023 04:54:05 -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 558459E; Wed, 20 Sep 2023 01:53:59 -0700 (PDT) Received: by mail-ua1-x933.google.com with SMTP id a1e0cc1a2514c-7870821d9a1so444869241.1; Wed, 20 Sep 2023 01:53:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695200038; x=1695804838; 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=IrrQJKkKes28oqech+rUAf+7IG5PdT7LFyD0ckVQ1ag=; b=dpweKRhbjw4FwX+NfhmkJyt7YW3UZoqQT2M5A3X7RrhVQecs4MIBnCSzwBtTqVibgk yIrnnFiTzMfD/5QG8qiur9W1kahfJNimaEO5PALJfr0OlA3Q93vWazsLw+ownzl+jsX9 d2lUSc0iwiGROZp4z23GYUHIbvt+FCos2CFrx2oTkcZAk+w4zxWa/l7GqHJ8xP+BVJGM xWN0emkvtjTCHs9edYSUPLx8cQDPoT8tZr4PIY2U91JokVXFPxvuULhhA54tj9/LNG/z 1z6ZeuX7gVOjm0AtfBrFE50L2/5MwqQPwAGXtzYBXDHZwBZcqaeKD+eVkxjq+H5Mz+y1 j5Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695200038; x=1695804838; 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=IrrQJKkKes28oqech+rUAf+7IG5PdT7LFyD0ckVQ1ag=; b=d0MkCYpsWt+KSB0gUDzTLKJgPgRlOXcNJ55VyrKGsJnGOki4ctX6RLbKukDR4eCy0V VbNEDQbKJYI5G69AC/ivTs42NpeTer537ZogQmdDOaHYV60KM11q97TxP+St5imb/s1D 9xjUY9sNTnlRCHYDLFpFKNeKVy1hKkRKWgLJwMORMozTUIJ/6+7xHaT81ErXddYMHp9L WHRxi/pLeifFDfVpSUOoVrlvdzTWYS6K6o9KVFtmqF1QETKdEKWkkRuD416S6uUQ/FCU /3u8RYvc7+jyOG8rNfCg7uRiwk/RJDwEJIxwT4HGFQV6wCIiMgV7ciaFLuzj+gKL6A0Q FflA== X-Gm-Message-State: AOJu0Yz+wqpBONYqR2ipn8LB5HzZ1tXwWpe04A+4YMP1t93f16DmS6Ge tLdkl4aEYZ6LJigrYybUqzolKFQAwdwKUJ03zwo= X-Received: by 2002:a67:fd51:0:b0:452:7715:ef91 with SMTP id g17-20020a67fd51000000b004527715ef91mr1078111vsr.12.1695200038303; Wed, 20 Sep 2023 01:53:58 -0700 (PDT) MIME-Version: 1.0 References: <20230918103055.5471-1-victorshihgli@gmail.com> In-Reply-To: From: Victor Shih Date: Wed, 20 Sep 2023 16:53:46 +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 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]); Wed, 20 Sep 2023 01:54:11 -0700 (PDT) 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 frequ= ently > > > > 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 th= e > > > 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=3DCorrected, type=3DData Link Layer, (Transmitter 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 happ= en. > > 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 > > > > --- > > > > 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/sd= hci-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 0x2= 14 > > > > +#define PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT B= IT(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 0x2= 14 > > > > +#define PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT B= IT(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_hos= t *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_MASK, &val= ue); > > > > + value |=3D PCI_GLI_9750_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > + pci_write_config_dword(pdev, PCI_GLI_9750_CORRERR_MASK, val= ue); > > > > + > > > > gl9750_wt_off(host); > > > > } > > > > > > > > @@ -770,6 +781,11 @@ static void gl9755_hw_setting(struct sdhci_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_MASK, &val= ue); > > > > + value |=3D PCI_GLI_9755_CORRERR_MASK_REPLAY_TIMER_TIMEOUT; > > > > + pci_write_config_dword(pdev, PCI_GLI_9755_CORRERR_MASK, val= ue); > > > > + > > > > gl9755_wt_off(pdev); > > > > } > > > > > > > > -- > > > > 2.25.1 > > > >