From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2C0BC4167D for ; Thu, 9 Nov 2023 21:27:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=0KAzjKpR+WcNKezwlq+kZFAwnnnbTjVeFdw0BZ8Voec=; b=J5CAQ/Scp4/MEH ulkZTv9ReTxp9zPxa+xYFJbLoDaOJDd1yC1km9qGjux6KDWWLwK+3u0yo446TLDhNsfdyK2MsKvhO s+7ya3yBhY3af72oVt4VK4JgUKX5ysVJtcr9gUCTF4VDAnWQXxYlrIDIyqQbhGrOBLmpbAIcyyyPf B12Jam1MyaHKdafMefIjgo3dwly8u1H1bO5b8uRzgD6ubtsOrtiDGALESDYQK4p+X+qzarGKRQZi7 sE4ggPUac37DV+iXzc++PrHjK1+5qiQ66oV6ogt13pvQW6RIdGe+iueHudBdbGy7kY+6Zw6JrvBcd 7hl/2CnN4HD28BWH3kXw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r1CYi-007GDQ-13; Thu, 09 Nov 2023 21:27:28 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r1CYf-007GCh-1p; Thu, 09 Nov 2023 21:27:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 14E56617E3; Thu, 9 Nov 2023 21:27:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59D4DC433C7; Thu, 9 Nov 2023 21:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699565244; bh=ZDkD8nE6Mqdk9hjfAmYOU/xCoxyV7u/A9MBQaroE3Fk=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gYFjrn5/JVD/tBrEMnhScZbfsTW5K25i/CgTI61//ELC3FX8Dk+jMl58EIdSWmtYp YPiqym0Yb7bhyZjAeqGvUcJsukEqmZSKF0T43MSBfi7pPk/e0bV7Ka0l2nBvTazXJL v/RcRqaB5ePBhLNpfTSl+J8kJjUPq7O/wK64LdDYbPtHCSH939za/UwncG83UxOS1L rDWb8AConIxVgacZgWq7fpqBccCw5bOKW6KbSGaYpi2R0f7WhnFE2DKWZ9QeeFRY6a BbschAKBblGVzx4v0uGqpX9s2KI6cgKQ6yPWiaKb3+iozfS2RZewClNW31cWoL6WmG H34qHBnxwtHiw== Date: Thu, 9 Nov 2023 15:27:22 -0600 From: Bjorn Helgaas To: Jim Quinlan Cc: linux-pci@vger.kernel.org, Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , Cyril Brulebois , Phil Elwell , bcm-kernel-feedback-list@broadcom.com, Florian Fainelli , Jim Quinlan , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , "moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE" , open list Subject: Re: [PATCH v7 3/3] PCI: brcmstb: Set higher value for internal bus timeout Message-ID: <20231109212722.GA492431@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231109191355.27738-4-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231109_132725_690653_A8766537 X-CRM114-Status: GOOD ( 21.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 09, 2023 at 02:13:54PM -0500, Jim Quinlan wrote: > During long periods of the PCIe RC HW being in an L1SS sleep state, there > may be a timeout on an internal bus access, even though there may not be > any PCIe access involved. Such a timeout will cause a subsequent CPU > abort. > > Signed-off-by: Jim Quinlan > --- > drivers/pci/controller/pcie-brcmstb.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index f45c5d0168d3..f82a3e1a843a 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1031,6 +1031,21 @@ static int brcm_pcie_setup(struct brcm_pcie *pcie) > return 0; > } > > +/* > + * This extends the timeout period for an access to an internal bus. This > + * access timeout may occur during L1SS sleep periods, even without the > + * presence of a PCIe access. > + */ > +static void brcm_extend_rbus_timeout(struct brcm_pcie *pcie) > +{ > + /* TIMEOUT register is two registers before RGR1_SW_INIT_1 */ > + const unsigned int REG_OFFSET = PCIE_RGR1_SW_INIT_1(pcie) - 8; > + u32 timeout_us = 4000000; /* 4 seconds, our setting for L1SS */ > + > + /* Each unit in timeout register is 1/216,000,000 seconds */ > + writel(216 * timeout_us, pcie->base + REG_OFFSET); > +} > + > static void brcm_config_clkreq(struct brcm_pcie *pcie) > { > static const char err_msg[] = "invalid 'brcm,clkreq-mode' DT string\n"; > @@ -1067,6 +1082,7 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie) > * atypical and should happen only with older devices. > */ > clkreq_cntl |= PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK; > + brcm_extend_rbus_timeout(pcie); It looks like this should be squashed into the previous patch, which added brcm_config_clkreq(). Otherwise there's a bisection hole where somebody testing at the previous patch could see the CPU abort. > } else { > /* > * "safe" -- No power savings; refclk is driven by RC _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel