mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Aleksey Kuleshov <rndfax@yandex.ru>
To: barebox@lists.infradead.org
Cc: Aleksey Kuleshov <rndfax@yandex.ru>
Subject: [PATCH 2/2] input: make the Input Core be the last in the poller queue
Date: Thu,  3 Mar 2016 18:17:10 +0300	[thread overview]
Message-ID: <1457018230-4554-2-git-send-email-rndfax@yandex.ru> (raw)
In-Reply-To: <1457018230-4554-1-git-send-email-rndfax@yandex.ru>

This prevents the case when Input Core and event providers
have to run "at one time" so Input Core will work with non-relevant
data since it will be called first.
---
 drivers/input/input.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 31a9c22..1a8efc6 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -178,11 +178,13 @@ static void input_console_notify(struct input_notifier *in,
 	if (ev->value) {
 		kfifo_putc(ic->fifo, ascii);
 		ic->current_key = ascii;
+		poller_async_register(&ic->poller);
 		poller_call_async(&ic->poller, 400 * MSECOND,
 				  input_console_repeat, ic);
 	} else {
 		ic->current_key = 0;
 		poller_async_cancel(&ic->poller);
+		poller_async_unregister(&ic->poller);
 	}
 }
 
@@ -199,7 +201,6 @@ static int input_init(void)
 	ic->fifo = kfifo_alloc(32);
 	ic->notifier.notify = input_console_notify;
 	input_register_notfier(&ic->notifier);
-	poller_async_register(&ic->poller);
 
 	return console_register(&ic->console);
 }
-- 
2.6.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-03-03 15:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 15:17 [PATCH 1/2] poller: allow safely remove pollers in any time Aleksey Kuleshov
2016-03-03 15:17 ` Aleksey Kuleshov [this message]
2016-03-04  7:19   ` [PATCH 2/2] input: make the Input Core be the last in the poller queue Sascha Hauer
2016-03-04 10:18     ` Aleksey Kuleshov
2016-03-07  7:30       ` Sascha Hauer
2016-03-07  9:16         ` Aleksey Kuleshov
2016-03-10  9:26           ` Sascha Hauer
2016-03-11 12:25             ` Aleksey Kuleshov
2016-03-11 14:51               ` Sascha Hauer
2016-03-11 15:12                 ` Aleksey Kuleshov
2016-03-14 16:26             ` Aleksey Kuleshov
2016-03-16  7:17               ` Sascha Hauer
2016-03-03 16:54 ` [PATCH 1/2] poller: allow safely remove pollers in any time Antony Pavlov

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=1457018230-4554-2-git-send-email-rndfax@yandex.ru \
    --to=rndfax@yandex.ru \
    --cc=barebox@lists.infradead.org \
    /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