Skip to content

Commit 800ce27

Browse files
committed
PCI: Log debug messages about reset method
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 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Dave Jiang <[email protected]>
1 parent 2014c95 commit 800ce27

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pci/pci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5230,6 +5230,7 @@ const struct pci_reset_fn_method pci_reset_fn_methods[] = {
52305230
int __pci_reset_function_locked(struct pci_dev *dev)
52315231
{
52325232
int i, m, rc;
5233+
const struct pci_reset_fn_method *method;
52335234

52345235
might_sleep();
52355236

@@ -5246,9 +5247,13 @@ int __pci_reset_function_locked(struct pci_dev *dev)
52465247
if (!m)
52475248
return -ENOTTY;
52485249

5249-
rc = pci_reset_fn_methods[m].reset_fn(dev, PCI_RESET_DO_RESET);
5250+
method = &pci_reset_fn_methods[m];
5251+
pci_dbg(dev, "reset via %s\n", method->name);
5252+
rc = method->reset_fn(dev, PCI_RESET_DO_RESET);
52505253
if (!rc)
52515254
return 0;
5255+
5256+
pci_dbg(dev, "%s failed with %d\n", method->name, rc);
52525257
if (rc != -ENOTTY)
52535258
return rc;
52545259
}

0 commit comments

Comments
 (0)