* [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup
@ 2025-02-17 9:55 Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 1/2] PCI: shpchp: Remove unused logging wrappers Ilpo Järvinen
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2025-02-17 9:55 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci; +Cc: linux-kernel, Ilpo Järvinen
Hi all,
This series cleans up debug/logging in shpchp driver.
The series is an update for the only remaining patch in the pci_printk()
removal series. To avoid breaking build, pci_printk() itself will only
be removed in the next kernel release because both AER and shpchp used
it and are in different topic branches.
v2:
- Split removal of logging wrappers and module parameter removal to
own patches
- Explain how dynamic debugging can be enabled
Ilpo Järvinen (2):
PCI: shpchp: Remove unused logging wrappers
PCI: shpchp: Remove "shpchp_debug" module parameter
drivers/pci/hotplug/shpchp.h | 18 +-----------------
drivers/pci/hotplug/shpchp_core.c | 3 ---
2 files changed, 1 insertion(+), 20 deletions(-)
base-commit: d75ee0a7b0125636687a3f71c169bec04a576107
--
2.39.5
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 1/2] PCI: shpchp: Remove unused logging wrappers
2025-02-17 9:55 [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Ilpo Järvinen
@ 2025-02-17 9:55 ` Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 2/2] PCI: shpchp: Remove "shpchp_debug" module parameter Ilpo Järvinen
2025-02-18 22:46 ` [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Bjorn Helgaas
2 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2025-02-17 9:55 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Ilpo Järvinen
The shpchp hotplug driver defines logging wrapper with generic names
which are just duplicates of existing generic printk() wrappers. They
are also unused so remove them.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/pci/hotplug/shpchp.h | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index f0e2d2d54d71..10ba0bfac419 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -33,18 +33,6 @@ extern bool shpchp_poll_mode;
extern int shpchp_poll_time;
extern bool shpchp_debug;
-#define dbg(format, arg...) \
-do { \
- if (shpchp_debug) \
- printk(KERN_DEBUG "%s: " format, MY_NAME, ## arg); \
-} while (0)
-#define err(format, arg...) \
- printk(KERN_ERR "%s: " format, MY_NAME, ## arg)
-#define info(format, arg...) \
- printk(KERN_INFO "%s: " format, MY_NAME, ## arg)
-#define warn(format, arg...) \
- printk(KERN_WARNING "%s: " format, MY_NAME, ## arg)
-
#define ctrl_dbg(ctrl, format, arg...) \
do { \
if (shpchp_debug) \
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] PCI: shpchp: Remove "shpchp_debug" module parameter
2025-02-17 9:55 [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 1/2] PCI: shpchp: Remove unused logging wrappers Ilpo Järvinen
@ 2025-02-17 9:55 ` Ilpo Järvinen
2025-02-18 22:46 ` [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Bjorn Helgaas
2 siblings, 0 replies; 5+ messages in thread
From: Ilpo Järvinen @ 2025-02-17 9:55 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel; +Cc: Ilpo Järvinen
The "shpchp_debug" module parameter is used to enable debug logging.
The generic ability to turn on/off debug prints dynamically covers this
use case already so there is no need for module specific debug handling.
The ctrl_dbg() wrapper also uses a low-level pci_printk() despite
always using KERN_DEBUG level.
Remove "shpchp_debug" parameter and convert ctrl_dbg() to use the
pci_dbg().
From now on, shpchp can be debugged using the normal dynamic debugger
by setting CONFIG_DYNAMIC_DEBUG=y and then either adding to kernel
cmdline:
dyndbg="file drivers/pci/hotplug/shpchp* +p"
or using this command on a running kernel:
echo 'file drivers/pci/hotplug/shpchp* +p' > /sys/kernel/debug/dynamic_debug/control
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/pci/hotplug/shpchp.h | 6 +-----
drivers/pci/hotplug/shpchp_core.c | 3 ---
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h
index 10ba0bfac419..a425530e0939 100644
--- a/drivers/pci/hotplug/shpchp.h
+++ b/drivers/pci/hotplug/shpchp.h
@@ -34,11 +34,7 @@ extern int shpchp_poll_time;
extern bool shpchp_debug;
#define ctrl_dbg(ctrl, format, arg...) \
- do { \
- if (shpchp_debug) \
- pci_printk(KERN_DEBUG, ctrl->pci_dev, \
- format, ## arg); \
- } while (0)
+ pci_dbg(ctrl->pci_dev, format, ## arg)
#define ctrl_err(ctrl, format, arg...) \
pci_err(ctrl->pci_dev, format, ## arg)
#define ctrl_info(ctrl, format, arg...) \
diff --git a/drivers/pci/hotplug/shpchp_core.c b/drivers/pci/hotplug/shpchp_core.c
index a10ce7be7f51..0c341453afc6 100644
--- a/drivers/pci/hotplug/shpchp_core.c
+++ b/drivers/pci/hotplug/shpchp_core.c
@@ -22,7 +22,6 @@
#include "shpchp.h"
/* Global variables */
-bool shpchp_debug;
bool shpchp_poll_mode;
int shpchp_poll_time;
@@ -33,10 +32,8 @@ int shpchp_poll_time;
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC);
-module_param(shpchp_debug, bool, 0644);
module_param(shpchp_poll_mode, bool, 0644);
module_param(shpchp_poll_time, int, 0644);
-MODULE_PARM_DESC(shpchp_debug, "Debugging mode enabled or not");
MODULE_PARM_DESC(shpchp_poll_mode, "Using polling mechanism for hot-plug events or not");
MODULE_PARM_DESC(shpchp_poll_time, "Polling mechanism frequency, in seconds");
--
2.39.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup
2025-02-17 9:55 [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 1/2] PCI: shpchp: Remove unused logging wrappers Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 2/2] PCI: shpchp: Remove "shpchp_debug" module parameter Ilpo Järvinen
@ 2025-02-18 22:46 ` Bjorn Helgaas
2025-02-19 23:00 ` Bjorn Helgaas
2 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2025-02-18 22:46 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: Bjorn Helgaas, linux-pci, linux-kernel
On Mon, Feb 17, 2025 at 11:55:48AM +0200, Ilpo Järvinen wrote:
> Hi all,
>
> This series cleans up debug/logging in shpchp driver.
>
> The series is an update for the only remaining patch in the pci_printk()
> removal series. To avoid breaking build, pci_printk() itself will only
> be removed in the next kernel release because both AER and shpchp used
> it and are in different topic branches.
>
> v2:
> - Split removal of logging wrappers and module parameter removal to
> own patches
> - Explain how dynamic debugging can be enabled
>
> Ilpo Järvinen (2):
> PCI: shpchp: Remove unused logging wrappers
> PCI: shpchp: Remove "shpchp_debug" module parameter
>
> drivers/pci/hotplug/shpchp.h | 18 +-----------------
> drivers/pci/hotplug/shpchp_core.c | 3 ---
> 2 files changed, 1 insertion(+), 20 deletions(-)
Applied to pci/hotplug for v6.15, thanks, Ilpo!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup
2025-02-18 22:46 ` [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Bjorn Helgaas
@ 2025-02-19 23:00 ` Bjorn Helgaas
0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Helgaas @ 2025-02-19 23:00 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: Bjorn Helgaas, linux-pci, linux-kernel
On Tue, Feb 18, 2025 at 04:46:02PM -0600, Bjorn Helgaas wrote:
> On Mon, Feb 17, 2025 at 11:55:48AM +0200, Ilpo Järvinen wrote:
> > Hi all,
> >
> > This series cleans up debug/logging in shpchp driver.
> >
> > The series is an update for the only remaining patch in the pci_printk()
> > removal series. To avoid breaking build, pci_printk() itself will only
> > be removed in the next kernel release because both AER and shpchp used
> > it and are in different topic branches.
> >
> > v2:
> > - Split removal of logging wrappers and module parameter removal to
> > own patches
> > - Explain how dynamic debugging can be enabled
> >
> > Ilpo Järvinen (2):
> > PCI: shpchp: Remove unused logging wrappers
> > PCI: shpchp: Remove "shpchp_debug" module parameter
> >
> > drivers/pci/hotplug/shpchp.h | 18 +-----------------
> > drivers/pci/hotplug/shpchp_core.c | 3 ---
> > 2 files changed, 1 insertion(+), 20 deletions(-)
>
> Applied to pci/hotplug for v6.15, thanks, Ilpo!
And I added the previous patches:
7d5f1e615e69 ("PCI: shpchp: Remove logging from module init/exit functions")
499982200892 ("PCI: shpchp: Change dbg() -> ctrl_dbg()")
that you mentioned that I forgot to include here, which should fix the
build failure.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-02-19 23:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 9:55 [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 1/2] PCI: shpchp: Remove unused logging wrappers Ilpo Järvinen
2025-02-17 9:55 ` [PATCH v2 2/2] PCI: shpchp: Remove "shpchp_debug" module parameter Ilpo Järvinen
2025-02-18 22:46 ` [PATCH v2 0/2] PCI: shpchp: Debug & logging cleanup Bjorn Helgaas
2025-02-19 23:00 ` Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).