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 2C6A6C00528 for ; Fri, 28 Jul 2023 08:44:30 +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:References: 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: List-Owner; bh=SZlMGLVWgLBB+0KvEDH7Atg1QWecePs2yrUfW3HEviE=; b=Fp4MbLZh5ESjsx JPsUluATCSpjcjZteU1sVogCDH7Wf3138Jk0qJY2eiWoqi7MRMIR3dO6aV9g5E3Vksh9wA1QfNq7D 4bTQhAcgv/7jDBADk2bmeOiUCU03d0yloHq/4cZ/qHP8a1TtI8UwdRDMAKOwHRGE1uhaX0WcXkdtF 4ae3M0NZappSJHV1F0MyZtgVO1H+DGe/Xujy3WwwjjcigO7dd76oxmULPhCQkjuNMop9bHq+NE7CB T+TFaf6Swj61Xlj6t84Xoj1H+rxCtVM5Vmqd8k0ICqpk5avDKHxCkgR9LQ1y2mGEsb1mUWrjAeL+F xwxS7u7f5syzED587fuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPJ4s-002RHb-29; Fri, 28 Jul 2023 08:44:02 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qPJ4q-002RH2-1I; Fri, 28 Jul 2023 08:44:01 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 937EB62063; Fri, 28 Jul 2023 08:43:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBD4DC433C7; Fri, 28 Jul 2023 08:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690533839; bh=DYMtYTNvDKC5KRhCogEBmpaDtd8JRR359LeDXZ9iM48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QIxRIOr5Z1UDrUiRM512S6uSDlpPhpjbhKOmPnbce0sdsm9kFJEzI/DJCW4YFT/TP Wfvo04EQDbW0W7EbK5+OzGv2eccd1yUKsDH4+IWnYZ7j5s+nGMGJKfjE9ym4MVH0wl demDedVaiHAVja/xRgwSwJiA5h9tbaokbs2HnmRJMyQfeohFEvgUgT0MAD2lLmG+np 1XEwCR/eCe9cZk7vLcCUB9LvYJwEy8+um+MLECJ40RnVB3NmFezDrBN8RAY5KD4+Nw mwFbVgFlmYb5AE5/G3DBts+hIm/3zl3yjSAAzD2Uzn3V2tEEtj1OROat/hLsKKhrLl F4kILnY234dfA== Date: Fri, 28 Jul 2023 10:43:51 +0200 From: Lorenzo Pieralisi 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 , 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 v6 3/5] PCI: brcmstb: Set higher value for internal bus timeout Message-ID: References: <20230623144100.34196-1-james.quinlan@broadcom.com> <20230623144100.34196-4-james.quinlan@broadcom.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230623144100.34196-4-james.quinlan@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230728_014400_528364_763E4015 X-CRM114-Status: GOOD ( 24.01 ) 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 Fri, Jun 23, 2023 at 10:40:56AM -0400, 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. > > So, when "brcm,enable-l1ss" is observed, we increase the timeout value to > four seconds instead of using its HW default. > > Signed-off-by: Jim Quinlan > Tested-by: Florian Fainelli > --- > 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 d30636a725d7..fe0415a98c63 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -1034,6 +1034,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; Nit: you could define an offset for the TIMEOUT register, if that makes it any cleaner, up to you. > + u32 timeout_us = 4000000; /* 4 seconds, our setting for L1SS */ It would be useful to describe why this has to be 4 seconds in case someone in the future will have to change it. Thanks, Lorenzo > + /* 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) > { > bool l1ss = of_property_read_bool(pcie->np, "brcm,enable-l1ss"); > @@ -1059,6 +1074,7 @@ static void brcm_config_clkreq(struct brcm_pcie *pcie) > * of 400ns, as specified in 3.2.5.2.2 of the PCI Express > * Mini CEM 2.0 specification. > */ > + brcm_extend_rbus_timeout(pcie); > clkreq_set |= PCIE_MISC_HARD_PCIE_HARD_DEBUG_L1SS_ENABLE_MASK; > dev_info(pcie->dev, "bi-dir CLKREQ# for L1SS power savings"); > } else { > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel