Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: linux-pci@vger.kernel.org
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Keith Busch" <kbusch@kernel.org>, "Todd Kjos" <tkjos@google.com>,
	"Dan Williams" <dan.j.williams@intel.com>,
	"Dave Jiang" <dave.jiang@intel.com>,
	linux-kernel@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH] PCI: Log debug messages about reset method
Date: Mon, 10 Mar 2025 13:43:00 -0500	[thread overview]
Message-ID: <20250310184300.GA561876@bhelgaas> (raw)
In-Reply-To: <20250303204220.197172-1-helgaas@kernel.org>

On Mon, Mar 03, 2025 at 02:42:20PM -0600, Bjorn Helgaas wrote:
> From: Bjorn Helgaas <bhelgaas@google.com>
> 
> Log pci_dbg() messages about the reset methods we attempt and any errors
> (-ENOTTY means "try the next method").
> 
> Set CONFIG_DYNAMIC_DEBUG=y and enable by booting with
> dyndbg="file drivers/pci/* +p" or enable at runtime:
> 
>   # echo "file drivers/pci/* +p" > /sys/kernel/debug/dynamic_debug/control
> 
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Applied to pci/reset for v6.15.

> ---
>  drivers/pci/pci.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 869d204a70a3..3d13bb8e5c53 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -5230,6 +5230,7 @@ const struct pci_reset_fn_method pci_reset_fn_methods[] = {
>  int __pci_reset_function_locked(struct pci_dev *dev)
>  {
>  	int i, m, rc;
> +	const struct pci_reset_fn_method *method;
>  
>  	might_sleep();
>  
> @@ -5246,9 +5247,13 @@ int __pci_reset_function_locked(struct pci_dev *dev)
>  		if (!m)
>  			return -ENOTTY;
>  
> -		rc = pci_reset_fn_methods[m].reset_fn(dev, PCI_RESET_DO_RESET);
> +		method = &pci_reset_fn_methods[m];
> +		pci_dbg(dev, "reset via %s\n", method->name);
> +		rc = method->reset_fn(dev, PCI_RESET_DO_RESET);
>  		if (!rc)
>  			return 0;
> +
> +		pci_dbg(dev, "%s failed with %d\n", method->name, rc);
>  		if (rc != -ENOTTY)
>  			return rc;
>  	}
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2025-03-10 18:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-03 20:42 [PATCH] PCI: Log debug messages about reset method Bjorn Helgaas
2025-03-03 21:08 ` Dave Jiang
2025-03-10 18:43 ` 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=20250310184300.GA561876@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=alex.williamson@redhat.com \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=tkjos@google.com \
    /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