log spammed with "loading xx failed with error -2" since commit e40ba6d56b [replace call to fw_read_file_contents() with kernel version]
Since this commit my system log is spammed with firmware load errors. One example:
loading /lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucode failed with error -2 loading /lib/firmware/updates/iwlwifi-3160-16.ucode failed with error -2
loading /lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucode failed with error -2 -> finally load attempt from /lib/firmware/iwlwifi-3160-16.ucode succeeds
Before this commit, when a load from one path in fw_path failed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.
Quoted 10 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceedsBefore this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.
To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to MAINTAINERS for FIRMWARE_CLASS as requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.
Luis
Quoted 1 line
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
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, to let users warn or not warn. For instance request_firmware_direct() does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed. request_firmware_direct() will continue to not report errors as it was designed not to.
--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/firmware_class.c +1 -1
@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);continue ; }
Signature · 1 line
2.7.0
Quoted 8 lines · Luis R. Rodriguez
Quoted 7 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceeds
Quoted 6 lines
Quoted 3 lines
Before this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
It looks like commit "3e358ac firmware: Be a bit more verbose about direct firmware loading failure", made the change. Then commit ed04630 "firmware: simplify dev_*() print messages for generic helper" modified the message.
Mimi
Quoted 57 lines
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to
MAINTAINERSforFIRMWARE_CLASSas requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.Luis
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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, to let users warn or not warn. For instancerequest_firmware_direct()does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed.request_firmware_direct()will continue to not report errors as it was designed not to.Reported-by Heiner Kallweit <[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]>--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-1@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);continue ; }
Quoted 73 lines · Luis R. Rodriguez
Quoted 10 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceedsBefore this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to
MAINTAINERSforFIRMWARE_CLASSas requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.Luis
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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, to let users warn or not warn. For instancerequest_firmware_direct()does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed.request_firmware_direct()will continue to not report errors as it was designed not to.Reported-by Heiner Kallweit <[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]>--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-2@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);continue ; } --
Quoted 2 lines
2.7.0
I think this should warn on non-ENOENT errors and dbg on ENOENT. What do others think?
-Kees
Signature · 2 lines
Kees Cook Chrome OS & Brillo Security
Quoted 71 lines · Kees Cook
Quoted 70 lines · Luis R. Rodriguez
Quoted 10 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceedsBefore this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to
MAINTAINERSforFIRMWARE_CLASSas requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.Luis
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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, to let users warn or not warn. For instancerequest_firmware_direct()does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed.request_firmware_direct()will continue to not report errors as it was designed not to.Reported-by Heiner Kallweit <[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]>--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-1@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);
Quoted 8 lines
Quoted 5 lines
drivers/base/firmware_class.c +0
-1continue ; } --2.7.0
I think this should warn on non-ENOENT errors and dbg on ENOENT. What do others think?
Agree, that looks better.
Thanks,
Quoted 81 lines · Ming Lei
Quoted 71 lines · Kees Cook
Quoted 70 lines · Luis R. Rodriguez
Quoted 10 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceedsBefore this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to
MAINTAINERSforFIRMWARE_CLASSas requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.Luis
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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, to let users warn or not warn. For instancerequest_firmware_direct()does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed.request_firmware_direct()will continue to not report errors as it was designed not to.Reported-by Heiner Kallweit <[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]>--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-1@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);Quoted 8 lines
Quoted 5 lines
drivers/base/firmware_class.c +0
-1continue ; } --2.7.0
I think this should warn on non-ENOENT errors and dbg on ENOENT. What do others think?
Quoted 1 line
Agree, that looks better.
OK then this:
Quoted 1 line
From
e63d19975787c0e237a47c17efd01e41b2a8e2faMon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
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"
--- drivers/base/firmware_class.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/base/firmware_class.c +6 -2
@@ -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);
Signature · 1 line
2.7.0
Kees Cook
Acked-byQuoted 106 lines · Luis R. Rodriguez
Quoted 81 lines · Ming Lei
Quoted 71 lines · Kees Cook
Quoted 70 lines · Luis R. Rodriguez
Quoted 10 lines · Heiner Kallweit
Since this commit my system log is spammed with firmware load errors. One example:
loading
/lib/firmware/updates/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 loading/lib/firmware/updates/iwlwifi-3160-16.ucodefailed with error -2
loading/lib/firmware/4.5.0-rc5-next-20160226/iwlwifi-3160-16.ucodefailed with error -2 -> finally load attempt from/lib/firmware/iwlwifi-3160-16.ucodesucceedsBefore this commit, when a load from one path in
fw_pathfailed, silently the next path was tried. Only if all attempts failed an error message was printed.
Now for each single failed attempt an error message is printed what doesn't make sense.To be clear, this is an issue on linux-next, due to the latest merge of Mimi's common kernel file loader pulled recently by James.
Heiner, thanks for the report, this patch fixes that. I'll be submitting that now. James, should this go through your tree? Please note I've been meaning to add myself to
MAINTAINERSforFIRMWARE_CLASSas requested by Greg at kernel summit as I've been helping with cleanup there but I hadn't done so as I had some pending patches with a full new functionality added. With Mimi's changes merged on linux-next though and the common kernel file loader now done I can follow up with my series of changes after this.Luis
From
92e2bd76bf1abb3ce381b8d54ba5486a295af1a9Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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, to let users warn or not warn. For instancerequest_firmware_direct()does not warn as this can be used for optional firmware as it has no usermode helper fallback. In the future we may want to change this, given everyone is disabling the usermode helper anyway now, but for now keep reporting only as was designed.request_firmware_direct()will continue to not report errors as it was designed not to.Reported-by Heiner Kallweit <[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]>--- drivers/base/firmware_class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/base/firmware_class.c +1
-1@@ -328,7 +328,7 @@ 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" , +dev_dbg (device,"loading %s failed with error %d\n" , path, rc);Quoted 8 lines
Quoted 5 lines
drivers/base/firmware_class.c +0
-1continue ; } --2.7.0
I think this should warn on non-ENOENT errors and dbg on ENOENT. What do others think?
Quoted 1 line
Agree, that looks better.
OK then this:
From
e63d19975787c0e237a47c17efd01e41b2a8e2faMon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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:
Quoted 8 lines
"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]>
Perfect, thanks!
-Kees
Quoted 26 lines
--- drivers/base/firmware_class.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/base/firmware_class.c +6
-3@@ -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); --2.7.0
Signature · 2 lines
Kees Cook Chrome OS & Brillo Security
Ming Lei
Acked-byQuoted 47 lines · Luis R. Rodriguez
On Sun, Feb 28, 2016 at 10:10:57PM +0800, Ming Lei wrote:
OK then this:
From
e63d19975787c0e237a47c17efd01e41b2a8e2faMon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_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 usingkernel_read_file_from_path()we only reported a failure once we confirmed a file existed withfilp_open()but failed withfw_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]>--- drivers/base/firmware_class.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)drivers/base/firmware_class.c +0
-1@@ -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",
drivers/base/firmware_class.c static int fw_get_filesystem_firmware(struct device *device, · line 339
Quoted 10 lines
drivers/base/firmware_class.c +6
-1- 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);
Thanks,
Quoted 5 lines · Luis R. Rodriguez
Quoted 1 line
From
e63d19975787c0e237a47c17efd01e41b2a8e2faMon Sep 17 00:00:00 2001From: "Luis R. Rodriguez" <[email protected]>
Date: Sat, 27 Feb 2016 14:58:08 -0800
Subject: [PATCH] firmware: change kernel read fail todev_dbg()
Applied togit://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next
Signature · 2 lines
James Morris <[email protected]>