lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250903185625.GA1213441@bhelgaas>
Date: Wed, 3 Sep 2025 13:56:25 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Manivannan Sadhasivam <mani@...nel.org>
Cc: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>,
	cros-qcom-dts-watchers@...omium.org,
	Bjorn Andersson <andersson@...nel.org>,
	Konrad Dybcio <konradybcio@...nel.org>,
	Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Krzysztof Wilczyński <kwilczynski@...nel.org>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Jingoo Han <jingoohan1@...il.com>, linux-arm-msm@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pci@...r.kernel.org, quic_vbadigan@...cinc.com,
	quic_mrana@...cinc.com, quic_vpernami@...cinc.com,
	mmareddy@...cinc.com
Subject: Re: [PATCH v8 2/5] PCI: dwc: Add support for ELBI resource mapping

On Mon, Sep 01, 2025 at 07:18:17PM +0530, Manivannan Sadhasivam wrote:
> On Thu, Aug 28, 2025 at 01:04:23PM GMT, Krishna Chaitanya Chundru wrote:
> > External Local Bus Interface(ELBI) registers are optional registers in
> > DWC IPs having vendor specific registers.
> > 
> > Since ELBI register space is applicable for all DWC based controllers,
> > move the resource get code to DWC core and make it optional.
> 
> As discussed offline, this changes also warrants switching the glue
> drivers to use 'dw_pci::elbi' base instead of their own. So I've
> ammended this commit to include those changes also while applying
> (which was straightforward).

I'm glad if we can do this in the DWC core instead of individual
drivers, but in the case of qcom, this changes the mapping from using
devm_pci_remap_cfgspace() to using devm_ioremap_resource():

  qcom_pcie_ep_get_io_resources
    platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi")
    devm_pci_remap_cfg_resource
      devm_pci_remap_cfgspace
        pci_remap_cfgspace
          ioremap_np                  # (except on arch/arm)

  dw_pcie_get_resources
    platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi")
    devm_ioremap_resource
      __devm_ioremap_resource(..., DEVM_IOREMAP)
        __devm_ioremap
          switch (type)
          case DEVM_IOREMAP: ioremap

I assume this change from ioremap_np() to ioremap() is fine, but
please verify and update the commit log to mention this change and
explain why it's ok.

(I don't think the qcom changes were posted to the mailing list; you
can see them here:
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=controller/dwc-ecam&id=d39e0103e38f9889271a77a837b6179b42d6730d)

> > Suggested-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> > Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>
> > ---
> >  drivers/pci/controller/dwc/pcie-designware.c | 9 +++++++++
> >  drivers/pci/controller/dwc/pcie-designware.h | 1 +
> >  2 files changed, 10 insertions(+)
> > 
> > diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
> > index 89aad5a08928cc29870ab258d33bee9ff8f83143..4684c671a81bee468f686a83cc992433b38af59d 100644
> > --- a/drivers/pci/controller/dwc/pcie-designware.c
> > +++ b/drivers/pci/controller/dwc/pcie-designware.c
> > @@ -167,6 +167,15 @@ int dw_pcie_get_resources(struct dw_pcie *pci)
> >  		}
> >  	}
> >  
> > +	if (!pci->elbi_base) {
> > +		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "elbi");
> > +		if (res) {
> > +			pci->elbi_base = devm_ioremap_resource(pci->dev, res);
> > +			if (IS_ERR(pci->elbi_base))
> > +				return PTR_ERR(pci->elbi_base);
> > +		}
> > +	}
> > +
> >  	/* LLDD is supposed to manually switch the clocks and resets state */
> >  	if (dw_pcie_cap_is(pci, REQ_RES)) {
> >  		ret = dw_pcie_get_clocks(pci);
> > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
> > index 00f52d472dcdd794013a865ad6c4c7cc251edb48..ceb022506c3191cd8fe580411526e20cc3758fed 100644
> > --- a/drivers/pci/controller/dwc/pcie-designware.h
> > +++ b/drivers/pci/controller/dwc/pcie-designware.h
> > @@ -492,6 +492,7 @@ struct dw_pcie {
> >  	resource_size_t		dbi_phys_addr;
> >  	void __iomem		*dbi_base2;
> >  	void __iomem		*atu_base;
> > +	void __iomem		*elbi_base;
> >  	resource_size_t		atu_phys_addr;
> >  	size_t			atu_size;
> >  	resource_size_t		parent_bus_offset;
> > 
> > -- 
> > 2.34.1
> > 
> 
> -- 
> மணிவண்ணன் சதாசிவம்

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ