[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240308053624.GB3789@thinkpad>
Date: Fri, 8 Mar 2024 11:06:24 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Niklas Cassel <cassel@...nel.org>
Cc: Jingoo Han <jingoohan1@...il.com>,
Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>,
Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Kishon Vijay Abraham I <kishon@...com>,
Vidya Sagar <vidyas@...dia.com>,
Vignesh Raghavendra <vigneshr@...com>,
Richard Zhu <hongxing.zhu@....com>,
Lucas Stach <l.stach@...gutronix.de>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Minghuan Lian <minghuan.Lian@....com>,
Mingkai Hu <mingkai.hu@....com>, Roy Zang <roy.zang@....com>,
Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
Masami Hiramatsu <mhiramat@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Jesper Nilsson <jesper.nilsson@...s.com>,
Srikanth Thokala <srikanth.thokala@...el.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-omap@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
linux-arm-kernel@...s.com
Subject: Re: [PATCH v9 06/10] PCI: dwc: ep: Call dw_pcie_ep_init_registers()
API directly from all glue drivers
On Thu, Mar 07, 2024 at 09:36:56PM +0100, Niklas Cassel wrote:
> On Mon, Mar 04, 2024 at 02:52:18PM +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().
> >
> > With this change, the check for 'core_init_notifier' flag can now be
> > dropped from dw_pcie_ep_init() API. This will also allow us to remove the
> > 'core_init_notifier' flag completely in the later commits.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > ---
> > 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-artpec6.c | 13 ++++++++++++-
> > drivers/pci/controller/dwc/pcie-designware-ep.c | 22 ----------------------
> > drivers/pci/controller/dwc/pcie-designware-plat.c | 9 +++++++++
> > drivers/pci/controller/dwc/pcie-keembay.c | 16 +++++++++++++++-
> > drivers/pci/controller/dwc/pcie-rcar-gen4.c | 12 +++++++++++-
> > drivers/pci/controller/dwc/pcie-uniphier-ep.c | 13 ++++++++++++-
> > 10 files changed, 90 insertions(+), 26 deletions(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
> > index 0e406677060d..395042b29ffc 100644
> > --- a/drivers/pci/controller/dwc/pci-dra7xx.c
> > +++ b/drivers/pci/controller/dwc/pci-dra7xx.c
> > @@ -467,6 +467,13 @@ static int dra7xx_add_pcie_ep(struct dra7xx_pcie *dra7xx,
> > return ret;
> > }
> >
> > + ret = dw_pcie_ep_init_registers(ep);
> > + if (ret) {
>
> Here you are using if (ret) to error check the return from
> dw_pcie_ep_init_registers().
>
>
> > index c0c62533a3f1..8392894ed286 100644
> > --- a/drivers/pci/controller/dwc/pci-keystone.c
> > +++ b/drivers/pci/controller/dwc/pci-keystone.c
> > @@ -1286,6 +1286,13 @@ static int ks_pcie_probe(struct platform_device *pdev)
> > ret = dw_pcie_ep_init(&pci->ep);
> > if (ret < 0)
> > goto err_get_sync;
> > +
> > + ret = dw_pcie_ep_init_registers(&pci->ep);
> > + if (ret < 0) {
>
> Here you are using if (ret < 0) to error check the return from
> dw_pcie_ep_init_registers(). Please be consistent.
>
I maintained the consistency w.r.t individual drivers. Please check them
individually.
If I maintain consistency w.r.t this patch, then the style will change within
the drivers.
- Mani
>
> > diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c b/drivers/pci/controller/dwc/pcie-artpec6.c
> > index 9ed0a9ba7619..0edd9ab3f139 100644
> > --- a/drivers/pci/controller/dwc/pcie-artpec6.c
> > +++ b/drivers/pci/controller/dwc/pcie-artpec6.c
> > @@ -441,7 +441,18 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
> >
> > pci->ep.ops = &pcie_ep_ops;
> >
> > - return dw_pcie_ep_init(&pci->ep);
> > + ret = dw_pcie_ep_init(&pci->ep);
> > + if (ret < 0)
>
> Here you are using if (ret < 0) to error check the return from
> dw_pcie_ep_init().
>
>
> > index 778588b4be70..ca9b22e654cd 100644
> > --- a/drivers/pci/controller/dwc/pcie-designware-plat.c
> > +++ b/drivers/pci/controller/dwc/pcie-designware-plat.c
> > @@ -145,6 +145,15 @@ static int dw_plat_pcie_probe(struct platform_device *pdev)
> >
> > pci->ep.ops = &pcie_ep_ops;
> > ret = dw_pcie_ep_init(&pci->ep);
> > + if (ret)
>
> Here you are using if (ret) to error check the return from
> dw_pcie_ep_init(). Please be consistent.
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists