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] [day] [month] [year] [list]
Message-ID: <Z9LsdEmMiRvRopKS@lizhi-Precision-Tower-5810>
Date: Thu, 13 Mar 2025 10:32:20 -0400
From: Frank Li <Frank.li@....com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Saravana Kannan <saravanak@...gle.com>,
	Jingoo Han <jingoohan1@...il.com>,
	Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>,
	Lorenzo Pieralisi <lpieralisi@...nel.org>,
	Krzysztof WilczyƄski <kw@...ux.com>,
	Bjorn Helgaas <bhelgaas@...gle.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>, devicetree@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, imx@...ts.linux.dev,
	Niklas Cassel <cassel@...nel.org>
Subject: Re: [PATCH v10 08/10] PCI: dwc: Print warning message when
 cpu_addr_fixup() exists

On Wed, Mar 12, 2025 at 05:04:24PM -0500, Bjorn Helgaas wrote:
> On Mon, Mar 10, 2025 at 04:16:46PM -0400, Frank Li wrote:
> > If the parent 'ranges' property in DT correctly describes the address
> > translation, the cpu_addr_fixup() callback is not needed. Print a warning
> > message to inform users to correct their DT files.
>
> > +++ b/drivers/pci/controller/dwc/pcie-designware.c
> > @@ -1125,6 +1125,8 @@ int dw_pcie_init_parent_bus_offset(struct dw_pcie *pci, const char *reg_name,
> >
> >  	fixup = pci->ops->cpu_addr_fixup;
> >  	if (fixup) {
> > +		dev_warn_once(pci->dev, "cpu_addr_fixup() usage detected. Please fix DT!\n");
>
> I don't think we need this.  The mere presence of .cpu_addr_fixup()
> doesn't tell us the DT is broken.  When we have .cpu_addr_fixup(), the
> DT is only broken if DT tells us something different than
> .cpu_addr_fixup() tells us.  And we already warn about that in the
> "reg_addr != fixup_addr" case.

It is encourage people to fix dts first and remove .cpu_addr_fixup().
Most case below "...redundant" is not printed at all at most case, even
there are .cpu_addr_fixup().

>
> > +
> >  		fixup_addr = fixup(pci, cpu_phy_addr);
> >  		if (reg_addr == fixup_addr) {
> >  			dev_info(dev, "%#010llx %s reg[%d] == %#010llx; %ps is redundant\n",
>
> This message is really just a hint that DT is fine and
> .cpu_addr_fixup() is redundant but harmless.  If you want a dev_warn()
> here to encourage people to remove .cpu_addr_fixup(), I'm fine with
> that.

It is encourage people remove .cpu_addr_fixup() because dts already fixed.

>
> Seems like "dev_warn()" would be enough, probably no need for
> "dev_warn_once()" since we should only run this once per controller
> anyway, so I don't think we'll get spammed with messages.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ