Skip to content

Commit

Permalink
firmware: change kernel read fail to dev_dbg()
Browse files Browse the repository at this point in the history
When we now use the new kernel_read_file_from_path() we
are reporting a failure when we iterate over all the paths
possible for firmware. Before using kernel_read_file_from_path()
we only reported a failure once we confirmed a file existed
with filp_open() but failed with fw_read_file_contents().

With kernel_read_file_from_path() both are done for us and
we obviously are now reporting too much information given that
some optional paths will always fail and clutter the logs.

fw_get_filesystem_firmware() already has a check for failure
and uses an internal flag, FW_OPT_NO_WARN, but this does not
let us capture other unxpected errors. This enables that
as changed by Neil via commit:

"firmware: Be a bit more verbose about direct firmware loading failure"

Reported-by: Heiner Kallweit <[email protected]>
Cc: Neil Horman <[email protected]>
Cc: Heiner Kallweit <[email protected]>
Cc: Mimi Zohar <[email protected]>
Cc: Kees Cook <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
Acked-by: Kees Cook <[email protected]>
Acked-by: Ming Lei <[email protected]>
Signed-off-by: James Morris <[email protected]>
  • Loading branch information
mcgrof authored and James Morris committed Feb 29, 2016
1 parent 2cb6d64 commit 8e516aa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ static int fw_get_filesystem_firmware(struct device *device,
rc = kernel_read_file_from_path(path, &buf->data, &size,
INT_MAX, READING_FIRMWARE);
if (rc) {
dev_warn(device, "loading %s failed with error %d\n",
path, rc);
if (rc == -ENOENT)
dev_dbg(device, "loading %s failed with error %d\n",
path, rc);
else
dev_warn(device, "loading %s failed with error %d\n",
path, rc);
continue;
}
dev_dbg(device, "direct-loading %s\n", buf->fw_id);
Expand Down

0 comments on commit 8e516aa

Please sign in to comment.