Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp157578lqe; Wed, 27 Mar 2024 01:41:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcT6cyLrVlyZ+gvc9a8dSGNhUm6idwfUggB35eFhrwQ1NZTXXdGZZ1WAQ0aU+9kZIiaJOztxwDKaQ8ML5iwtKltc20AgflruHQnjM3KA== X-Google-Smtp-Source: AGHT+IG+oDfXoZsuHRqdbmCI57vz3uQ6gJ35R+CNF7j2c4dR2PwDR/lNhDJlXcRoyD66XymeGEsW X-Received: by 2002:a05:620a:c18:b0:78a:59df:2763 with SMTP id l24-20020a05620a0c1800b0078a59df2763mr1884138qki.42.1711528895402; Wed, 27 Mar 2024 01:41:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711528895; cv=pass; d=google.com; s=arc-20160816; b=DmGFYbH+K3Pd/Fnz+7Rm27Qm28qIFKtrXu8i41/A7CWeWk4DYS31QjKny7cTqmkwNS lvQnmwqsDX+eYl/ZIkfPwcWh52w+aF8joU/4MRHAjYhLfZIn0zG9+fGHLayr+FLLsBUj ORj92XDZfp/fu+VOKLLqwjPeWdohAK1uQWYNMXsH1nOlhzQTUqfPZFa6VL3BdSv/fOky m4RmuPck1/gxgMvpqknElMduRWR9TE3dM092O/O+er7AGYuCKmdvJFYGSr/qYyxGOB4l 0YsgPRPtLed2tuY8u/XU/eXEc6/oLv+Y1hd/1AXyIL8Y5mUr2Y2nMR9/jOblBBb1ykN0 Y+ZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=3kBGo9rBQDVD8B/37mPPc4bOK2wXan+HIEhCfIghQeQ=; fh=9on+Qh1Bdc7iVuJ3eGzJRka7PJqIy2mKpTefsfS7t4I=; b=k6JB19AeNfjdNji0WZJ5FWLzQ5d71Y3iZQbi5q4YT4BS4Hf2ohU7zZ61iFC7zdV62E Xml8FdyYRd9CsmLf0ixoElESaflm3nrRz20/29xxJcLmH6UKhvO3RI0VMUJSyuTTo5Ua LyRrHXWb4xBBxATJVGv6H/nFvKcUZ35DPW/g1wFyAzQI+N4M/ISgt2LXM6jl3AEINhmX cTJb/OLgSyGxSiEqerW7B6+H1Wbl/AE/vxV4m8UOFT1qurrxL3RBwe2q8NB1fHcRMhPM CRkMP/a6PTJIBj3vAHxCAm0qfaObk8LT2oDi2QAlLF9v6vdipq/dV6Rqdo7rOMUbFsrk wlNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBUvIzC+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-120558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vu8-20020a05620a560800b0078825c54209si9685936qkn.465.2024.03.27.01.41.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 01:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zBUvIzC+; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-120558-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120558-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 171FA1C2716A for ; Wed, 27 Mar 2024 08:41:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77271374F1; Wed, 27 Mar 2024 08:41:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zBUvIzC+" Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 1543237147 for ; Wed, 27 Mar 2024 08:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528873; cv=none; b=O8WIwYVRI1d/bS4Yi48LkL6oCRxh+xgKmBGm3DKjs2AL6dFaPTtp1HDBphwAAh90vyh2eCGcxKGySBObbrKjy+AIy+tBQS8RLIp8zwyDv2wG3v18AAYCUAREzMV2sgL3c8rl6qzCJ9Q1ncB4qqVJSbIneGZXF0jaPVxPfsqa5Qs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711528873; c=relaxed/simple; bh=Vxz59oGSPPXtkvKXl3CH0Bedz+fRY4D6DbBmcqa4Z5g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cbusjYFL3WHxSnPxyD+7Rc5KjA929tpLIDVc2InqT32jhF0zJCod9vIIYr0MMNiBlO5pmDiWjzV2B+biha9M0B+H831CPnDDpsXai2uC+rIrZHdPAK4TJvjIkp9Ta5Uf8IkdaGqdiyIa09QN/fbRvWgj300SXViMbGMu0Ws60wQ= 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=zBUvIzC+; arc=none smtp.client-ip=209.85.210.45 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 Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6e675181ceaso3503163a34.2 for ; Wed, 27 Mar 2024 01:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711528870; x=1712133670; 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=3kBGo9rBQDVD8B/37mPPc4bOK2wXan+HIEhCfIghQeQ=; b=zBUvIzC+K0KhmWy6Tsxhve5/iQWSHh2Kmd1UybWCM24AAqwL0s6Ysxhdw9NxjCC21n LJgon4QclJceB0+HftwRUtV7i2zDBe/CWKf6kdbXbkwm4j3LTQQ1QiU/MU8/aCWHkFfo 1lXucySU+MGX812f59+1YVnaQ9ZXsqwWF6sdpJIABxJSfkmCJjhpu6ardsxBL1tk47hl zF5pWuGH5oh1rFhZtR6xB7hzoGO3olLfN8HU+oMqdIX5Xv0asZMAPZLhobyzt0b5Cezv G6Q+n+Qr9JWefxvwmRg0uVSm/mw2sG935G4Gm7ZnwadZqHzxQJfLfbAYunxOCrYwbKFE 77rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711528870; x=1712133670; 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=3kBGo9rBQDVD8B/37mPPc4bOK2wXan+HIEhCfIghQeQ=; b=VUyo8nLz+vlDJrxIbAxbl0Nc0pMXn7CE4waxrjDvmcY1/v1A/S3VFo5A/J/FAKwaBP 7fDAoC3SrSqKblCbxKq+AfCiTV42DcrlyjXnoYGHvuvDEHpiI7MFY569BaBD8OkmxYKn huxg4fx08owAq+z3z74XxYMhws0WHobI3hg/0Tu2ToGm8wOMkZNzkLhG7hPDqofLhome b6szxcVlFIQbs6MAKnqje4eYZ+BXpn5F2QA09Azr4dRMByUvi1bj7uZ/3O5G/DYA0aqb 4FLD4xXisUhzI10xtkKlOABWSON0wCc65IIGWD6YpY12WXLkI3ffHFNgH4PjqqgFuaKC wCWQ== X-Forwarded-Encrypted: i=1; AJvYcCV19I/EThUHbUCingcpf8SMZPmqa6Lc8CziarHJNw9Eu9ZofdgeZcqo8RKn2Rbw9K/6YGn/5ELF+Q3zlkOmDJie7td2QqZ+qdDdzCTL X-Gm-Message-State: AOJu0YwI2N22ePMF9LlkAcwjblb3api+DzK3EoYsJq/37XOV+sI6gE+l ueAWXTlTN/dqHcwatRupKLJIJQ8jXbWVRRrC0uAA5eH9zYMFRvGzqweOnIzKiA== X-Received: by 2002:a05:6870:239d:b0:221:bd93:2940 with SMTP id e29-20020a056870239d00b00221bd932940mr2005103oap.27.1711528869823; Wed, 27 Mar 2024 01:41:09 -0700 (PDT) Received: from thinkpad ([120.60.52.77]) by smtp.gmail.com with ESMTPSA id m9-20020a62f209000000b006e6bf165a3asm7434651pfh.91.2024.03.27.01.40.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 01:41:09 -0700 (PDT) Date: Wed, 27 Mar 2024 14:10:56 +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 , 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: <20240327084056.GC2742@thinkpad> References: <20240327-pci-dbi-rework-v11-0-6f5259f90673@linaro.org> <20240327-pci-dbi-rework-v11-8-6f5259f90673@linaro.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Mar 27, 2024 at 09:24:05AM +0100, Niklas Cassel wrote: > 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). > Ah, this is silly. Sorry, added the change in a rush :( > 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.) > I rebased the epf rework series and didn't get any conflict. But will rebase this one also and send next version. Thanks for noticing my idiocy. - Mani -- மணிவண்ணன் சதாசிவம்