* [PATCH] PCI/AER: Print error message as per the TODO @ 2024-04-15 16:10 Abhinav Jain 2024-04-15 16:19 ` Joe Perches 2024-06-05 21:23 ` [PATCH v2] " Abhinav Jain 0 siblings, 2 replies; 5+ messages in thread From: Abhinav Jain @ 2024-04-15 16:10 UTC (permalink / raw) To: mahesh, oohall, bhelgaas, linuxppc-dev, linux-pci, linux-kernel Cc: skhan, javier.carrasco.cruz, Abhinav Jain Add a pr_err() to print the add device error in find_device_iter() Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com> --- drivers/pci/pcie/aer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index ac6293c24976..0e1ad2998116 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -885,7 +885,8 @@ static int find_device_iter(struct pci_dev *dev, void *data) /* List this device */ if (add_error_device(e_info, dev)) { /* We cannot handle more... Stop iteration */ - /* TODO: Should print error message here? */ + pr_err("find_device_iter: Cannot handle more devices. + Stopping iteration"); return 1; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] PCI/AER: Print error message as per the TODO 2024-04-15 16:10 [PATCH] PCI/AER: Print error message as per the TODO Abhinav Jain @ 2024-04-15 16:19 ` Joe Perches 2024-06-05 21:23 ` [PATCH v2] " Abhinav Jain 1 sibling, 0 replies; 5+ messages in thread From: Joe Perches @ 2024-04-15 16:19 UTC (permalink / raw) To: Abhinav Jain, mahesh, oohall, bhelgaas, linuxppc-dev, linux-pci, linux-kernel Cc: skhan, javier.carrasco.cruz On Mon, 2024-04-15 at 16:10 +0000, Abhinav Jain wrote: > Add a pr_err() to print the add device error in find_device_iter() [] > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c [] > @@ -885,7 +885,8 @@ static int find_device_iter(struct pci_dev *dev, void *data) > /* List this device */ > if (add_error_device(e_info, dev)) { > /* We cannot handle more... Stop iteration */ > - /* TODO: Should print error message here? */ > + pr_err("find_device_iter: Cannot handle more devices. > + Stopping iteration"); You are adding unnecessary whitespace after the period. String concatenation keeps _all_ the whitespace. The format is fine on a single line too. Something like: pr_notice("%s: Cannot handle more devices - iteration stopped\n", __func__); ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] PCI/AER: Print error message as per the TODO 2024-04-15 16:10 [PATCH] PCI/AER: Print error message as per the TODO Abhinav Jain 2024-04-15 16:19 ` Joe Perches @ 2024-06-05 21:23 ` Abhinav Jain 2024-06-05 21:58 ` Bjorn Helgaas 1 sibling, 1 reply; 5+ messages in thread From: Abhinav Jain @ 2024-06-05 21:23 UTC (permalink / raw) To: jain.abhinav177 Cc: bhelgaas, javier.carrasco.cruz, linux-kernel, linux-pci, linuxppc-dev, mahesh, oohall, skhan Print the add device error in find_device_iter() Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com> PATCH v1 link : https://lore.kernel.org/all/20240415161055.8316-1-jain.abhinav177@gmail.com/ Changes since v1: - Replaced pr_err() with pr_notice() - Removed unncessary whitespaces --- drivers/pci/pcie/aer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 0e1ad2998116..8b820a74dd6b 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -885,8 +885,8 @@ static int find_device_iter(struct pci_dev *dev, void *data) /* List this device */ if (add_error_device(e_info, dev)) { /* We cannot handle more... Stop iteration */ - pr_err("find_device_iter: Cannot handle more devices. - Stopping iteration"); + pr_notice("%s: Cannot handle more devices - iteration stopped\n", + __func__); return 1; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] PCI/AER: Print error message as per the TODO 2024-06-05 21:23 ` [PATCH v2] " Abhinav Jain @ 2024-06-05 21:58 ` Bjorn Helgaas 2024-06-05 23:11 ` Abhinav Jain 0 siblings, 1 reply; 5+ messages in thread From: Bjorn Helgaas @ 2024-06-05 21:58 UTC (permalink / raw) To: Abhinav Jain Cc: bhelgaas, javier.carrasco.cruz, linux-kernel, linux-pci, linuxppc-dev, mahesh, oohall, skhan On Wed, Jun 05, 2024 at 09:23:44PM +0000, Abhinav Jain wrote: > Print the add device error in find_device_iter() > > Signed-off-by: Abhinav Jain <jain.abhinav177@gmail.com> > > PATCH v1 link : https://lore.kernel.org/all/20240415161055.8316-1-jain.abhinav177@gmail.com/ > > Changes since v1: > - Replaced pr_err() with pr_notice() > - Removed unncessary whitespaces > --- Thanks for looking at this. - It doesn't apply to -rc1 (the TODO message is missing). In PCI, we normally apply patches on topic branches based on -rc1. - The subject should be more specific so it makes sense all by itself, e.g., "Log note if we find too many devices with errors" - Add period at end of sentence in commit log. - Move historical notes (v1 URL, changes since v1) below the "---" line so they don't get included in the commit log. - __func__ is not relevant here -- that's generally a debugging thing. We can find the function by searching for the message text. In cases like this, I'd rather have something that helps identify a *device* that's related to the message, e.g., the pci_dev in this case. So I'd suggest pci_err(dev, "...") here. - I'd keep pci_err() instead of switching to pr_notice(). If we get this message, we should re-think the way we collect this information, so I want to hear about it. > drivers/pci/pcie/aer.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index 0e1ad2998116..8b820a74dd6b 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -885,8 +885,8 @@ static int find_device_iter(struct pci_dev *dev, void *data) > /* List this device */ > if (add_error_device(e_info, dev)) { > /* We cannot handle more... Stop iteration */ > - pr_err("find_device_iter: Cannot handle more devices. > - Stopping iteration"); > + pr_notice("%s: Cannot handle more devices - iteration stopped\n", > + __func__); > return 1; > } > > -- > 2.34.1 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] PCI/AER: Print error message as per the TODO 2024-06-05 21:58 ` Bjorn Helgaas @ 2024-06-05 23:11 ` Abhinav Jain 0 siblings, 0 replies; 5+ messages in thread From: Abhinav Jain @ 2024-06-05 23:11 UTC (permalink / raw) To: helgaas Cc: bhelgaas, jain.abhinav177, javier.carrasco.cruz, linux-kernel, linux-pci, linuxppc-dev, mahesh, oohall, skhan On Wed, 5 Jun 2024 16:58:48 -0500, Bjorn Helgaas wrote: > - It doesn't apply to -rc1 (the TODO message is missing). In PCI, > we normally apply patches on topic branches based on -rc1. Thank you for the detailed feedback. I was looking at mainline only. > - The subject should be more specific so it makes sense all by > itself, e.g., "Log note if we find too many devices with errors" > - Add period at end of sentence in commit log. > - Move historical notes (v1 URL, changes since v1) below the "---" > line so they don't get included in the commit log. I have included these changes to the v3. Please find it here: https://lore.kernel.org/all/20240605230954.22911-1-jain.abhinav177@gmail.com/ > - __func__ is not relevant here -- that's generally a debugging > thing. We can find the function by searching for the message > text. In cases like this, I'd rather have something that helps > identify a *device* that's related to the message, e.g., the > pci_dev in this case. So I'd suggest pci_err(dev, "...") here. > - I'd keep pci_err() instead of switching to pr_notice(). If we get > this message, we should re-think the way we collect this > information, so I want to hear about it. I understand, this helped me get a clear picture of what needs to be done. I have accordingly added two pci_err for the same. Please review. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-05 23:12 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-04-15 16:10 [PATCH] PCI/AER: Print error message as per the TODO Abhinav Jain 2024-04-15 16:19 ` Joe Perches 2024-06-05 21:23 ` [PATCH v2] " Abhinav Jain 2024-06-05 21:58 ` Bjorn Helgaas 2024-06-05 23:11 ` Abhinav Jain
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox