PCI: Log debug messages about reset method
PATCH 1/1 PCI: Log debug messages about reset method
From: Bjorn Helgaas <[email protected]>
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
--- drivers/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/pci/pci.c +6 -1
@@ -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; }
Signature · 1 line
2.34.1
Quoted 11 lines · Bjorn Helgaas
From: Bjorn Helgaas <[email protected]>
Log
pci_dbg()messages about the reset methods we attempt and any errors (-ENOTTYmeans "try the next method").Set
CONFIG_DYNAMIC_DEBUG=yand enable by booting with dyndbg="filedrivers/pci/*+p" or enable at runtime:# echo "file drivers/pci/* +p" > /sys/kernel/debug/dynamic_debug/controlSigned-off-by Bjorn Helgaas <[email protected]>
Quoted 31 lines
--- drivers/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/pci/pci.c +6
-1@@ -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; }
Bjorn Helgaas
AppliedQuoted 11 lines · Bjorn Helgaas
From: Bjorn Helgaas <[email protected]>
Log
pci_dbg()messages about the reset methods we attempt and any errors (-ENOTTYmeans "try the next method").Set
CONFIG_DYNAMIC_DEBUG=yand enable by booting with dyndbg="filedrivers/pci/*+p" or enable at runtime:# echo "file drivers/pci/* +p" > /sys/kernel/debug/dynamic_debug/controlSigned-off-by Bjorn Helgaas <[email protected]>
Applied to pci/reset for v6.15.
Quoted 34 lines
--- drivers/pci/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/pci/pci.c +6
-1@@ -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; }Signature · 1 line
2.34.1