lkml.org 
[lkml]   [2019]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3] firmware: log name & outcome of loaded firmware
Date
It's non-trivial to figure out names of firmware that was actually
loaded, add a debug statement at the end of _request_firmware that logs
the name & result of each firmware.

This is esp. valuable early in boot, before logging of UEVENT is
available.

v3:
- Log at dev_dbg level per maintainer.
- HOWTO: Enable at boot via kernel boot param
dyndbg="func _request_firmware +p"
- Credit to Drew DeVault for parallel creation and help promoting the
idea.

Alternate-Creation: Drew DeVault <sir@cmpwn.com>
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
---
drivers/base/firmware_loader/main.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c
index bf44c79beae9..84a879608ca4 100644
--- a/drivers/base/firmware_loader/main.c
+++ b/drivers/base/firmware_loader/main.c
@@ -791,6 +791,13 @@ _request_firmware(const struct firmware **firmware_p, const char *name,
fw = NULL;
}

+ /* Provide a consistent way to capture the result of trying to load any
+ * firmware. As a potential future improvement, this might include
+ * persistent state that firmware is loaded (or failed to load for some
+ * reason). See Message-ID: <20191113205010.GY11244@42.do-not-panic.com>
+ * for background */
+ dev_dbg(device, "%s %s ret=%d\n", __func__, name, ret);
+
*firmware_p = fw;
return ret;
}
--
2.24.0
\
 
 \ /
  Last update: 2019-11-18 00:48    [W:0.095 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site