From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01CC8535BC for ; Fri, 8 Mar 2024 09:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709891062; cv=none; b=gNt69VvoNH/dUukO3xpX09rDcFnXriJDvw1JAOP2f53aAqBFOYZm2JGlaeZIIXSCQMBtK2r9JpgPfe9EfGgL73AbLeUM6XZX99lDIZ/i/rXAReZPBFTK45Hw8Fv4RoSXherokDrVMWHgroh7FUfAatBKy+YRmeyESS+u2c9c6PI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709891062; c=relaxed/simple; bh=0HEUZNyW463A0kgIICyd/mFsEgweSIiAp5zW9wvwQAQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i/oQDpFHWEHO7zFtFkbV5aPolJMdooMb3p3FRsSVsgnXobJWgLdAFlWcmCNf49c4PntntED2Lw/kYcQrjYu3Bp1udWf+lDJ2frrkEWL6jiPdePBOphEZAxgTRd3Kefqws4hwRlbw+/oo3DXXfIUGJx58OZK9Jf4sX0tkQZEKo6w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=scNnxe+e; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="scNnxe+e" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e63e9abf6aso515083b3a.2 for ; Fri, 08 Mar 2024 01:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709891060; x=1710495860; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=cdMdoK0AVaUo9V+wul4fyguoktaqDabkYBWscL2ezsE=; b=scNnxe+eH0gJxpLD0BEvB7iGN2bbDV3x3kfx59zaTZPi8My/LQzAyQCdqZI3PhYc1J 6lQEh9CPLTemfcQpPYXAqYpSOnV42pha+24/QSs8Rv5XyvF1Jl7Xy58mXLEN0lspq8mw nzB9N5d7NoGM92r2JY6lMAMKdXznKYIRMjkZZ9l5cWzw5ZiqRbp1awaJ+9FdScEP/MvU 1x28YZpIxM8HZvGeyF42lUoRbJ2ZQUJrWQgYE8FvywAEZ3cSUuhhBo7oqziYapoD1FW3 FSb0ut2COKfFVrLeAzgf2kuJAj0PWN0jL8IPwMagx/fET4usxx4CBS+LbPkoTFM9sJYJ FHsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709891060; x=1710495860; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cdMdoK0AVaUo9V+wul4fyguoktaqDabkYBWscL2ezsE=; b=wE/Ilx+e/jUSl+N9/JKHdv5+LFg7jAo5itl30BN7QZtB/OmuUkFtEYzhAXlGM1OsM7 swTE8L83mTDkKRGkpbThK/g3kMDxMUIg5k0w0R+UgKQL19PKqNZlL/odVmVB/2PWWa88 A2pvwnjYZQrN1UAJ2KY/NI5zKasKz+SS01TcHJrusETlXFW5rmlKClKj6G/lieVkGpLm gSGI3zCHcveuDihp03zD7rQA5CB96RmBpFit+olAoDtHBkpTK4DG0HITtDMymv14XDZ3 0exXy6hmFxiwuCUkiWAsaPMST39lT4zVPMc4HGf+Nt0QqoHzBxq9qljpf1/w0lhjF8lG KzzA== X-Forwarded-Encrypted: i=1; AJvYcCXzyOQMCCCu9DL3gSE3WOAJ4CW74JbO6FFY9RD591X7ukOaKfTDFStM1CcW4byFc1tm0HTF0+W7SFTCXb47EsPKJmex3f0fRwpl2cU= X-Gm-Message-State: AOJu0YzB1HiXM695Nl50ljG/4hVGG+N+GTkDp/i1L5zmlL99qosMXpWH XIYpWAOowoqVMd5tdVvN3htDv2N1eNlqrDvLvgref3fF5jmlqGu2ziLoA4BoQw== X-Google-Smtp-Source: AGHT+IFPbL54AXHQXB9MkS0qJtzg8o8q9yBGg3I5qPe5e95N0vMgv1+cPBqKR5EsKnzhBrhB5Hgmww== X-Received: by 2002:a05:6a20:4284:b0:1a1:6b04:9f2e with SMTP id o4-20020a056a20428400b001a16b049f2emr7419660pzj.9.1709891060050; Fri, 08 Mar 2024 01:44:20 -0800 (PST) Received: from thinkpad ([117.217.183.232]) by smtp.gmail.com with ESMTPSA id b1-20020aa78101000000b006e6350986a8sm6625169pfi.215.2024.03.08.01.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Mar 2024 01:44:19 -0800 (PST) Date: Fri, 8 Mar 2024 15:14:04 +0530 From: Manivannan Sadhasivam To: Niklas Cassel 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: <20240308094404.GF3789@thinkpad> 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-tegra@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Mar 08, 2024 at 09:48:07AM +0100, Niklas Cassel wrote: > 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? > I already added a patch. So let's do it here itself :) - Mani -- மணிவண்ணன் சதாசிவம்