[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1445934805-5690-1-git-send-email-czoborbalint@gmail.com>
Date: Tue, 27 Oct 2015 09:33:25 +0100
From: Bálint Czobor <czoborbalint@...il.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
Daniel Rosenberg <drosen@...gle.com>,
Bálint Czobor <czoborbalint@...il.com>
Subject: [PATCH 3/3] input: Made keyreset more robust
From: Daniel Rosenberg <drosen@...gle.com>
Switched do_restart to run in a seperate workqueue to handle
cases where kernel_restart hangs.
Signed-off-by: Daniel Rosenberg <drosen@...gle.com>
Signed-off-by: Bálint Czobor <czoborbalint@...il.com>
---
drivers/input/keyreset.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyreset.c b/drivers/input/keyreset.c
index eaaccde..7fbf724 100644
--- a/drivers/input/keyreset.c
+++ b/drivers/input/keyreset.c
@@ -27,9 +27,10 @@ struct keyreset_state {
int restart_requested;
int (*reset_fn)(void);
struct platform_device *pdev_child;
+ struct work_struct restart_work;
};
-static void do_restart(void)
+static void do_restart(struct work_struct *unused)
{
sys_sync();
kernel_restart(NULL);
@@ -44,7 +45,7 @@ static void do_reset_fn(void *priv)
state->restart_requested = state->reset_fn();
} else {
pr_info("keyboard reset\n");
- do_restart();
+ schedule_work(&state->restart_work);
state->restart_requested = 1;
}
}
@@ -69,6 +70,7 @@ static int keyreset_probe(struct platform_device *pdev)
if (!state->pdev_child)
return -ENOMEM;
state->pdev_child->dev.parent = &pdev->dev;
+ INIT_WORK(&state->restart_work, do_restart);
keyp = pdata->keys_down;
while ((key = *keyp++)) {
--
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