RE: [RFC PATCH] usb: reduce kernel log spam on driver registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Russell King <linux@xxxxxxxxxxxxxxx>
> Sent: Thursday, August 25, 2022 1:10 PM
> To: Alim Akhtar <alim.akhtar@xxxxxxxxxxx>
> Subject: Re: [RFC PATCH] usb: reduce kernel log spam on driver registration
> 
> On Thu, Aug 25, 2022 at 10:53:44PM +0530, Alim Akhtar wrote:
...
> > Ard:
> > >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.
> > >
> > How about just change pr_info() to pr_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?

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);







[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux