[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231117152311.GC164483@vergenet.net>
Date: Fri, 17 Nov 2023 15:23:11 +0000
From: Simon Horman <horms@...nel.org>
To: Petr Machata <petrm@...dia.com>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org, Ido Schimmel <idosch@...dia.com>,
Amit Cohen <amcohen@...dia.com>, mlxsw@...dia.com,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org
Subject: Re: [PATCH net-next 08/14] PCI: Add debug print for device ready
delay
+ linux-pci@...r.kernel.org
On Wed, Nov 15, 2023 at 01:17:17PM +0100, Petr Machata wrote:
> From: Ido Schimmel <idosch@...dia.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@...dia.com>
> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
> Signed-off-by: Petr Machata <petrm@...dia.com>
Reviewed-by: Simon Horman <horms@...nel.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
>
Powered by blists - more mailing lists