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 CF5ABC54798 for ; Thu, 7 Mar 2024 20:31:41 +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=pegrGrSsPXWolmgf87mEv9VsQt3TrXu+pOuMShWsTC0=; b=2uf0gg0f4Fm+h+ 2zwCq4drcyACJ4aaI276AfqMqgVclDl8yY1plRIMkxzRtj7C2j871P8C6JSeUgse9O2sXgm7LcOml 1/UuVEMCF+n0XoSfC4QjiDQu6eLz1Dhu6xELsKXSVWBnRPOCoBGASo1Bcpq4z2IiELLa/H84nnkq5 hhat15zJw3gLzUvwQmLNvqBtEE6CA+RK3esed13fPBTLQrRHJE+yM6Ue0UEij/cW9uYE4K4YtHJfG Ha5/2JKFnwLfs7Mggg498en8pqLRyNRCh4fSPdQRdz+w38q8xX2oZxuAhGQuazB/ccbVhH3XCa6TZ Jq3Ge4kz+w04jyhDbiZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1riKOm-00000006IBz-3cKi; Thu, 07 Mar 2024 20:31:28 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1riKOk-00000006IAw-0soV for linux-arm-kernel@lists.infradead.org; Thu, 07 Mar 2024 20:31:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C8147CE262A; Thu, 7 Mar 2024 20:31:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6AF1DC433F1; Thu, 7 Mar 2024 20:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709843483; bh=SpBFTgDYCZL5HMSP744NvFE2koQBVmNM5L2jWkZki7w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Dq1Ij5cbXC/azz2ARqvH18GU6nblsiWGJekKh8qOtyucIW4GqCRnXVbQlQjtTDrOw /QkuiKcsiHgteS5KrBFnY8QBf7g5BlAInJ5lA75KzFf02hYqh+iJTlYBkAhbD8wmcN MlcgMIrkMt5PPDeFFLmBWkrNhXZOwrWOTp3JIHIa1DcLWTyDHzHrbHVGosjmEtufOK o0H+MQGjAzJWkFcK+6eKhq8Yamb1XolFCnSNIjPhVH+lM9CvmbuF3VOGSHWZyqJXCW Oxl2l5XBcGLAfAFnlpjupMrL2nAN7mCz8/RL4c9k3rUaviU69PmCBCh0FHzrbA6NLs tlWLEc5gqsSpA== Date: Thu, 7 Mar 2024 21:31:12 +0100 From: Niklas Cassel To: Manivannan Sadhasivam Cc: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Marek Vasut , Yoshihiro Shimoda , Thierry Reding , Jonathan Hunter , Kishon Vijay Abraham I , Vidya Sagar , Vignesh Raghavendra , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Minghuan Lian , Mingkai Hu , Roy Zang , Kunihiko Hayashi , Masami Hiramatsu , Kishon Vijay Abraham I , Jesper Nilsson , Srikanth Thokala , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@axis.com, Frank Li Subject: Re: [PATCH v9 04/10] PCI: dwc: ep: Fix DBI access failure for drivers requiring refclk from host Message-ID: References: <20240304-pci-dbi-rework-v9-0-29d433d99cda@linaro.org> <20240304-pci-dbi-rework-v9-4-29d433d99cda@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240304-pci-dbi-rework-v9-4-29d433d99cda@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240307_123126_724510_3FE0BB03 X-CRM114-Status: GOOD ( 25.91 ) 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 Mon, Mar 04, 2024 at 02:52:16PM +0530, Manivannan Sadhasivam wrote: > The DWC glue drivers requiring an active reference clock from the PCIe host > for initializing their PCIe EP core, set a flag called 'core_init_notifier' > to let DWC driver know that these drivers need a special attention during > initialization. In these drivers, access to the hw registers (like DBI) > before receiving the active refclk from host will result in access failure > and also could cause a whole system hang. > > But the current DWC EP driver doesn't honor the requirements of the drivers > setting 'core_init_notifier' flag and tries to access the DBI registers > during dw_pcie_ep_init(). This causes the system hang for glue drivers such > as Tegra194 and Qcom EP as they depend on refclk from host and have set the > above mentioned flag. > > To workaround this issue, users of the affected platforms have to maintain > the dependency with the PCIe host by booting the PCIe EP after host boot. > But this won't provide a good user experience, since PCIe EP is _one_ of > the features of those platforms and it doesn't make sense to delay the > whole platform booting due to PCIe requiring active refclk. > > So to fix this issue, let's move all the DBI access from > dw_pcie_ep_init() in the DWC EP driver to the dw_pcie_ep_init_complete() > API. This API will only be called by the drivers setting > 'core_init_notifier' flag once refclk is received from host. For the rest > of the drivers that gets the refclk locally, this API will be called > within dw_pcie_ep_init(). > > Fixes: e966f7390da9 ("PCI: dwc: Refactor core initialization code for EP mode") > Co-developed-by: Vidya Sagar > Signed-off-by: Vidya Sagar > Reviewed-by: Frank Li > Signed-off-by: Manivannan Sadhasivam > --- I'm not sure if the Fixes tag is stictly correct, since there is nothing wrong with the commit that the Fixes-tag is referencing. What this patch addresses is an additional use-case/feature, which allows you to start the EP-side before the RC-side. However, I'm guessing that you kept the Fixes-tag such that this patch will get backported. However, this patch is number 4/10 in the patch series. If this is a strict fix that you want backported, and it does not depend on any of the previous patches (it doesn't seem that way), then I think that you should have put it as patch 1/10 in the series. Patch ordering aside: Reviewed-by: Niklas Cassel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel