From: "Elliott, Robert (Servers)" <elliott@hpe.com>
To: Russell King <linux@armlinux.org.uk>,
Alim Akhtar <alim.akhtar@samsung.com>
Cc: 'Ard Biesheuvel' <ardb@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
'Alexandre Belloni' <alexandre.belloni@bootlin.com>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
'Tomer Maimon' <tmaimon77@gmail.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
'Avi Fishman' <avifishman70@gmail.com>,
'Greg Kroah-Hartman' <gregkh@linuxfoundation.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
'Tali Perry' <tali.perry1@gmail.com>,
'Nancy Yuen' <yuenn@google.com>,
"'Krzysztof Kozlowski'" <krzysztof.kozlowski@linaro.org>,
'Alan Stern' <stern@rowland.harvard.edu>,
'Patrice Chotard' <patrice.chotard@foss.st.com>,
'Patrick Venture' <venture@google.com>,
'Vladimir Zapolskiy' <vz@mleia.com>,
'Claudiu Beznea' <claudiu.beznea@microchip.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
'Benjamin Fair' <benjaminfair@google.com>
Subject: RE: [RFC PATCH] usb: reduce kernel log spam on driver registration
Date: Thu, 25 Aug 2022 22:13:06 +0000 [thread overview]
Message-ID: <MW5PR84MB18424F6AAA4C72EB5C448656AB729@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <Ywe6/AKzVL/77Fhi@shell.armlinux.org.uk>
> -----Original Message-----
> From: Russell King <linux@armlinux.org.uk>
> Sent: Thursday, August 25, 2022 1:10 PM
> To: Alim Akhtar <alim.akhtar@samsung.com>
> 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);
next prev parent reply other threads:[~2022-08-25 22:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20220825170354epcas5p28a5f1a4b13507b5c40ca235560a6ba56@epcas5p2.samsung.com>
2022-08-25 17:03 ` Ard Biesheuvel
2022-08-25 17:23 ` Alim Akhtar
2022-08-25 18:10 ` Russell King (Oracle)
2022-08-25 22:13 ` Elliott, Robert (Servers) [this message]
2022-08-26 4:01 ` Alim Akhtar
2022-08-25 19:11 ` Alan Stern
2022-08-25 19:59 ` Rob Herring
2022-08-26 5:57 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MW5PR84MB18424F6AAA4C72EB5C448656AB729@MW5PR84MB1842.NAMPRD84.PROD.OUTLOOK.COM \
--to=elliott@hpe.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alim.akhtar@samsung.com \
--cc=ardb@kernel.org \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=claudiu.beznea@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=patrice.chotard@foss.st.com \
--cc=stern@rowland.harvard.edu \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=venture@google.com \
--cc=vz@mleia.com \
--cc=yuenn@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®