From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 EF4371419A7 for ; Tue, 27 Feb 2024 12:21:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709036518; cv=none; b=gnE15F1Nhf6TJnGMp+ss5iAeuRL9VLc3CRN27kYCLM9J+hU80WFmWEQ+1nWPz5hnLICwzU3ezbrwwRAkHWko+SHxLr+996A7yT7rOImrYH8qqUS83cvEdIsLwLDswX8r3GEh3NGTTMM6+qonAo+KSeo3PZaJEFw0oHHDLhaCjGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709036518; c=relaxed/simple; bh=OS7E+/QQezCuwcjLO9iExKTfqPQ2LbBPhoHoghWs9UE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cD6PXEzcux1d65sWEB5yv2tki6wUr4RPtcZ4N8oP9ZHNvByLe5gKEg2lZiLauSNNB8sb+LFTzQFfx7sWklr9iM/SQ7XxrtznsRu5R9CxdJxQ+l4BF3z5Gyh50y8ncHveMHo3V6RLovKcC5zTjp6UIOJgYEmE+RilQCUSktipUZU= 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=GewXukva; arc=none smtp.client-ip=209.85.214.182 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="GewXukva" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dcad814986so13795185ad.0 for ; Tue, 27 Feb 2024 04:21:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709036515; x=1709641315; 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=Fox2FOTrnn7H7ARtUpilsDQjBFro1sbb1UtQfPOSFHk=; b=GewXukvadPyjq8mmPdVrgdexPxxyZVm5taQLw4UE8uzO1qUZywn25e1hJOamHZRCwn yY+fYRQ8cx2oj0K3Cn0m0LlooL1bgs+2XFfZJwLd2QmFcpgqANpbYHXxKYXJRTtr/IY5 54ykV2o0Lwwn2FjqEAhg5xUQj9vmNHZ24yruwhr6w7w6Nw/fz8WwRIg/HvWqz6JmzNTK NGvIyAFIELJm2LZ539C/VM+BNa1k9PKPHXKVhOxVPtyXRJBTFys9lI3XaxtMM3MXeo/N as6NuVHKMzRAOzFJ9NXZBZFLeLvQptX86wJ0CeHmULxbgBk9ACo8WuXLMj05/Bnsad29 hBMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709036515; x=1709641315; 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=Fox2FOTrnn7H7ARtUpilsDQjBFro1sbb1UtQfPOSFHk=; b=ORaDPDU3Q8bS1BELr03MKuDVXpuQJnI+0mXvdx6X+mpVtNTO2lAvqzG6A38yDDmPC3 ehUpIbBQlF/4BGb0es+L1pBM9UU2U94FYtTgh2uo7cXS4tlHYdwNIdV2YpLowEhDoQZW j55IjDI+lERw45VT5gh3LoTqbXPPMoU/NE4XXrGmu1cAx5lEyTuWuRIsLYDGcX+Car7m yunE+TqlcewT8eWR8zrniSxHM9AYC19cThkc845jKqp5eRftKMXsB6LhVH9CowHVceUy 7kOQi5G/3okpmug0OF2XgZh10DLUT14kYGYjPzAcxfVi39p9hNFrEBg5tkW+vcp8alub F0Pw== X-Forwarded-Encrypted: i=1; AJvYcCX3XtIjvfR5e8H0g0p962taLqlhwt3WmhsDS0vC4cJjBjqtGp93xGjXuHO62t0T1ZBnF5d20LQECnPBcGazbpxkuQXoOyEcRmok6t4= X-Gm-Message-State: AOJu0YwjUkoNOU4jJ9iRj0SqJ+8orC2R1g+UNfVh1BFZQz8k8Fq0jQDI OyT8j1Y8NRFmrORcBFr4rUu18MwFtEZHlT9gtUsvADLBmAk+7CUbIIkaovqKaQ== X-Google-Smtp-Source: AGHT+IHOZyIvtu9udPjddxeRBkjckef05G60ZrgUBTNS/Hn/UgLmDOmQzD5ShaYiOTnnINlgtxpJEw== X-Received: by 2002:a17:903:181:b0:1dc:b173:f27b with SMTP id z1-20020a170903018100b001dcb173f27bmr4528891plg.32.1709036515334; Tue, 27 Feb 2024 04:21:55 -0800 (PST) Received: from thinkpad ([117.213.97.177]) by smtp.gmail.com with ESMTPSA id h8-20020a170902b94800b001dba356b96esm1406270pls.306.2024.02.27.04.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 04:21:54 -0800 (PST) Date: Tue, 27 Feb 2024 17:51:41 +0530 From: Manivannan Sadhasivam To: Frank Li 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 , 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, Niklas Cassel Subject: Re: [PATCH v8 06/10] PCI: dwc: ep: Call dw_pcie_ep_init_registers() API directly from all glue drivers Message-ID: <20240227122141.GN2587@thinkpad> References: <20240224-pci-dbi-rework-v8-0-64c7fd0cfe64@linaro.org> <20240224-pci-dbi-rework-v8-6-64c7fd0cfe64@linaro.org> 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 Mon, Feb 26, 2024 at 12:04:33PM -0500, Frank Li wrote: > On Sat, Feb 24, 2024 at 12:24:12PM +0530, Manivannan Sadhasivam wrote: > > Currently, dw_pcie_ep_init_registers() API is directly called by the glue > > drivers requiring active refclk from host. But for the other drivers, it is > > getting called implicitly by dw_pcie_ep_init(). This is due to the fact > > that this API initializes DWC EP specific registers and that requires an > > active refclk (either from host or generated locally by endpoint itsef). > > > > But, this causes a discrepancy among the glue drivers. So to avoid this > > confusion, let's call this API directly from all glue drivers irrespective > > of refclk dependency. Only difference here is that the drivers requiring > > refclk from host will call this API only after the refclk is received and > > other drivers without refclk dependency will call this API right after > > dw_pcie_ep_init(). > > > > This change will also allow us to remove the "core_init_notifier" flag in > > the later commits. > > > > Signed-off-by: Manivannan Sadhasivam > > --- > > drivers/pci/controller/dwc/pci-dra7xx.c | 7 +++++++ > > drivers/pci/controller/dwc/pci-imx6.c | 8 ++++++++ > > drivers/pci/controller/dwc/pci-keystone.c | 9 +++++++++ > > drivers/pci/controller/dwc/pci-layerscape-ep.c | 7 +++++++ > > drivers/pci/controller/dwc/pcie-designware-ep.c | 22 ---------------------- > > drivers/pci/controller/dwc/pcie-designware-plat.c | 9 +++++++++ > > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 12 +++++++++++- > > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 13 ++++++++++++- > > 8 files changed, 63 insertions(+), 24 deletions(-) [...] > > diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c > > index ed1f2afd830a..278bdc9b2269 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware-ep.c > > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c > > @@ -729,7 +729,6 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) > > struct device *dev = pci->dev; > > struct platform_device *pdev = to_platform_device(dev); > > struct device_node *np = dev->of_node; > > - const struct pci_epc_features *epc_features; > > > > INIT_LIST_HEAD(&ep->func_list); > > > > @@ -775,29 +774,8 @@ int dw_pcie_ep_init(struct dw_pcie_ep *ep) > > goto err_exit_epc_mem; > > } > > > > - if (ep->ops->get_features) { > > - epc_features = ep->ops->get_features(ep); > > - if (epc_features->core_init_notifier) > > - return 0; > > - } > > why remove this check? > There is no point in keeping this check since we are removing the call to dw_pcie_ep_init_registers() below. But I should've described this change in the commit message. - Mani -- மணிவண்ணன் சதாசிவம்