diff options
author | Frederick Lawler <fred@fredlawl.com> | 2019-05-07 19:24:52 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-05-09 17:45:20 -0400 |
commit | 017124725c155a3e1b09429d27c5846b0efafa89 (patch) | |
tree | 3110a2e1c4d4b71dc26e88e8810e36acc22ccdf7 /drivers/pci/hotplug | |
parent | 7e696b8ae9a7f939584284a12eec3b7c62123836 (diff) |
PCI: pciehp: Replace pciehp_debug module param with dyndbg
Previously pciehp debug messages were enabled by the pciehp_debug module
parameter, e.g., by booting with this kernel command line option:
pciehp.pciehp_debug=1
Convert this mechanism to use the generic dynamic debug (dyndbg) feature.
After this commit, pciehp debug messages are enabled by building the kernel
with CONFIG_DYNAMIC_DEBUG=y and booting with this command line option:
dyndbg="file pciehp* +p"
The dyndbg facility is much more flexible: messages can be enabled at boot-
or run-time based on the file name, function name, line number, message
test, etc. See Documentation/admin-guide/dynamic-debug-howto.rst for more
details.
Link: https://lore.kernel.org/lkml/20190509141456.223614-7-helgaas@kernel.org
Signed-off-by: Frederick Lawler <fred@fredlawl.com>
[bhelgaas: commit log, comment, remove pciehp_debug parameter]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pciehp.h | 16 | ||||
-rw-r--r-- | drivers/pci/hotplug/pciehp_core.c | 3 |
2 files changed, 6 insertions, 13 deletions
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 506e1d923a1f..af5d9f92e6d5 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -29,13 +29,13 @@ | |||
29 | 29 | ||
30 | extern bool pciehp_poll_mode; | 30 | extern bool pciehp_poll_mode; |
31 | extern int pciehp_poll_time; | 31 | extern int pciehp_poll_time; |
32 | extern bool pciehp_debug; | ||
33 | 32 | ||
33 | /* | ||
34 | * Set CONFIG_DYNAMIC_DEBUG=y and boot with 'dyndbg="file pciehp* +p"' to | ||
35 | * enable debug messages. | ||
36 | */ | ||
34 | #define dbg(format, arg...) \ | 37 | #define dbg(format, arg...) \ |
35 | do { \ | 38 | pr_debug("%s: " format, MY_NAME, ## arg); |
36 | if (pciehp_debug) \ | ||
37 | printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \ | ||
38 | } while (0) | ||
39 | #define err(format, arg...) \ | 39 | #define err(format, arg...) \ |
40 | printk(KERN_ERR "%s: " format, MY_NAME, ## arg) | 40 | printk(KERN_ERR "%s: " format, MY_NAME, ## arg) |
41 | #define info(format, arg...) \ | 41 | #define info(format, arg...) \ |
@@ -44,11 +44,7 @@ do { \ | |||
44 | printk(KERN_WARNING "%s: " format, MY_NAME, ## arg) | 44 | printk(KERN_WARNING "%s: " format, MY_NAME, ## arg) |
45 | 45 | ||
46 | #define ctrl_dbg(ctrl, format, arg...) \ | 46 | #define ctrl_dbg(ctrl, format, arg...) \ |
47 | do { \ | 47 | dev_dbg(&ctrl->pcie->device, format, ## arg) |
48 | if (pciehp_debug) \ | ||
49 | dev_printk(KERN_DEBUG, &ctrl->pcie->device, \ | ||
50 | format, ## arg); \ | ||
51 | } while (0) | ||
52 | #define ctrl_err(ctrl, format, arg...) \ | 48 | #define ctrl_err(ctrl, format, arg...) \ |
53 | dev_err(&ctrl->pcie->device, format, ## arg) | 49 | dev_err(&ctrl->pcie->device, format, ## arg) |
54 | #define ctrl_info(ctrl, format, arg...) \ | 50 | #define ctrl_info(ctrl, format, arg...) \ |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index fc5366b50e95..6ff204c435bf 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include "../pci.h" | 27 | #include "../pci.h" |
28 | 28 | ||
29 | /* Global variables */ | 29 | /* Global variables */ |
30 | bool pciehp_debug; | ||
31 | bool pciehp_poll_mode; | 30 | bool pciehp_poll_mode; |
32 | int pciehp_poll_time; | 31 | int pciehp_poll_time; |
33 | 32 | ||
@@ -35,10 +34,8 @@ int pciehp_poll_time; | |||
35 | * not really modular, but the easiest way to keep compat with existing | 34 | * not really modular, but the easiest way to keep compat with existing |
36 | * bootargs behaviour is to continue using module_param here. | 35 | * bootargs behaviour is to continue using module_param here. |
37 | */ | 36 | */ |
38 | module_param(pciehp_debug, bool, 0644); | ||
39 | module_param(pciehp_poll_mode, bool, 0644); | 37 | module_param(pciehp_poll_mode, bool, 0644); |
40 | module_param(pciehp_poll_time, int, 0644); | 38 | module_param(pciehp_poll_time, int, 0644); |
41 | MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); | ||
42 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); | 39 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); |
43 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); | 40 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); |
44 | 41 | ||