usb: reduce kernel log spam on driver registration
Subsystems (9)
RFC PATCH 1/1 usb: reduce kernel log spam on driver registration
Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these pr_info() calls.
--- drivers/usb/host/ehci-atmel.c | 1 - drivers/usb/host/ehci-exynos.c | 1 - drivers/usb/host/ehci-fsl.c | 2 -- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/ehci-npcm7xx.c | 2 -- drivers/usb/host/ehci-omap.c | 2 -- drivers/usb/host/ehci-orion.c | 2 -- drivers/usb/host/ehci-pci.c | 2 -- drivers/usb/host/ehci-platform.c | 2 -- drivers/usb/host/ehci-spear.c | 2 -- drivers/usb/host/ehci-st.c | 2 -- drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/ohci-at91.c | 1 - drivers/usb/host/ohci-da8xx.c | 1 - drivers/usb/host/ohci-exynos.c | 1 - drivers/usb/host/ohci-hcd.c | 1 - drivers/usb/host/ohci-nxp.c | 2 -- drivers/usb/host/ohci-omap.c | 2 -- drivers/usb/host/ohci-pci.c | 2 -- drivers/usb/host/ohci-platform.c | 2 -- drivers/usb/host/ohci-pxa27x.c | 2 -- drivers/usb/host/ohci-s3c2410.c | 1 - drivers/usb/host/ohci-spear.c | 2 -- drivers/usb/host/ohci-st.c | 2 -- 24 files changed, 39 deletions(-)
drivers/usb/host/ehci-atmel.c +0 -1
@@ -239,7 +239,6 @@ static int __init ehci_atmel_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ehci_init_driver (&ehci_atmel_hc_driver, &ehci_atmel_drv_overrides);return platform_driver_register (&ehci_atmel_driver); }
drivers/usb/host/ehci-exynos.c +0 -1
@@ -347,7 +347,6 @@ static int __init ehci_exynos_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ehci_init_driver (&exynos_ehci_hc_driver, &exynos_overrides);return platform_driver_register (&exynos_ehci_driver); }
drivers/usb/host/ehci-fsl.c +0 -2
@@ -722,8 +722,6 @@ static int __init ehci_fsl_init(void)if (usb_disabled ())return -ENODEV ; -pr_info (DRV_NAME ": " DRIVER_DESC "\n" ); -ehci_init_driver (&fsl_ehci_hc_driver, &ehci_fsl_overrides); fsl_ehci_hc_driver.product_desc =
drivers/usb/host/ehci-hcd.c +0 -1
@@ -1351,7 +1351,6 @@ static int __init ehci_hcd_init(void)if (usb_disabled ())return -ENODEV ; -printk (KERN_INFO "%s: " DRIVER_DESC "\n" , hcd_name);set_bit (USB_EHCI_LOADED , &usb_hcds_loaded);if (test_bit (USB_UHCI_LOADED , &usb_hcds_loaded) ||test_bit (USB_OHCI_LOADED , &usb_hcds_loaded))
drivers/usb/host/ehci-npcm7xx.c +0 -2
@@ -191,8 +191,6 @@ static int __init ehci_npcm7xx_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_npcm7xx_hc_driver,NULL );return platform_driver_register (&npcm7xx_ehci_hcd_driver); }
drivers/usb/host/ehci-omap.c +0 -2
@@ -284,8 +284,6 @@ static int __init ehci_omap_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_omap_hc_driver, &ehci_omap_overrides);return platform_driver_register (&ehci_hcd_omap_driver); }
drivers/usb/host/ehci-orion.c +0 -2
@@ -361,8 +361,6 @@ static int __init ehci_orion_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_orion_hc_driver, &orion_overrides);return platform_driver_register (&ehci_orion_driver); }
drivers/usb/host/ehci-pci.c +0 -2
@@ -423,8 +423,6 @@ static int __init ehci_pci_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_pci_hc_driver, &pci_overrides);/* Entries for the PCI suspend/resume callbacks are special */
drivers/usb/host/ehci-platform.c +0 -2
@@ -529,8 +529,6 @@ static int __init ehci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ehci_platform_driver); }
drivers/usb/host/ehci-spear.c +0 -2
@@ -167,8 +167,6 @@ static int __init ehci_spear_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_spear_hc_driver, &spear_overrides);return platform_driver_register (&spear_ehci_hcd_driver); }
drivers/usb/host/ehci-st.c +0 -2
@@ -346,8 +346,6 @@ static int __init ehci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ehci_platform_driver); }
drivers/usb/host/fotg210-hcd.c +0 -1
@@ -5692,7 +5692,6 @@ static int __init fotg210_hcd_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);set_bit (USB_EHCI_LOADED , &usb_hcds_loaded);if (test_bit (USB_UHCI_LOADED , &usb_hcds_loaded) ||test_bit (USB_OHCI_LOADED , &usb_hcds_loaded))
drivers/usb/host/ohci-at91.c +0 -1
@@ -699,7 +699,6 @@ static int __init ohci_at91_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&ohci_at91_hc_driver, &ohci_at91_drv_overrides);/*
drivers/usb/host/ohci-da8xx.c +0 -1
@@ -551,7 +551,6 @@ static int __init ohci_da8xx_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" ,DRV_NAME );ohci_init_driver (&ohci_da8xx_hc_driver, &da8xx_overrides);/*
drivers/usb/host/ohci-exynos.c +0 -1
@@ -310,7 +310,6 @@ static int __init ohci_exynos_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&exynos_ohci_hc_driver, &exynos_overrides);return platform_driver_register (&exynos_ohci_driver); }
drivers/usb/host/ohci-hcd.c +0 -1
@@ -1276,7 +1276,6 @@ static int __init ohci_hcd_mod_init(void)if (usb_disabled ())return -ENODEV ; -printk (KERN_INFO "%s: " DRIVER_DESC "\n" , hcd_name);pr_debug ("%s: block sizes: ed %zd td %zd\n" , hcd_name,sizeof (struct ed ),sizeof (struct td ));set_bit (USB_OHCI_LOADED , &usb_hcds_loaded);
drivers/usb/host/ohci-nxp.c +0 -2
@@ -275,8 +275,6 @@ static int __init ohci_nxp_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_nxp_hc_driver,NULL );return platform_driver_register (&ohci_hcd_nxp_driver); }
drivers/usb/host/ohci-omap.c +0 -2
@@ -423,8 +423,6 @@ static int __init ohci_omap_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_omap_hc_driver, &omap_overrides);return platform_driver_register (&ohci_hcd_omap_driver); }
drivers/usb/host/ohci-pci.c +0 -2
@@ -306,8 +306,6 @@ static int __init ohci_pci_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_pci_hc_driver, &pci_overrides);#ifdef CONFIG_PM
drivers/usb/host/ohci-platform.c +0 -2
@@ -346,8 +346,6 @@ static int __init ohci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ohci_platform_driver); }
drivers/usb/host/ohci-pxa27x.c +0 -2
@@ -608,8 +608,6 @@ static int __init ohci_pxa27x_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_pxa27x_hc_driver, &pxa27x_overrides); ohci_pxa27x_hc_driver.hub_control = pxa27x_ohci_hub_control;
drivers/usb/host/ohci-s3c2410.c +0 -1
@@ -474,7 +474,6 @@ static int __init ohci_s3c2410_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&ohci_s3c2410_hc_driver,NULL );/*
drivers/usb/host/ohci-spear.c +0 -2
@@ -179,8 +179,6 @@ static int __init ohci_spear_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_spear_hc_driver, &spear_overrides);return platform_driver_register (&spear_ohci_hcd_driver); }
drivers/usb/host/ohci-st.c +0 -2
@@ -324,8 +324,6 @@ static int __init ohci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ohci_platform_driver); }
Signature · 1 line
2.35.1
Alim Akhtar
reviewerQuoted 22 lines
-----Original Message-----
From: Ard Biesheuvel [mailto:[email protected]]
Sent: Thursday, August 25, 2022 10:33 PM
To: [email protected]
Cc: Ard Biesheuvel <[email protected]>; Alan Stern <[email protected]>; Greg Kroah-Hartman <[email protected]>; Nicolas Ferre <[email protected]>; Alexandre Belloni <[email protected]>; Claudiu Beznea <[email protected]>; Krzysztof Kozlowski <[email protected]>; Alim Akhtar <[email protected]>; Avi Fishman <[email protected]>; Tomer Maimon <[email protected]>; Tali Perry <[email protected]>; Patrick Venture <[email protected]>; Nancy Yuen <[email protected]>; Benjamin Fair <[email protected]>; Patrice Chotard <[email protected]>; Vladimir Zapolskiy <[email protected]>; linux- [email protected]; [email protected]; linux-samsung- [email protected]; [email protected]
Subject: [RFC PATCH] usb: reduce kernel log spam on driver registration
Quoted 1 line
Drivers are typically supposed to be quiet unless they are actually probed,
but
Quoted 6 lines
for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these
pr_info()calls.
How about just change pr_info() to pr_debug() instead?
Quoted 61 lines
Cc Alan Stern <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Alexandre Belloni <[email protected]>Cc Claudiu Beznea <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>Cc Avi Fishman <[email protected]>Cc Tomer Maimon <[email protected]>Cc Tali Perry <[email protected]>Cc Patrick Venture <[email protected]>Cc Nancy Yuen <[email protected]>Cc Benjamin Fair <[email protected]>Cc Patrice Chotard <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>---
drivers/usb/host/ehci-atmel.c | 1 - drivers/usb/host/ehci-exynos.c | 1 - drivers/usb/host/ehci-fsl.c | 2 -- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/ehci-npcm7xx.c | 2 -- drivers/usb/host/ehci-omap.c | 2 -- drivers/usb/host/ehci-orion.c | 2 -- drivers/usb/host/ehci-pci.c | 2 -- drivers/usb/host/ehci-platform.c | 2 -- drivers/usb/host/ehci-spear.c | 2 -- drivers/usb/host/ehci-st.c | 2 -- drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/ohci-at91.c | 1 - drivers/usb/host/ohci-da8xx.c | 1 - drivers/usb/host/ohci-exynos.c | 1 - drivers/usb/host/ohci-hcd.c | 1 - drivers/usb/host/ohci-nxp.c | 2 -- drivers/usb/host/ohci-omap.c | 2 -- drivers/usb/host/ohci-pci.c | 2 -- drivers/usb/host/ohci-platform.c | 2 -- drivers/usb/host/ohci-pxa27x.c | 2 -- drivers/usb/host/ohci-s3c2410.c | 1 - drivers/usb/host/ohci-spear.c | 2 -- drivers/usb/host/ohci-st.c | 2 -- 24 files changed, 39 deletions(-)drivers/usb/host/ehci-atmel.c +0
-1@@ -239,7 +239,6 @@ static int __init ehci_atmel_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ehci_init_driver (&ehci_atmel_hc_driver, &ehci_atmel_drv_overrides);return platform_driver_register (&ehci_atmel_driver);}
Review
Quoted 1 line
(quoted diff) +0
-0
b/drivers/usb/host/ehci-exynos.c
drivers/usb/host/ehci-fsl.c
Quoted 12 lines
index
1a9b7572e17f..a65e365e3a04100644drivers/usb/host/ehci-exynos.c +0
-1@@ -347,7 +347,6 @@ static int __init ehci_exynos_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ehci_init_driver (&exynos_ehci_hc_driver, &exynos_overrides);return platform_driver_register (&exynos_ehci_driver); }drivers/usb/host/ehci-fsl.c +0
-0
index
drivers/usb/host/ehci-hcd.c
Quoted 13 lines
896c0d107f72..9cea785934e5100644drivers/usb/host/ehci-fsl.c +0
-2@@ -722,8 +722,6 @@ static int __init ehci_fsl_init(void)if (usb_disabled ())return -ENODEV ; -pr_info (DRV_NAME ": " DRIVER_DESC "\n" ); -ehci_init_driver (&fsl_ehci_hc_driver, &ehci_fsl_overrides); fsl_ehci_hc_driver.product_desc =drivers/usb/host/ehci-hcd.c +0
-0
index
drivers/usb/host/ehci-pci.c
Quoted 51 lines
684164fa9716..a1930db0da1c100644drivers/usb/host/ehci-hcd.c +0
-1@@ -1351,7 +1351,6 @@ static int __init ehci_hcd_init(void)if (usb_disabled ())return -ENODEV ; -printk (KERN_INFO "%s: " DRIVER_DESC "\n" , hcd_name);set_bit (USB_EHCI_LOADED , &usb_hcds_loaded);if (test_bit (USB_UHCI_LOADED , &usb_hcds_loaded) ||test_bit (USB_OHCI_LOADED , &usb_hcds_loaded))drivers/usb/host/ehci- renamed from drivers/usb/host/ehci-npcm7xx.c +0
-0
npcm7xx.cindex6b5a7a873e01..4321ac6b11cc100644drivers/usb/host/ehci-npcm7xx.c +0
-2@@ -191,8 +191,6 @@ static int __init ehci_npcm7xx_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_npcm7xx_hc_driver,NULL );return platform_driver_register (&npcm7xx_ehci_hcd_driver); }drivers/usb/host/ehci-omap.c +0
-2@@ -284,8 +284,6 @@ static int __init ehci_omap_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_omap_hc_driver, &ehci_omap_overrides);return platform_driver_register (&ehci_hcd_omap_driver); }drivers/usb/host/ehci-orion.c +0
-2@@ -361,8 +361,6 @@ static int __init ehci_orion_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_orion_hc_driver, &orion_overrides);return platform_driver_register (&ehci_orion_driver); }drivers/usb/host/ehci-pci.c +0
-0
index
drivers/usb/host/ehci-pci.c static int __init ehci_pci_init(void) · line 428
Quoted 12 lines
9937c5a7efc2..9581952d999a100644drivers/usb/host/ehci-pci.c +0
-2@@ -423,8 +423,6 @@ static int __init ehci_pci_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_pci_hc_driver, &pci_overrides);/* Entries for the PCI suspend/resume callbacks are special */ diff
--git
Review
Quoted 40 lines
a/drivers/usb/host/ehci-platform.cb/drivers/usb/host/ehci-platform.cindex6924f0316e9a..50491eea9409100644drivers/usb/host/ehci-platform.c +0
-2@@ -529,8 +529,6 @@ static int __init ehci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ehci_platform_driver); }drivers/usb/host/ehci-spear.c +0
-2@@ -167,8 +167,6 @@ static int __init ehci_spear_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_spear_hc_driver, &spear_overrides);return platform_driver_register (&spear_ehci_hcd_driver); }drivers/usb/host/ehci-st.c index renamed from drivers/usb/host/ehci-st.c +0
-0
f74433aac948..1086078133f8100644drivers/usb/host/ehci-st.c +0
-2@@ -346,8 +346,6 @@ static int __init ehci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ehci_init_driver (&ehci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ehci_platform_driver); }(quoted diff) +0
-0
b/drivers/usb/host/fotg210-hcd.c
drivers/usb/host/ohci-at91.c
Quoted 12 lines
index
f8c111e08a0d..3d1dbcf4c073100644drivers/usb/host/fotg210-hcd.c +0
-1@@ -5692,7 +5692,6 @@ static int __init fotg210_hcd_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);set_bit (USB_EHCI_LOADED , &usb_hcds_loaded);if (test_bit (USB_UHCI_LOADED , &usb_hcds_loaded) ||test_bit (USB_OHCI_LOADED , &usb_hcds_loaded))drivers/usb/host/ohci-at91.c +0
-0
index
Review
Quoted 24 lines
98326465e2dc..adf0998f0299100644drivers/usb/host/ohci-at91.c +0
-1@@ -699,7 +699,6 @@ static int __init ohci_at91_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&ohci_at91_hc_driver, &ohci_at91_drv_overrides);/* drivers/usb/host/ohci-da8xx.c +0
-1@@ -551,7 +551,6 @@ static int __init ohci_da8xx_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" ,DRV_NAME );ohci_init_driver (&ohci_da8xx_hc_driver, &da8xx_overrides);/* (quoted diff) +0
-0
b/drivers/usb/host/ohci-exynos.c
drivers/usb/host/ohci-hcd.c
Quoted 12 lines
index
5f5e8a64c8e2..a060be6ae274100644drivers/usb/host/ohci-exynos.c +0
-1@@ -310,7 +310,6 @@ static int __init ohci_exynos_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&exynos_ohci_hc_driver, &exynos_overrides);return platform_driver_register (&exynos_ohci_driver); }drivers/usb/host/ohci-hcd.c +0
-0
index
drivers/usb/host/ohci-pci.c
Quoted 38 lines
c4c821c2288c..0457dd9f6c19100644drivers/usb/host/ohci-hcd.c +0
-1@@ -1276,7 +1276,6 @@ static int __init ohci_hcd_mod_init(void)if (usb_disabled ())return -ENODEV ; -printk (KERN_INFO "%s: " DRIVER_DESC "\n" , hcd_name);pr_debug ("%s: block sizes: ed %zd td %zd\n" , hcd_name,sizeof (struct ed ),sizeof (struct td )); set_bit(USB_OHCI_LOADED, &usb_hcds_loaded); diff --git
a/drivers/usb/host/ohci-nxp.cb/drivers/usb/host/ohci-nxp.cindex106a6bcefb08..5b32e683e367100644drivers/usb/host/ohci-nxp.c +0
-2@@ -275,8 +275,6 @@ static int __init ohci_nxp_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_nxp_hc_driver,NULL );return platform_driver_register (&ohci_hcd_nxp_driver); }drivers/usb/host/ohci-omap.c +0
-2@@ -423,8 +423,6 @@ static int __init ohci_omap_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_omap_hc_driver, &omap_overrides);return platform_driver_register (&ohci_hcd_omap_driver); }drivers/usb/host/ohci-pci.c +0
-0
index
Review
Quoted 27 lines
41efe927d8f3..a146b2d3ef0b100644drivers/usb/host/ohci-pci.c +0
-2@@ -306,8 +306,6 @@ static int __init ohci_pci_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_pci_hc_driver, &pci_overrides);#ifdef CONFIG_PM drivers/usb/host/ohci- renamed from drivers/usb/host/ohci-platform.c +0
-0
platform.c
index0adae6265127..6d56b52966c7100644drivers/usb/host/ohci-platform.c +0
-2@@ -346,8 +346,6 @@ static int __init ohci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ohci_platform_driver); }(quoted diff) +0
-0
b/drivers/usb/host/ohci-pxa27x.c
Review
Quoted 13 lines
index
ab4f610a0140..f2504b884e92100644drivers/usb/host/ohci-pxa27x.c +0
-2@@ -608,8 +608,6 @@ static int __init ohci_pxa27x_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_pxa27x_hc_driver, &pxa27x_overrides); ohci_pxa27x_hc_driver.hub_control = pxa27x_ohci_hub_control;(quoted diff) +0
-0
b/drivers/usb/host/ohci-s3c2410.c
Quoted 39 lines
index
12264c048601..7207c7a3cf49100644drivers/usb/host/ohci-s3c2410.c +0
-1@@ -474,7 +474,6 @@ static int __init ohci_s3c2410_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name);ohci_init_driver (&ohci_s3c2410_hc_driver,NULL );/* drivers/usb/host/ohci-spear.c +0
-2@@ -179,8 +179,6 @@ static int __init ohci_spear_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_spear_hc_driver, &spear_overrides);return platform_driver_register (&spear_ohci_hcd_driver); }drivers/usb/host/ohci-st.c index renamed from drivers/usb/host/ohci-st.c +0
-0
ac796ccd93ef..2e542a344aae100644drivers/usb/host/ohci-st.c +0
-3@@ -324,8 +324,6 @@ static int __init ohci_platform_init(void)if (usb_disabled ())return -ENODEV ; -pr_info ("%s: " DRIVER_DESC "\n" , hcd_name); -ohci_init_driver (&ohci_platform_hc_driver, &platform_overrides);return platform_driver_register (&ohci_platform_driver); } --2.35.1
Quoted 9 lines · Alim Akhtar
Quoted 1 line
Drivers are typically supposed to be quiet unless they are actually probed,
but
Quoted 6 lines
for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these
pr_info()calls.How about just change
pr_info()topr_debug()instead?
Do the messages serve a useful purpose that the initcall_debug kernel parameter (that doesn't require #define DEBUG to be set while compiling and thus can be used with any kernel) doesn't provide?
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Quoted 9 lines
-----Original Message-----
From: Russell King <[email protected]>
Sent: Thursday, August 25, 2022 1:10 PM
To: Alim Akhtar <[email protected]>
Subject: Re: [RFC PATCH] usb: reduce kernel log spam on driver registrationOn Thu, Aug 25, 2022 at 10:53:44PM +0530, Alim Akhtar wrote:
...
Quoted 6 lines
Quoted 6 lines
Ard:
Quoted 5 lines
Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Let's fix that, and remove these
pr_info()calls.How about just change
pr_info()topr_debug()instead?Do the messages serve a useful purpose that the
initcall_debugkernel parameter (that doesn't require #define DEBUG to be set while compiling and thus can be used with any kernel) doesn't provide?
Some code uses "printk(KERN DEBUG" to avoid pr_debug's complexity when CONFIG_DYNAMIC_DEBUG is enabled (requiring adding strings like echi_hcd.dyndbg on the kernel command line). You can preserve the pr_fmt, if any, like this:
printk(KERN_DEBUG pr_fmt("message\n", args ));However, I agree with Ard's suggestion to drop these module loading prints altogether.
These modules do print more lines if they find hardware. Example with ehci and xhci finding hardware but ohci and uhci not finding hardware:
[ 20.568240] calling ehci_hcd_init+0x0/0xe2 @ 1 [ 20.568242] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 20.574810] initcall ehci_hcd_init+0x0/0xe2 returned 0 after 6568 usecs
Patch removes that Driver line.
[ 20.574811] calling ehci_pci_init+0x0/0x69 @ 1 [ 20.574813] ehci-pci: EHCI PCI platform driver [ 20.579544] ehci-pci 0000:01:00.4: EHCI Host Controller [ 20.584867] ehci-pci 0000:01:00.4: new USB bus registered, assigned bus number 1 [ 20.592356] ehci-pci 0000:01:00.4: irq 58, io mem 0xd9b9c000 [ 20.604560] ehci-pci 0000:01:00.4: USB 2.0 started, EHCI 1.00 [ 20.618684] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 20.625947] usb usb1: Product: EHCI Host Controller [ 20.630849] usb usb1: Manufacturer: Linux 6.0.0-rc1+ ehci_hcd [ 20.636626] usb usb1: SerialNumber: 0000:01:00.4 [ 20.641367] hub 1-0:1.0: USB hub found [ 20.645143] hub 1-0:1.0: 8 ports detected [ 20.649429] initcall ehci_pci_init+0x0/0x69 returned 0 after 74616 usecs
Patch removes that "platform driver" line.
[ 20.649433] calling ohci_hcd_mod_init+0x0/0x7c @ 1 [ 20.649435] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 20.655659] initcall ohci_hcd_mod_init+0x0/0x7c returned 0 after 6223 usecs
Patch removes that Driver line.
[ 20.655661] calling ohci_pci_init+0x0/0x69 @ 1 [ 20.655662] ohci-pci: OHCI PCI platform driver [ 20.660155] initcall ohci_pci_init+0x0/0x69 returned 0 after 4492 usecs
Patch removes that Driver line.
[ 20.660157] calling uhci_hcd_init+0x0/0x10a @ 1 [ 20.660158] uhci_hcd: USB Universal Host Controller Interface driver [ 20.666589] initcall uhci_hcd_init+0x0/0x10a returned 0 after 6431 usecs
The patch is missing that uhci_hcd driver line.
printk(KERN_INFO "uhci_hcd: " DRIVER_DESC "%s\n",
ignore_oc ? ", overcurrent ignored" : "");
That does sometimes print one of its module parameter values, but I don't know if that deserves an exception.
[ 20.666591] calling xhci_hcd_init+0x0/0x28 @ 1 [ 20.666595] initcall xhci_hcd_init+0x0/0x28 returned 0 after 2 usecs
[ 20.666596] calling xhci_pci_init+0x0/0x4e @ 1 [ 20.666711] xhci_hcd 0000:00:14.0: xHCI Host Controller [ 20.672050] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 2 [ 20.680584] xhci_hcd 0000:00:14.0: hcc params 0x200077c1 hci version 0x100 quirks 0x0000000000009810 [ 20.689996] xhci_hcd 0000:00:14.0: xHCI Host Controller [ 20.695319] xhci_hcd 0000:00:14.0: new USB bus registered, assigned bus number 3 [ 20.702759] xhci_hcd 0000:00:14.0: Host supports USB 3.0 SuperSpeed [ 20.729559] usb usb2: Manufacturer: Linux 6.0.0-rc1+ xhci-hcd [ 20.768845] usb usb3: Manufacturer: Linux 6.0.0-rc1+ xhci-hcd [ 20.787580] initcall xhci_pci_init+0x0/0x4e returned 0 after 120982 usecs
The xhci modules already don't have those prints.
The patch is also missing u132_hcd_init:
printk(KERN_INFO "driver %s\n", hcd_name);
Quoted 28 lines
-----Original Message-----
From: Russell King (Oracle) [mailto:[email protected]]
Sent: Thursday, August 25, 2022 11:40 PM
To: Alim Akhtar <[email protected]>
Cc: 'Ard Biesheuvel' <[email protected]>; [email protected]; 'Alexandre Belloni' <[email protected]>; linux-samsung- [email protected]; 'Tomer Maimon' <[email protected]>; linux- [email protected]; 'Avi Fishman' <[email protected]>; 'Greg Kroah-Hartman' <[email protected]>; [email protected]; 'Tali Perry' <[email protected]>; 'Nancy Yuen' <[email protected]>; 'Krzysztof Kozlowski' <[email protected]>; 'Alan Stern' <[email protected]>; 'Patrice Chotard' <[email protected]>; 'Patrick Venture' <[email protected]>; 'Vladimir Zapolskiy' <[email protected]>; 'Claudiu Beznea' <[email protected]>; [email protected]; 'Benjamin Fair' <[email protected]>
Subject: Re: [RFC PATCH] usb: reduce kernel log spam on driver registrationQuoted 7 lines · Alim Akhtar
Quoted 2 lines
Drivers are typically supposed to be quiet unless they are actually probed,
but
Quoted 4 lines
for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Quoted 8 lines
Quoted 3 lines
Quoted 2 lines
Let's fix that, and remove these
pr_info()calls.How about just change
pr_info()topr_debug()instead?Do the messages serve a useful purpose that the
initcall_debugkernel parameter (that doesn't require #define DEBUG to be set while compiling and thus can be used with any kernel) doesn't provide?
Ah, right, initcall_debug will do the job.
So removing pr_info() from init call looks good.
Thanks.
Hi Ard
Feel free to add
Quoted 7 lines
--
RMK's Patch system: https://protect2.fireeye.com/v1/url?k=3b37dc19-
5abcc93c-3b365756-74fe485cbff6-6a25f0b5c8476bae&q=1&e=752dac9b-cfef- 4919-8665- 8a220aac5d96&u=https%3A%2F%2Fwww.armlinux.org.uk%2Fdeveloper%2Fp atches%2F
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Quoted 28 lines · Ard Biesheuvel
Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these
pr_info()calls.Cc Alan Stern <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Alexandre Belloni <[email protected]>Cc Claudiu Beznea <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>Cc Avi Fishman <[email protected]>Cc Tomer Maimon <[email protected]>Cc Tali Perry <[email protected]>Cc Patrick Venture <[email protected]>Cc Nancy Yuen <[email protected]>Cc Benjamin Fair <[email protected]>Cc Patrice Chotard <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>
Quoted 1 line
---
Quoted 47 lines · Ard Biesheuvel
Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these
pr_info()calls.Cc Alan Stern <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Alexandre Belloni <[email protected]>Cc Claudiu Beznea <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>Cc Avi Fishman <[email protected]>Cc Tomer Maimon <[email protected]>Cc Tali Perry <[email protected]>Cc Patrick Venture <[email protected]>Cc Nancy Yuen <[email protected]>Cc Benjamin Fair <[email protected]>Cc Patrice Chotard <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>--- drivers/usb/host/ehci-atmel.c | 1 - drivers/usb/host/ehci-exynos.c | 1 - drivers/usb/host/ehci-fsl.c | 2 -- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/ehci-npcm7xx.c | 2 -- drivers/usb/host/ehci-omap.c | 2 -- drivers/usb/host/ehci-orion.c | 2 -- drivers/usb/host/ehci-pci.c | 2 -- drivers/usb/host/ehci-platform.c | 2 -- drivers/usb/host/ehci-spear.c | 2 -- drivers/usb/host/ehci-st.c | 2 -- drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/ohci-at91.c | 1 - drivers/usb/host/ohci-da8xx.c | 1 - drivers/usb/host/ohci-exynos.c | 1 - drivers/usb/host/ohci-hcd.c | 1 - drivers/usb/host/ohci-nxp.c | 2 --
Quoted 8 lines
drivers/usb/host/ohci-omap.c | 2 -- drivers/usb/host/ohci-pci.c | 2 -- drivers/usb/host/ohci-platform.c | 2 -- drivers/usb/host/ohci-pxa27x.c | 2 -- drivers/usb/host/ohci-s3c2410.c | 1 - drivers/usb/host/ohci-spear.c | 2 -- drivers/usb/host/ohci-st.c | 2 -- 24 files changed, 39 deletions(-)
I've had the same patch sitting around since 3.15...
Rob
Quoted 45 lines · Ard Biesheuvel
Drivers are typically supposed to be quiet unless they are actually probed, but for some reason, USB host controllers seem to be exempt from this rule, and happily broadcast their existence into the kernel log at boot even if the hardware in question is nowhere to be found.
Let's fix that, and remove these
pr_info()calls.Cc Alan Stern <[email protected]>Cc Greg Kroah-Hartman <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Alexandre Belloni <[email protected]>Cc Claudiu Beznea <[email protected]>Cc Krzysztof Kozlowski <[email protected]>Cc Alim Akhtar <[email protected]>Cc Avi Fishman <[email protected]>Cc Tomer Maimon <[email protected]>Cc Tali Perry <[email protected]>Cc Patrick Venture <[email protected]>Cc Nancy Yuen <[email protected]>Cc Benjamin Fair <[email protected]>Cc Patrice Chotard <[email protected]>Cc Vladimir Zapolskiy <[email protected]>Signed-off-by Ard Biesheuvel <[email protected]>--- drivers/usb/host/ehci-atmel.c | 1 - drivers/usb/host/ehci-exynos.c | 1 - drivers/usb/host/ehci-fsl.c | 2 -- drivers/usb/host/ehci-hcd.c | 1 - drivers/usb/host/ehci-npcm7xx.c | 2 -- drivers/usb/host/ehci-omap.c | 2 -- drivers/usb/host/ehci-orion.c | 2 -- drivers/usb/host/ehci-pci.c | 2 -- drivers/usb/host/ehci-platform.c | 2 -- drivers/usb/host/ehci-spear.c | 2 -- drivers/usb/host/ehci-st.c | 2 -- drivers/usb/host/fotg210-hcd.c | 1 - drivers/usb/host/ohci-at91.c | 1 - drivers/usb/host/ohci-da8xx.c | 1 - drivers/usb/host/ohci-exynos.c | 1 - drivers/usb/host/ohci-hcd.c | 1 -
Quoted 8 lines
drivers/usb/host/ohci-nxp.c | 2 -- drivers/usb/host/ohci-omap.c | 2 -- drivers/usb/host/ohci-pci.c | 2 -- drivers/usb/host/ohci-platform.c | 2 -- drivers/usb/host/ohci-pxa27x.c | 2 -- drivers/usb/host/ohci-s3c2410.c | 1 - drivers/usb/host/ohci-spear.c | 2 -- drivers/usb/host/ohci-st.c | 2 --
Best regards,
Krzysztof