linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Ming Lei <ming.lei@canonical.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] firmware: Ignore abort check when no user-helper is used
Date: Tue, 29 Jan 2013 15:46:54 +0100	[thread overview]
Message-ID: <1359470814-7993-5-git-send-email-tiwai@suse.de> (raw)
In-Reply-To: <1359470814-7993-1-git-send-email-tiwai@suse.de>

FW_STATUS_ABORT can be set only during the user-helper invocation,
thus we can ignore the check when CONFIG_HW_LOADER_USER_HELPER is
disabled.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/base/firmware_class.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 8c40257..9753a78 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -447,6 +447,9 @@ static void fw_load_abort(struct firmware_priv *fw_priv)
 	complete_all(&buf->completion);
 }
 
+#define is_fw_load_aborted(buf)	\
+	test_bit(FW_STATUS_ABORT, &(buf)->status)
+
 static int loading_timeout = 60;	/* In seconds */
 
 static inline long firmware_loading_timeout(void)
@@ -914,6 +917,10 @@ fw_load_from_user_helper(struct firmware *firmware, const char *name,
 {
 	return -ENOENT;
 }
+
+/* No abort during direct loading */
+#define is_fw_load_aborted(buf) false
+
 #endif /* CONFIG_FW_LOADER_USER_HELPER */
 
 
@@ -924,7 +931,7 @@ static int sync_cached_firmware_buf(struct firmware_buf *buf)
 
 	mutex_lock(&fw_lock);
 	while (!test_bit(FW_STATUS_DONE, &buf->status)) {
-		if (test_bit(FW_STATUS_ABORT, &buf->status)) {
+		if (is_fw_load_aborted(buf)) {
 			ret = -ENOENT;
 			break;
 		}
@@ -986,7 +993,7 @@ static int assign_firmware_buf(struct firmware *fw, struct device *device)
 	struct firmware_buf *buf = fw->priv;
 
 	mutex_lock(&fw_lock);
-	if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status)) {
+	if (!buf->size || is_fw_load_aborted(buf)) {
 		mutex_unlock(&fw_lock);
 		return -ENOENT;
 	}
-- 
1.8.1.1


  parent reply	other threads:[~2013-01-29 14:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29 14:46 [PATCH 0/4] firmware: Make user-mode helper optional (v3) Takashi Iwai
2013-01-29 14:46 ` [PATCH 1/4] firmware: Refactoring for splitting user-mode helper code Takashi Iwai
2013-01-30  3:37   ` Ming Lei
2013-01-30  7:17     ` Takashi Iwai
2013-01-30 10:25       ` Ming Lei
2013-01-30 10:31         ` Takashi Iwai
2013-01-30 10:50           ` Ming Lei
2013-01-30 10:53             ` Takashi Iwai
2013-01-30 11:08               ` Ming Lei
2013-01-30 11:08               ` Takashi Iwai
2013-01-30 11:48                 ` Ming Lei
2013-01-30 12:04                   ` Takashi Iwai
2013-01-29 14:46 ` [PATCH 2/4] firmware: Make user-mode helper optional Takashi Iwai
2013-01-29 14:46 ` [PATCH 3/4] firmware: Reduce ifdef CONFIG_FW_LOADER_USER_HELPER Takashi Iwai
2013-01-29 14:46 ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-01-31 10:13 [PATCH 0/4] firmware: Make user-mode helper optional (v5) Takashi Iwai
2013-01-31 10:13 ` [PATCH 4/4] firmware: Ignore abort check when no user-helper is used Takashi Iwai
2013-01-30 10:35 [PATCH 0/4] firmware: Make user-mode helper optional (v4) Takashi Iwai
2013-01-30 10:35 ` [PATCH 4/4] firmware: Ignore abort check when no user-helper is used Takashi Iwai
2013-01-25 16:05 [PATCH 0/4] firmware: Make user-mode helper optional (v2) Takashi Iwai
2013-01-25 16:05 ` [PATCH 4/4] firmware: Ignore abort check when no user-helper is used Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359470814-7993-5-git-send-email-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.lei@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).