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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 011BAC54798 for ; Thu, 7 Mar 2024 21:10:05 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uphpTuhl; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4TrMQ44CN1z3vtH for ; Fri, 8 Mar 2024 08:10:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uphpTuhl; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=cassel@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4TrMPD3bzqz3vlq for ; Fri, 8 Mar 2024 08:09:20 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 292BD61CFE; Thu, 7 Mar 2024 21:09:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 125A9C433F1; Thu, 7 Mar 2024 21:09:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709845757; bh=x7qhL0+safPdNgJNsRsxVMft7a6MYJn2kbDJJU6030c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uphpTuhlD5OPOMRvy9lge5bafam+otT0YytPtZQK/FyriaS55FiTX6G7Nn2qGjvdc IIWvg5Oo3xznyGBP/6Nk1rgf7lPR0xR7CwV8v3JZq+seM6NIq4XCFwwu8rShA4KbsY 97+Ieb66fBKAEoPbnmBNuY7+LL61FOjf68d1wPnYX8ZsxCxRaMrr4F95CiOfasMtte JtP0yamORfamOObBNlRnoza4jXckh3dQCjYDHU6zZTOql6um/J7Dgx+UhkxqvT5T1V IvDgDi2O3QnFnLrLLLSx4azOsqi+b/S7O/ntH6YDYLmskuJPnekIAkbbrWNGLoKD/u 1loGhWdx7fEEw== Date: Thu, 7 Mar 2024 22:09:06 +0100 From: Niklas Cassel To: Manivannan Sadhasivam Subject: Re: [PATCH v9 07/10] PCI: dwc: ep: Remove "core_init_notifier" flag Message-ID: References: <20240304-pci-dbi-rework-v9-0-29d433d99cda@linaro.org> <20240304-pci-dbi-rework-v9-7-29d433d99cda@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240304-pci-dbi-rework-v9-7-29d433d99cda@linaro.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Kunihiko Hayashi , linux-pci@vger.kernel.org, Lorenzo Pieralisi , Frank Li , Minghuan Lian , Thierry Reding , Kishon Vijay Abraham I , Fabio Estevam , Marek Vasut , Kishon Vijay Abraham I , Rob Herring , Jesper Nilsson , linux-tegra@vger.kernel.org, linux-arm-kernel@axis.com, Jonathan Hunter , NXP Linux Team , Richard Zhu , Srikanth Thokala , linux-arm-msm@vger.kernel.org, Sascha Hauer , linuxppc-dev@lists.ozlabs.org, Bjorn Helgaas , linux-omap@vger.kernel.org, Mingkai Hu , linux-arm-kernel@ lists.infradead.org, Roy Zang , Jingoo Han , Yoshihiro Shimoda , linux-kernel@vger.kernel.org, Vidya Sagar , linux-renesas-soc@vger.kernel.org, Masami Hiramatsu , Pengutronix Kernel Team , Gustavo Pimentel , Shawn Guo , Lucas Stach Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, Mar 04, 2024 at 02:52:19PM +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. > > Reviewed-by: Frank Li > Signed-off-by: Manivannan Sadhasivam > --- You have removed the .core_init_notifier from EPC drivers, but the callback in EPF drivers is still called .core_init. Yes, this was a confusing name even before this patch, but after this patch, it is probably even worse :) The callback should be named from the perspective of EPF drivers IMO. .core_init sounds like a EPF driver should initialize the core. (But that is of course done by the EPC driver.) The .link_up() callback name is better, the EPF driver is informed that the link is up. Perhaps we could rename .core_init to .core_up ? It tells the EPF drivers that the core is now up. (And the EPF driver can configure the BARs.) Considering that you are not changing the name of the callback, and that it was already confusing before this patch: Reviewed-by: Niklas Cassel