* [PATCH] firmware loader: log path to loaded firmwares
@ 2019-11-03 17:38 Drew DeVault
2019-11-03 17:50 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Drew DeVault @ 2019-11-03 17:38 UTC (permalink / raw)
To: Luis Chamberlain, linux-kernel
Cc: Drew DeVault, Greg Kroah-Hartman, Rafael J. Wysocki,
~sircmpwn/public-inbox
This is useful for users who are trying to identify the firmwares in use
on their system.
Signed-off-by: Drew DeVault <sir@cmpwn.com>
---
drivers/base/firmware_loader/main.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index bf44c79beae9..139d40a2f423 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -34,6 +34,7 @@
#include <linux/reboot.h>
#include <linux/security.h>
#include <linux/xz.h>
+#include <linux/kernel.h>
#include <generated/utsrelease.h>
@@ -504,6 +505,7 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv,
path);
continue;
}
+ printk(KERN_INFO "Loading firmware from %s\n", path);
if (decompress) {
dev_dbg(device, "f/w decompressing %s\n",
fw_priv->fw_name);
--
2.23.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware loader: log path to loaded firmwares
2019-11-03 17:38 [PATCH] firmware loader: log path to loaded firmwares Drew DeVault
@ 2019-11-03 17:50 ` Greg Kroah-Hartman
2019-11-03 17:55 ` Drew DeVault
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-03 17:50 UTC (permalink / raw)
To: Drew DeVault
Cc: Luis Chamberlain, linux-kernel, Rafael J. Wysocki,
~sircmpwn/public-inbox
On Sun, Nov 03, 2019 at 12:38:38PM -0500, Drew DeVault wrote:
> This is useful for users who are trying to identify the firmwares in use
> on their system.
>
> Signed-off-by: Drew DeVault <sir@cmpwn.com>
> ---
> drivers/base/firmware_loader/main.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
> index bf44c79beae9..139d40a2f423 100644
> --- a/drivers/base/firmware_loader/main.c
> +++ b/drivers/base/firmware_loader/main.c
> @@ -34,6 +34,7 @@
> #include <linux/reboot.h>
> #include <linux/security.h>
> #include <linux/xz.h>
> +#include <linux/kernel.h>
>
> #include <generated/utsrelease.h>
>
> @@ -504,6 +505,7 @@ fw_get_filesystem_firmware(struct device *device, struct fw_priv *fw_priv,
> path);
> continue;
> }
> + printk(KERN_INFO "Loading firmware from %s\n", path);
And it's totally noisy :(
Also, if you have a 'struct device' you should always use the dev_*()
calls instead, which will show you exactly what device is asking for
what.
Please just make this a debug call, that way you can turn it on
dynamically if you really want to see what firmware is attempting to be
loaded.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware loader: log path to loaded firmwares
2019-11-03 17:50 ` Greg Kroah-Hartman
@ 2019-11-03 17:55 ` Drew DeVault
2019-11-03 18:04 ` Greg Kroah-Hartman
0 siblings, 1 reply; 5+ messages in thread
From: Drew DeVault @ 2019-11-03 17:55 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Luis Chamberlain, linux-kernel, Rafael J. Wysocki,
~sircmpwn/public-inbox
On Sun Nov 3, 2019 at 6:50 PM Greg Kroah-Hartman wrote:
> And it's totally noisy :(
>
> Please just make this a debug call, that way you can turn it on
> dynamically if you really want to see what firmware is attempting to be
> loaded.
The typical setup won't need more than say, 10-20 firmwares? On my
system I need 13, and 12 of them are just for AMDGPU. In the 20 minutes
since I rebooted to this kernel, it constitutes less than 1% of my dmesg
volume, and will only get less so over time unless I start hotplugging
stuff (in which case, their respective drivers are likely to make noise,
too). In practice, I don't think it'll be especially noisy.
On the other hand, enabling debug logs just to get this information
would generate heaps of noise for a little bit of signal. This use-case
isn't the exceptional case for me, on my systems I only install the
firmwares I need so this is something I would reach for every time I set
up a new system.
> Also, if you have a 'struct device' you should always use the dev_*()
> calls instead, which will show you exactly what device is asking for
> what.
Understood.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware loader: log path to loaded firmwares
2019-11-03 17:55 ` Drew DeVault
@ 2019-11-03 18:04 ` Greg Kroah-Hartman
2019-11-03 18:06 ` Drew DeVault
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2019-11-03 18:04 UTC (permalink / raw)
To: Drew DeVault
Cc: Luis Chamberlain, linux-kernel, Rafael J. Wysocki,
~sircmpwn/public-inbox
On Sun, Nov 03, 2019 at 12:55:18PM -0500, Drew DeVault wrote:
> On Sun Nov 3, 2019 at 6:50 PM Greg Kroah-Hartman wrote:
> > And it's totally noisy :(
> >
> > Please just make this a debug call, that way you can turn it on
> > dynamically if you really want to see what firmware is attempting to be
> > loaded.
>
> The typical setup won't need more than say, 10-20 firmwares? On my
> system I need 13, and 12 of them are just for AMDGPU. In the 20 minutes
> since I rebooted to this kernel, it constitutes less than 1% of my dmesg
> volume, and will only get less so over time unless I start hotplugging
> stuff (in which case, their respective drivers are likely to make noise,
> too). In practice, I don't think it'll be especially noisy.
>
> On the other hand, enabling debug logs just to get this information
> would generate heaps of noise for a little bit of signal. This use-case
> isn't the exceptional case for me, on my systems I only install the
> firmwares I need so this is something I would reach for every time I set
> up a new system.
A "normal" system should not have any messages printing to the kernel
log. All of this "look ma, I'm now loaded!" doesn't help anyone.
Printing errors is the key, that way if you see a message, it means you
need to take care of it.
If a firmware file is NOT found that is asked for, then yes, a message
should be printed out. Isn't that the case if you do not have the
correct firmware file present?
Please never print out "Here is what the code is doing now!" type
messages to the info log, that's just noise.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] firmware loader: log path to loaded firmwares
2019-11-03 18:04 ` Greg Kroah-Hartman
@ 2019-11-03 18:06 ` Drew DeVault
0 siblings, 0 replies; 5+ messages in thread
From: Drew DeVault @ 2019-11-03 18:06 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Luis Chamberlain, linux-kernel, Rafael J. Wysocki,
~sircmpwn/public-inbox
Fair enough, v2 sent. Thanks for the feedback!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-03 18:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-03 17:38 [PATCH] firmware loader: log path to loaded firmwares Drew DeVault
2019-11-03 17:50 ` Greg Kroah-Hartman
2019-11-03 17:55 ` Drew DeVault
2019-11-03 18:04 ` Greg Kroah-Hartman
2019-11-03 18:06 ` Drew DeVault
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox