[linux] 01/02: firmware_class: Move the error message up and allow it to be disabled with FW_OPT_NO_WARN

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Dec 29 01:16:51 UTC 2015


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch benh/firmware-logging
in repository linux.

commit 2137718077a8f1c6c369bf2a16baf096d3b155c3
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Thu Nov 12 16:26:02 2015 +0000

    firmware_class: Move the error message up and allow it to be disabled with FW_OPT_NO_WARN
---
 ...mware_class-log-every-success-and-failure.patch | 39 +++++++++++++++++-----
 1 file changed, 30 insertions(+), 9 deletions(-)

diff --git a/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch b/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch
index abb0b70..707e84d 100644
--- a/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch
+++ b/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch
@@ -23,7 +23,7 @@ format to detect missing firmware.
 ---
 --- a/drivers/base/firmware_class.c
 +++ b/drivers/base/firmware_class.c
-@@ -340,16 +340,19 @@ static int fw_get_filesystem_firmware(st
+@@ -340,7 +340,7 @@ static int fw_get_filesystem_firmware(st
  		rc = fw_read_file_contents(file, buf);
  		fput(file);
  		if (rc)
@@ -32,22 +32,18 @@ format to detect missing firmware.
  				path, rc);
  		else
  			break;
- 	}
+@@ -348,8 +348,8 @@ static int fw_get_filesystem_firmware(st
  	__putname(path);
  
--	if (!rc) {
+ 	if (!rc) {
 -		dev_dbg(device, "firmware: direct-loading firmware %s\n",
 -			buf->fw_id);
-+	if (rc) {
-+		dev_err(device, "firmware: failed to load %s (%d)\n",
-+			buf->fw_id, rc);
-+	} else {
 +		dev_info(device, "firmware: direct-loading firmware %s\n",
 +			 buf->fw_id);
  		mutex_lock(&fw_lock);
  		set_bit(FW_STATUS_DONE, &buf->status);
  		complete_all(&buf->completion);
-@@ -1026,7 +1029,8 @@ _request_firmware_prepare(struct firmwar
+@@ -1031,7 +1031,8 @@ _request_firmware_prepare(struct firmwar
  	}
  
  	if (fw_get_builtin_firmware(firmware, name)) {
@@ -57,7 +53,7 @@ format to detect missing firmware.
  		return 0; /* assigned */
  	}
  
-@@ -1109,7 +1113,7 @@ _request_firmware(const struct firmware
+@@ -1117,7 +1118,7 @@ _request_firmware(const struct firmware
  	if (opt_flags & FW_OPT_NOWAIT) {
  		timeout = usermodehelper_read_lock_wait(timeout);
  		if (!timeout) {
@@ -66,3 +62,28 @@ format to detect missing firmware.
  				name);
  			ret = -EBUSY;
  			goto out;
+@@ -1132,19 +1133,18 @@ _request_firmware(const struct firmware
+ 	}
+ 
+ 	ret = fw_get_filesystem_firmware(device, fw->priv);
+-#ifdef CONFIG_FW_LOADER_USER_HELPER
+ 	if (ret) {
+-		if (!(opt_flags & FW_OPT_NO_WARN))
+-			dev_warn(device,
+-				 "Direct firmware load for %s failed with error %d\n",
+-				 name, ret);
++#ifdef CONFIG_FW_LOADER_USER_HELPER
+ 		if (opt_flags & FW_OPT_USERHELPER) {
+ 			dev_warn(device, "Falling back to user helper\n");
+ 			ret = fw_load_from_user_helper(fw, name, device,
+ 						       opt_flags, timeout);
+ 		}
+-	}
+ #endif
++		if (ret && !(opt_flags & FW_OPT_NO_WARN))
++			dev_err(device, "firmware: failed to load %s (%d)\n",
++				name, rc);
++	}
+ 
+ 	if (!ret)
+ 		ret = assign_firmware_buf(fw, device, opt_flags);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list