Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp412341lqc; Fri, 8 Mar 2024 00:48:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUGG7DVkF21W8ud/rndVYIBwRZAOFOLaNK2uXiJLhhrZaksxRwwlTT44/fyNN/jn8cv+r07Av7b5FEMHT0r+do14YjeBSBVZO6ufKNSpA== X-Google-Smtp-Source: AGHT+IGEIichghAOlIVzGsXe20w14iTEboC1I6dBHEGOTL5twjSUfZkVcy4L2F+AKnDURbJWvD8w X-Received: by 2002:a05:6a20:7f84:b0:1a1:476b:8199 with SMTP id d4-20020a056a207f8400b001a1476b8199mr11466132pzj.26.1709887708331; Fri, 08 Mar 2024 00:48:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709887708; cv=pass; d=google.com; s=arc-20160816; b=Xomq6qjLhlCqK5F1ej2tg+HFzW+w6Jp+7jb3TvY3Ssn53NgcpMwauXGxmLvA6h6eU2 6mhFom/Eko3zEoBqGB1TZV/V6RBM1RPATUMpJgpDaWC4JnTjoST4bjl60IVLUduv5lNd 7ihQ+Yzwxyue3U631Tixe5SqapBCxpOFggLN0rxI2wP7irVl81kTrwlqBs5PsbccsUtf GbG8oMd/tnvkQEe1LmPwuPwlcDh3x9duS+zANMImhWAdE8w+F3+iRjcriWNliS93vHuf pkFuPFCemMk64g5lJnwaUwbDPHBRaE6R2sjr0Y6Ew4u5dXCeIo0NJmI4+mn2fN/G8G48 RHtw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6YqoxTyRCymVrjyni+s9qH/JOqty7EWq7jqKi/jauYQ=; fh=JOMs4cCEiY9iuBNXOVa2RG+IujJg9SLSvDgQT2j+igk=; b=z5aoObnsA9mMZGrBc7/PMUe0HPrm6fjmWD2d0B5GzaE+yTiuVdRheuPvMIovMPhfQZ BLxHj5iR3THCyOT0Y5NnBxfxKpD4nXWuUpgdAHzEHAU3BIjShs6WnusHA+TqpN9VfyrX CmoQCgoThqW8+nrbSO1yz8LiGmdsjT4GbnFNBe741089eY7tuKEcDjPlIANfhOeBKAJc 9HW9A447WjJvoA/CdtNgMOJLeqlw6terM9JTdyNo6+Y6bZ5CP+9AD3L6+UKGPau/Kv5v jHDFcxbX8xwEIKnBjWXCOdqeu0oVXUZNJjQsSEGIasVH7QnSI+7V9o1yksRm9QY+kbw/ UACw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acgWSAny; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g1-20020a056a000b8100b006e57c870fa5si10547045pfj.189.2024.03.08.00.48.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 00:48:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acgWSAny; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96694-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 01EC2281F1E for ; Fri, 8 Mar 2024 08:48:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EB114EB5E; Fri, 8 Mar 2024 08:48:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="acgWSAny" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 276941CA9A; Fri, 8 Mar 2024 08:48:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709887699; cv=none; b=ARHgPKiciQ6bX2lb+QeHfHiaaHCtntYHsfcEYBvqLTnwc2lQyUr+AS1CXpRWXUmIl4gk2wjgTWsLX6aB3cSetpSNfVf3uk7Iw5UVoSimOFZE/gMWiatYSBVdbxp1L3CEjgspgTxGFbN3MTowklKJWZ8peR01FeiQRgPZ6Hz9RMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709887699; c=relaxed/simple; bh=Os46CKddDWTirtB0sWeRcEab98vw5dx34ifSSInDtrE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rEFKzwgbMkc//7WGlb5mBWWAnACs6kNvmh75CIv7itvOgNPk0F4sZfwbIE/rrXxU6Jy3UJ/T6S4HhmnD55jAi2k6AGfOzg3B/U8bqDFywZXkwZWbDpkHxaYzKcLtJG4HN9JXJjsekPSrPGAScWzmDhQQbp2fulUtpqjHAlYC5WQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=acgWSAny; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED92CC433C7; Fri, 8 Mar 2024 08:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709887698; bh=Os46CKddDWTirtB0sWeRcEab98vw5dx34ifSSInDtrE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=acgWSAnyntQI7YWkNBHe6teZXBzI+ut6mvemDrUzDs+pe3VOXto4DGWOz0dJDP3nh B7lKYknLYn1z0fr85u+hCeBSHgq3TG7m8UwP77ZSlBu3bdlmkCUnnAlPGE45GjZ1A/ NqOlGZuJjarMerfBcmzyaGjCs/uZVvG1Uutrd7OjM/LgxcZIWlJ3PJRk/Uu4sCTTpV IC3myDAxuOvPxCMsQItoG6hQETn3bK2mvnxHhylRJ32inW3B3NPoEycGeFn6bi7v+m 17e1XVd06boVRH7eL5z5lL0F1wAq5XsPqFzxlJi5wXVe/WDpZ97W8GgU4DCIzZs69N A/tDo9imbZViQ== Date: Fri, 8 Mar 2024 09:48:07 +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 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> <20240308053829.GC3789@thinkpad> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240308053829.GC3789@thinkpad> On Fri, Mar 08, 2024 at 11:08:29AM +0530, Manivannan Sadhasivam wrote: > On Thu, Mar 07, 2024 at 10:09:06PM +0100, Niklas Cassel wrote: > > 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.) > > > > I don't disagree :) I thought about it but then decided to not extend the scope > of this series further. So saved that for next series. > > But yeah, it is good to clean it up here itself. If you intend to create a .core_deinit or .core_down (or whatever name you decide on), perhaps it is better to leave this cleanup to be part of that same series? Kind regards, Niklas