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 CE64CC54E67 for ; Wed, 27 Mar 2024 08:24: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=dDigY4/xnw47vlNFuHMsRLjslc8d1KwYdNncYxcG9ng=; b=ZI2AtntjVZ/k2L 7ThfGEMHDEmyw4w/3Oe7Ioc454y/pyBI0GR/87Wzd3ABJZC42qfHXDeJ35a2EmSafNeFXibQNKyfK qAl639ey8E3T1p9LBVRgE5+iKzcxodGkk/vzi/WB3mXqw8UUjzDMpsQvtupBCN2wuX2zjPUsWfmh+ XeQD7xP8jIazlIyRTReYKMWr6E52RLZdOuBIbFWvzU27XynGx+eDza86HGA+jr96GcJfMrVWVNu6t KPyLklFbImSDgVnhXE99fVw5YzSsjfOBzRGrYbrOpJ5DYUjMQvN7e9CpEVFtQv1kzQ8PY1j7IMJHv Z9Ueq6fEtFT8FWNqnSKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpOa4-000000080uz-4BD8; Wed, 27 Mar 2024 08:24:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpOa1-000000080uJ-24YR; Wed, 27 Mar 2024 08:24:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id B0A90614F0; Wed, 27 Mar 2024 08:24:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45900C433C7; Wed, 27 Mar 2024 08:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711527856; bh=3O9nZkHhgz3EfvIBaPtrSnSZtIgGhJoXhwNgfGO7CX4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j9P2tUw6edMJRhnwzoQrRs+XIKbS+xEweeBhXY3zZJ/RTj1R7mEa72z4U16yo2TFn TTKFt09jLYgi53FcEGhDm66V9WckqMs2OYk5+vXbuIujHZJf73/C+nKdb+iA1xKIY6 rHkR+o+nsulOr5cG12CVo9mBfpkH1/g1HQ+1dAdY+m/PXy2bbfYTOUlHganupZ5qLh pLD11oUCAnIfexzwab73/UDv/S5Rhf454RM6Xx784Fz2Pd4QsiNYieUTq33RxtDsm4 3Bbha4ZBIbxb7aP1ggVF9M/Fy+raS/QVk+WadLk70POHbqsgb7Flx63WH6p3JgFWs7 kPtY29Xau5cEw== Date: Wed, 27 Mar 2024 09:24:05 +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 , Shawn Lin , Heiko Stuebner , 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, linux-rockchip@lists.infradead.org Subject: Re: [PATCH v11 8/8] PCI: endpoint: Remove "core_init_notifier" flag Message-ID: References: <20240327-pci-dbi-rework-v11-0-6f5259f90673@linaro.org> <20240327-pci-dbi-rework-v11-8-6f5259f90673@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240327-pci-dbi-rework-v11-8-6f5259f90673@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240327_012417_648394_11A17154 X-CRM114-Status: GOOD ( 26.26 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org Hello Mani, On Wed, Mar 27, 2024 at 12:05:54PM +0530, Manivannan Sadhasivam wrote: > "core_init_notifier" flag is set by the glue drivers requiring refclk from > the host to complete the DWC core initialization. Also, those drivers will > send a notification to the EPF drivers once the initialization is fully > completed using the pci_epc_init_notify() API. Only then, the EPF drivers > will start functioning. > > For the rest of the drivers generating refclk locally, EPF drivers will > start functioning post binding with them. EPF drivers rely on the > 'core_init_notifier' flag to differentiate between the drivers. > Unfortunately, this creates two different flows for the EPF drivers. > > So to avoid that, let's get rid of the "core_init_notifier" flag and follow > a single initialization flow for the EPF drivers. This is done by calling > the dw_pcie_ep_init_notify() from all glue drivers after the completion of > dw_pcie_ep_init_registers() API. This will allow all the glue drivers to > send the notification to the EPF drivers once the initialization is fully > completed. > > Only difference here is that, the drivers requiring refclk from host will > send the notification once refclk is received, while others will send it > during probe time itself. > > But this also requires the EPC core driver to deliver the notification > after EPF driver bind. Because, the glue driver can send the notification > before the EPF drivers bind() and in those cases the EPF drivers will miss > the event. To accommodate this, EPC core is now caching the state of the > EPC initialization in 'init_complete' flag and pci-ep-cfs driver sends the > notification to EPF drivers based on that after each EPF driver bind. > > Tested-by: Niklas Cassel > Signed-off-by: Manivannan Sadhasivam > --- > drivers/pci/controller/cadence/pcie-cadence-ep.c | 2 ++ > drivers/pci/controller/dwc/pci-dra7xx.c | 2 ++ > drivers/pci/controller/dwc/pci-imx6.c | 2 ++ > drivers/pci/controller/dwc/pci-keystone.c | 2 ++ > drivers/pci/controller/dwc/pci-layerscape-ep.c | 2 ++ > drivers/pci/controller/dwc/pcie-artpec6.c | 2 ++ > drivers/pci/controller/dwc/pcie-designware-ep.c | 1 + > drivers/pci/controller/dwc/pcie-designware-plat.c | 2 ++ > drivers/pci/controller/dwc/pcie-keembay.c | 2 ++ > drivers/pci/controller/dwc/pcie-qcom-ep.c | 1 - > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 2 ++ > drivers/pci/controller/dwc/pcie-tegra194.c | 1 - > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 2 ++ > drivers/pci/controller/pcie-rcar-ep.c | 2 ++ > drivers/pci/controller/pcie-rockchip-ep.c | 2 ++ > drivers/pci/endpoint/functions/pci-epf-test.c | 18 +++++------------- > drivers/pci/endpoint/pci-ep-cfs.c | 9 +++++++++ > drivers/pci/endpoint/pci-epc-core.c | 22 ++++++++++++++++++++++ > include/linux/pci-epc.h | 7 ++++--- > 19 files changed, 65 insertions(+), 18 deletions(-) > > diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c > index 2d0a8d78bffb..da67a06ee790 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c > +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c > @@ -734,6 +734,8 @@ int cdns_pcie_ep_setup(struct cdns_pcie_ep *ep) > > spin_lock_init(&ep->lock); > > + dw_pcie_ep_init_notify(&pci->ep); This looks wrong (and I think that you have not build tested this). dw_* prefix indicates DWC, so it is a DWC specific function. I don't think that you can use this function for the 3 non-DWC EPC drivers. I think that you need to use call pci_epc_init_notify() directly. (Also perhaps rebase your series on v6.9-rc1, I got conflicts when trying to apply it to v6.9-rc1, because it looks like the series is still based on v6.8-rc1.) Kind regards, Niklas _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip