Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345430

Re: log spammed with "loading xx failed with error -2" since commit e40ba6d56b [replace call to fw_read_file_contents() with kernel version]

From Ming Lei <ming.lei@canonical.com>
Newsgroups linux.kernel
Subject Re: log spammed with "loading xx failed with error -2" since commit e40ba6d56b [replace call to fw_read_file_contents() with kernel version]
Date 2016-02-29 02:10 +0100
Message-ID <r7kvv-2La-1@gated-at.bofh.it> (permalink)
References <r6QnN-5VF-19@gated-at.bofh.it> <r6Wjv-1MZ-7@gated-at.bofh.it> <r6Zhn-3WL-11@gated-at.bofh.it> <r7amu-3B3-13@gated-at.bofh.it> <r7gBA-87l-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Feb 29, 2016 at 4:57 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
> On Sun, Feb 28, 2016 at 10:10:57PM +0800, Ming Lei wrote:


>
> OK then this:
>
> From e63d19975787c0e237a47c17efd01e41b2a8e2fa Mon Sep 17 00:00:00 2001
> From: "Luis R. Rodriguez" <mcgrof@kernel.org>
> Date: Sat, 27 Feb 2016 14:58:08 -0800
> Subject: [PATCH] firmware: change kernel read fail to dev_dbg()
>
> 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 <hkallweit1@gmail.com>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: Heiner Kallweit <hkallweit1@gmail.com>
> Cc: Mimi Zohar <zohar@linux.vnet.ibm.com>
> Cc: Kees Cook <keescook@chromium.org>
> Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
> ---
>  drivers/base/firmware_class.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
> index 1cff832ab74e..9503a88b189b 100644
> --- a/drivers/base/firmware_class.c
> +++ b/drivers/base/firmware_class.c
> @@ -328,8 +328,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);

Acked-by: Ming Lei <ming.lei@canonical.com>

Thanks,

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Heiner Kallweit <hkallweit1@gmail.com> - 2016-02-27 18:00 +0100
  Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-02-28 00:20 +0100
    Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Mimi Zohar <zohar@linux.vnet.ibm.com> - 2016-02-28 01:20 +0100
    Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Kees Cook <keescook@chromium.org> - 2016-02-28 03:30 +0100
      Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Ming Lei <ming.lei@canonical.com> - 2016-02-28 15:20 +0100
        Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] "Luis R. Rodriguez" <mcgrof@suse.com> - 2016-02-28 22:00 +0100
          Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Kees Cook <keescook@chromium.org> - 2016-02-29 00:30 +0100
          Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] Ming Lei <ming.lei@canonical.com> - 2016-02-29 02:10 +0100
          Re: log spammed with "loading xx failed with error -2" since commit  e40ba6d56b [replace call to fw_read_file_contents() with kernel version] James Morris <jmorris@namei.org> - 2016-02-29 08:50 +0100

csiph-web