mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Aleksey Kuleshov <rndfax@yandex.ru>
Cc: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] input: make the Input Core be the last in the poller queue
Date: Wed, 16 Mar 2016 08:17:41 +0100	[thread overview]
Message-ID: <20160316071741.GS30994@pengutronix.de> (raw)
In-Reply-To: <5303551457972793@web8j.yandex.ru>

On Mon, Mar 14, 2016 at 07:26:33PM +0300, Aleksey Kuleshov wrote:
> Genius USB keyboard can't work with interrupt msgs, only control msgs.
> Then, with control msgs if there were no report requests during ~10 secs, EHCI stack
> in Barebox reports "timeout error" infinitely until 'usb' command will be exectued
> (i.e. until EHCI halt + reset).
> 
> So:
> 
> 1) usb_kbd can detect "timeout error" (or some other error) so your patch, as for now,
> lacks status checking from idev->poll().
> 
> 2) I know this is a WIP patch, but
> 
> > +static void input_devices_poller_func(struct poller_struct *poller)
> >  {
> > - struct input_console *ic = ctx;
> > + struct input_device *idev;
> > + static uint64_t last_poll;
> > + struct input_notifier *in;
> > +
> > + if (!is_timeout(last_poll, 10 * MSECOND))
> > + return;
> 
> the last_poll var was never set and why 'is_timeout' is here if you have async_calls?

The intention was to limit input polling to every 10ms. Indeed the above
doesn't work as expected and could be better done with an async poller.

> Maybe it should be like this?:
> 
> static struct poller_async input_poller;
> static void input_devices_poller_func(void *arg)
> {
>         struct input_device *idev;
>         struct input_notifier *in;
> 
>         list_for_each_entry(idev, &input_devices, list) {
>                 idev->poll(idev);
> 
>                 if (idev->event.value && is_timeout(idev->start, idev->timeout)) {
>                         list_for_each_entry(in, &input_consumers, list)
>                                 in->notify(in, &idev->event);
>                         idev->timeout = 40 * MSECOND;
>                         idev->start = get_time_ns();
>                 }
>         }
> 
>         poller_call_async(&input_poller, 10 * MSECOND, input_devices_poller_func, NULL);
> }

Yes, looks better.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

  reply	other threads:[~2016-03-16  7:18 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 ` [PATCH 2/2] input: make the Input Core be the last in the poller queue Aleksey Kuleshov
2016-03-04  7:19   ` 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 [this message]
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=20160316071741.GS30994@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=rndfax@yandex.ru \
    /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