• Ido Schimmel's avatar
    PCI: Add debug print for device ready delay · 0a5ef959
    Ido Schimmel authored
    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: default avatarIdo Schimmel <idosch@nvidia.com>
    Acked-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
    Reviewed-by: default avatarSimon Horman <horms@kernel.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    0a5ef959
pci.c 185 KB