* [PATCH 1/1] PCI: Do not claim to release resource falsely
@ 2025-03-07 14:09 Ilpo Järvinen
2025-03-07 16:57 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Ilpo Järvinen @ 2025-03-07 14:09 UTC (permalink / raw)
To: Krzysztof Wilczyński, Bjorn Helgaas, linux-pci, linux-kernel
Cc: Ilpo Järvinen
pci_release_resource() will print "... releasing" regardless of the
resource being assigned or not. Move the print after the res->parent
check to avoid claiming the kernel would be releasing an unassigned
resource.
Likely, none of the current callers pass a resource that is unassigned so
this change is mostly to correct the non-sensical order than to remove
errorneous printouts.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/pci/setup-res.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
index ca14576bf2bf..21719ae29a34 100644
--- a/drivers/pci/setup-res.c
+++ b/drivers/pci/setup-res.c
@@ -414,11 +414,11 @@ void pci_release_resource(struct pci_dev *dev, int resno)
struct resource *res = dev->resource + resno;
const char *res_name = pci_resource_name(dev, resno);
- pci_info(dev, "%s %pR: releasing\n", res_name, res);
-
if (!res->parent)
return;
+ pci_info(dev, "%s %pR: releasing\n", res_name, res);
+
release_resource(res);
res->end = resource_size(res) - 1;
res->start = 0;
base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
prerequisite-patch-id: e4a2c15d0cd3241e2fdb1af98510211e63ec3d06
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] PCI: Do not claim to release resource falsely
2025-03-07 14:09 [PATCH 1/1] PCI: Do not claim to release resource falsely Ilpo Järvinen
@ 2025-03-07 16:57 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2025-03-07 16:57 UTC (permalink / raw)
To: Ilpo Järvinen
Cc: Krzysztof Wilczyński, Bjorn Helgaas, linux-pci, linux-kernel
On Fri, Mar 07, 2025 at 04:09:22PM +0200, Ilpo Järvinen wrote:
> pci_release_resource() will print "... releasing" regardless of the
> resource being assigned or not. Move the print after the res->parent
> check to avoid claiming the kernel would be releasing an unassigned
> resource.
>
> Likely, none of the current callers pass a resource that is unassigned so
> this change is mostly to correct the non-sensical order than to remove
> errorneous printouts.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Applied to pci/resource for v6.15, thanks!
> ---
> drivers/pci/setup-res.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c
> index ca14576bf2bf..21719ae29a34 100644
> --- a/drivers/pci/setup-res.c
> +++ b/drivers/pci/setup-res.c
> @@ -414,11 +414,11 @@ void pci_release_resource(struct pci_dev *dev, int resno)
> struct resource *res = dev->resource + resno;
> const char *res_name = pci_resource_name(dev, resno);
>
> - pci_info(dev, "%s %pR: releasing\n", res_name, res);
> -
> if (!res->parent)
> return;
>
> + pci_info(dev, "%s %pR: releasing\n", res_name, res);
> +
> release_resource(res);
> res->end = resource_size(res) - 1;
> res->start = 0;
>
> base-commit: 2014c95afecee3e76ca4a56956a936e23283f05b
> prerequisite-patch-id: e4a2c15d0cd3241e2fdb1af98510211e63ec3d06
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-03-07 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-07 14:09 [PATCH 1/1] PCI: Do not claim to release resource falsely Ilpo Järvinen
2025-03-07 16:57 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox