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: <20250521193918.GA1437038@bhelgaas>
Date: Wed, 21 May 2025 14:39:18 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: linux-pci@...r.kernel.org, Jon Pan-Doh <pandoh@...gle.com>,
	Karolina Stolarek <karolina.stolarek@...cle.com>,
	Weinan Liu <wnliu@...gle.com>,
	Martin Petersen <martin.petersen@...cle.com>,
	Ben Fuller <ben.fuller@...cle.com>,
	Drew Walton <drewwalton@...rosoft.com>,
	Anil Agrawal <anilagrawal@...a.com>,
	Tony Luck <tony.luck@...el.com>,
	Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	Lukas Wunner <lukas@...ner.de>, Sargun Dhillon <sargun@...a.com>,
	"Paul E . McKenney" <paulmck@...nel.org>,
	Mahesh J Salgaonkar <mahesh@...ux.ibm.com>,
	Oliver O'Halloran <oohall@...il.com>,
	Kai-Heng Feng <kaihengf@...dia.com>,
	Keith Busch <kbusch@...nel.org>, Robert Richter <rrichter@....com>,
	Terry Bowman <terry.bowman@....com>,
	Shiju Jose <shiju.jose@...wei.com>,
	Dave Jiang <dave.jiang@...el.com>, linux-kernel@...r.kernel.org,
	linuxppc-dev@...ts.ozlabs.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH v7 04/17] PCI/AER: Consolidate Error Source ID logging in
 aer_isr_one_error_type()

On Wed, May 21, 2025 at 10:20:41AM +0100, Jonathan Cameron wrote:
> On Tue, 20 May 2025 16:50:21 -0500
> Bjorn Helgaas <helgaas@...nel.org> wrote:
> 
> > From: Bjorn Helgaas <bhelgaas@...gle.com>
> > 
> > Previously we decoded the AER Error Source ID in aer_isr_one_error_type(),
> > then again in find_source_device() if we didn't find any devices with
> > errors logged in their AER Capabilities.
> > 
> > Consolidate this so we only decode and log the Error Source ID once in
> > aer_isr_one_error_type().  Add a "details" parameter so we can add a note
> > when we didn't find any downstream devices with errors logged in their AER
> > Capability.
> > 
> > This changes the dmesg logging when we found no devices with errors logged:
> > 
> >   - pci 0000:00:01.0: AER: Correctable error message received from 0000:02:00.0
> >   - pci 0000:00:01.0: AER: found no error details for 0000:02:00.0
> >   + pci 0000:00:01.0: AER: Correctable error message received from 0000:02:00.0 (no details found)
> > 
> > Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
> 
> Nice little improvement.  I'll assume you reuse
> details later as otherwise passing a bool and creating
> the (no details found) in aer_print_port_info() would
> have been simpler to my eyes as it would have put all the
> string generation in one place.

Great idea!  Since there's only one caller, I think passing a bool is
much nicer.

> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@...wei.com>
> 
> > ---
> >  drivers/pci/pcie/aer.c | 22 +++++++++-------------
> >  1 file changed, 9 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> > index 568229288ca3..488a6408c7a8 100644
> > --- a/drivers/pci/pcie/aer.c
> > +++ b/drivers/pci/pcie/aer.c
> > @@ -733,16 +733,17 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
> >  			info->severity, info->tlp_header_valid, &info->tlp);
> >  }
> >  
> > -static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info)
> > +static void aer_print_port_info(struct pci_dev *dev, struct aer_err_info *info,
> > +				const char *details)
> >  {
> >  	u8 bus = info->id >> 8;
> >  	u8 devfn = info->id & 0xff;
> >  
> > -	pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d\n",
> > +	pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
> >  		 info->multi_error_valid ? "Multiple " : "",
> >  		 aer_error_severity_string[info->severity],
> >  		 pci_domain_nr(dev->bus), bus, PCI_SLOT(devfn),
> > -		 PCI_FUNC(devfn));
> > +		 PCI_FUNC(devfn), details);
> >  }
> >  
> >  #ifdef CONFIG_ACPI_APEI_PCIEAER
> > @@ -926,15 +927,8 @@ static bool find_source_device(struct pci_dev *parent,
> >  	else
> >  		pci_walk_bus(parent->subordinate, find_device_iter, e_info);
> >  
> > -	if (!e_info->error_dev_num) {
> > -		u8 bus = e_info->id >> 8;
> > -		u8 devfn = e_info->id & 0xff;
> > -
> > -		pci_info(parent, "found no error details for %04x:%02x:%02x.%d\n",
> > -			 pci_domain_nr(parent->bus), bus, PCI_SLOT(devfn),
> > -			 PCI_FUNC(devfn));
> > +	if (!e_info->error_dev_num)
> >  		return false;
> > -	}
> >  	return true;
> >  }
> >  
> > @@ -1281,9 +1275,11 @@ static inline void aer_process_err_devices(struct aer_err_info *e_info)
> >  static void aer_isr_one_error_type(struct pci_dev *root,
> >  				   struct aer_err_info *info)
> >  {
> > -	aer_print_port_info(root, info);
> > +	bool found;
> >  
> > -	if (find_source_device(root, info))
> > +	found = find_source_device(root, info);
> > +	aer_print_port_info(root, info, found ? "" : " (no details found");
> > +	if (found)
> >  		aer_process_err_devices(info);
> >  }
> >  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ