From: Simon Horman <horms@kernel.org>
To: Petr Machata <petrm@nvidia.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, Ido Schimmel <idosch@nvidia.com>,
Amit Cohen <amcohen@nvidia.com>,
mlxsw@nvidia.com, Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org
Subject: Re: [PATCH net-next 08/14] PCI: Add debug print for device ready delay
Date: Fri, 17 Nov 2023 15:23:11 +0000 [thread overview]
Message-ID: <20231117152311.GC164483@vergenet.net> (raw)
In-Reply-To: <63fca173195f5a9d3a2b78da700650a29cf80f96.1700047319.git.petrm@nvidia.com>
+ linux-pci@vger.kernel.org
On Wed, Nov 15, 2023 at 01:17:17PM +0100, Petr Machata wrote:
> From: Ido Schimmel <idosch@nvidia.com>
>
> Currently, the time it took a PCI device to become ready after reset is
> only printed if it was longer than 1000ms ('PCI_RESET_WAIT'). However,
> for debugging purposes it is useful to know this time even if it was
> shorter. For example, with the device I am working on, hardware
> engineers asked to verify that it becomes ready on the first try (no
> delay).
>
> To that end, add a debug level print that can be enabled using dynamic
> debug. Example:
>
> # echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/reset
> # dmesg -c | grep ready
> # echo "file drivers/pci/pci.c +p" > /sys/kernel/debug/dynamic_debug/control
> # echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/reset
> # dmesg -c | grep ready
> [ 396.060335] mlxsw_spectrum4 0000:01:00.0: ready 0ms after bus reset
> # echo "file drivers/pci/pci.c -p" > /sys/kernel/debug/dynamic_debug/control
> # echo 1 > /sys/bus/pci/devices/0000\:01\:00.0/reset
> # dmesg -c | grep ready
>
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
> ---
> drivers/pci/pci.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 55bc3576a985..69d20d585f88 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -1219,6 +1219,9 @@ static int pci_dev_wait(struct pci_dev *dev, char *reset_type, int timeout)
> if (delay > PCI_RESET_WAIT)
> pci_info(dev, "ready %dms after %s\n", delay - 1,
> reset_type);
> + else
> + pci_dbg(dev, "ready %dms after %s\n", delay - 1,
> + reset_type);
>
> return 0;
> }
> --
> 2.41.0
>
prev parent reply other threads:[~2023-11-17 15:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1700047319.git.petrm@nvidia.com>
[not found] ` <fe4156c6b9d0f7e8478ae93137586ec88051013d.1700047319.git.petrm@nvidia.com>
2023-11-17 15:21 ` [PATCH net-next 07/14] PCI: Add no PM reset quirk for NVIDIA Spectrum devices Simon Horman
[not found] ` <63fca173195f5a9d3a2b78da700650a29cf80f96.1700047319.git.petrm@nvidia.com>
2023-11-17 15:23 ` Simon Horman [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=20231117152311.GC164483@vergenet.net \
--to=horms@kernel.org \
--cc=amcohen@nvidia.com \
--cc=bhelgaas@google.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mlxsw@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=petrm@nvidia.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