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 4B150D18131 for ; Mon, 14 Oct 2024 17:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=fHrHxJRBNt1Z7PA9Oi1FRL6hc7FdYckGE5WWm1ydDk4=; b=KSe60n0HWn8MUm pr87TNBeQtbP13xVaDMkduVDyk9LQddtIszg4itD6J4pI27E8ACKYvJW50EYAt3MqsPa8vepeHgxX JbHypOcDw8oYZhSwNEACpSytlKss0tSj59pJyqYbVaRwqq8pKn54Upw8c+wtvUgfSjwxKUDRdVjxY xljBIfJw90NeB4CMYSBXkDlfb8i6wH0TwzW/1uSzWQvGDu1PvtvdcCj/+WUE3hlKD1dvQ9l+j7i0F Juay10BdpAvJGLkAJv8nXK5iSiC171NHwBTReqNlM9K91ENzG8GwxKBs6eKZpSGlY/3gN74tquqEQ QI0fud6QNtdmiWQEybew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0OU9-00000005xuD-35MT; Mon, 14 Oct 2024 17:03:57 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0ORQ-00000005xLR-3K2U; Mon, 14 Oct 2024 17:01:10 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F0A2FA424E9; Mon, 14 Oct 2024 17:00:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C3B8C4CEC3; Mon, 14 Oct 2024 17:01:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728925267; bh=4rnWVVjevojtwtVqn08a/Sa8U6/ufbhEi7OxH5i21O0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=rBUiFGjg5D3+povRP3suF9DdpRvhPtxB89Bmo5NXAVClA8kByICp2ptl31P2Oy1iy yPcJ7XkJyeoEXr29RMUJx2JI9SWzExh1F+TwIKvrO0Sbdp9p5tKxDhU10w8uSqK2cr 47EXglj4CjeFnIykIYQWN9xEx5tefZGvWpKNCcDc+RgUq43AGcRRW4y8bmue/Tr4Gp yJcFAhEW0kiTLPVyMCNkShtzohD+KpKoKXZgVUFAx3Ni3ESp6DkFTD3YRmVE7EMjrK SAXaz8aAPgW2i4oZJNZpVEvwNRp2KK25pi1SCa3Pi1E/c/PXIXCBormoQ/NiXxuebs qutIerxNCMNxA== Date: Mon, 14 Oct 2024 12:01:05 -0500 From: Bjorn Helgaas To: Stanimir Varbanov Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, linux-pci@vger.kernel.org, Broadcom internal kernel review list , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Jim Quinlan , Nicolas Saenz Julienne , Bjorn Helgaas , Lorenzo Pieralisi , kw@linux.com, Philipp Zabel , Andrea della Porta , Phil Elwell , Jonathan Bell Subject: Re: [PATCH v3 06/11] PCI: brcmstb: Avoid turn off of bridge reset Message-ID: <20241014170105.GA611115@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241014130710.413-7-svarbanov@suse.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_100108_983133_A8C7518A X-CRM114-Status: GOOD ( 21.88 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 14, 2024 at 04:07:05PM +0300, Stanimir Varbanov wrote: > On PCIe turn off avoid shutdown of bridge reset, > by introducing a quirk flag. Can you include something here about *why* we need this change? I think the RESCAL comment below would be a good start. I think this should be squashed with the next commit that adds the use of CFG_QUIRK_AVOID_BRIDGE_SHUTDOWN. Otherwise this commit doesn't have an obvious reason. > Signed-off-by: Stanimir Varbanov > --- > v2 -> v3: > - Added more descriptive comment on CFG_QUIRK_AVOID_BRIDGE_SHUTDOWN quirk. > > drivers/pci/controller/pcie-brcmstb.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c > index b76c16287f37..757a1646d53c 100644 > --- a/drivers/pci/controller/pcie-brcmstb.c > +++ b/drivers/pci/controller/pcie-brcmstb.c > @@ -234,10 +234,20 @@ struct inbound_win { > u64 cpu_addr; > }; > > +/* > + * The RESCAL block is tied to PCIe controller #1, regardless of the number of > + * controllers, and turning off PCIe controller #1 prevents access to the RESCAL > + * register blocks, therefore not other controller can access this register > + * space, and depending upon the bus fabric we may get a timeout (UBUS/GISB), > + * or a hang (AXI). s/not other/no other/ > + */ > +#define CFG_QUIRK_AVOID_BRIDGE_SHUTDOWN BIT(0) > + > struct pcie_cfg_data { > const int *offsets; > const enum pcie_soc_base soc_base; > const bool has_phy; > + const u32 quirks; > u8 num_inbound_wins; > int (*perst_set)(struct brcm_pcie *pcie, u32 val); > int (*bridge_sw_init_set)(struct brcm_pcie *pcie, u32 val); > @@ -290,6 +300,7 @@ struct brcm_pcie { > struct subdev_regulators *sr; > bool ep_wakeup_capable; > bool has_phy; > + u32 quirks; > u8 num_inbound_wins; > }; > > @@ -1539,8 +1550,9 @@ static int brcm_pcie_turn_off(struct brcm_pcie *pcie) > u32p_replace_bits(&tmp, 1, PCIE_MISC_HARD_PCIE_HARD_DEBUG_SERDES_IDDQ_MASK); > writel(tmp, base + HARD_DEBUG(pcie)); > > - /* Shutdown PCIe bridge */ > - ret = pcie->bridge_sw_init_set(pcie, 1); > + if (!(pcie->quirks & CFG_QUIRK_AVOID_BRIDGE_SHUTDOWN)) > + /* Shutdown PCIe bridge */ > + ret = pcie->bridge_sw_init_set(pcie, 1); > > return ret; > } > @@ -1854,6 +1866,7 @@ static int brcm_pcie_probe(struct platform_device *pdev) > pcie->perst_set = data->perst_set; > pcie->bridge_sw_init_set = data->bridge_sw_init_set; > pcie->has_phy = data->has_phy; > + pcie->quirks = data->quirks; > pcie->num_inbound_wins = data->num_inbound_wins; > > pcie->base = devm_platform_ioremap_resource(pdev, 0); > -- > 2.43.0 >