Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] PCI: Do not claim to release resource falsely
Date: Fri, 7 Mar 2025 10:57:47 -0600	[thread overview]
Message-ID: <20250307165747.GA412364@bhelgaas> (raw)
In-Reply-To: <20250307140922.5776-1-ilpo.jarvinen@linux.intel.com>

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
> 

      reply	other threads:[~2025-03-07 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250307165747.GA412364@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox