[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1421078495-12081-1-git-send-email-ming.lei@canonical.com>
Date: Tue, 13 Jan 2015 00:01:35 +0800
From: Ming Lei <ming.lei@...onical.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, Sasha Levin <sasha.levin@...cle.com>,
Ming Lei <ming.lei@...onical.com>
Subject: [PATCH 1/2] firmware_loader: abort request if wait_for_completion is interrupted
If current request is interrupted by signal, such as 'ctrl + c',
this request has to be aborted for the following reasons:
- the buf need to be removed from pending list
- same requests from other contexts need to be completed
Reported-by: Sasha Levin <sasha.levin@...cle.com>
Signed-off-by: Ming Lei <ming.lei@...onical.com>
---
drivers/base/firmware_class.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 58470c3..6bed4ae 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -927,6 +927,13 @@ static int _request_firmware_load(struct firmware_priv *fw_priv,
retval = wait_for_completion_interruptible(&buf->completion);
cancel_delayed_work_sync(&fw_priv->timeout_work);
+
+ if (retval == -ERESTARTSYS) {
+ mutex_lock(&fw_lock);
+ fw_load_abort(fw_priv);
+ mutex_unlock(&fw_lock);
+ }
+
if (is_fw_load_aborted(buf))
retval = -EAGAIN;
else if (!buf->data)
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists