public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor@insightbb.com>
To: Indan Zupancic <indan@nul.nu>
Cc: Pavel Machek <pavel@ucw.cz>,
	Henrique de Moraes Holschuh <hmh@hmh.eng.br>,
	Andi Kleen <ak@suse.de>, Jiri Kosina <jikos@jikos.cz>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.22-rc[23]: blinking capslock led, stuck keys?
Date: Fri, 15 Jun 2007 23:34:39 -0400	[thread overview]
Message-ID: <200706152334.40387.dtor@insightbb.com> (raw)
In-Reply-To: <33677.81.207.0.53.1181959473.squirrel@secure.samage.net>

On Friday 15 June 2007 22:04, Indan Zupancic wrote:
> On Fri, June 15, 2007 07:41, Dmitry Torokhov wrote:
> >  /*
> > + * Schedule switch for execution. We need to throttle requests,
> > + * otherwise keyboard may become unresponsive.
> > + */
> > +static void atkbd_schedule_event_work(struct atkbd *atkbd, int event_bit)
> > +{
> > +	unsigned long delay = msecs_to_jiffies(50);
> > +
> > +	if (time_after(jiffies, atkbd->event_jiffies + delay))
> > +		delay = 0;
> > +
> > +	atkbd->event_jiffies = jiffies;
> > +	set_bit(event_bit, &atkbd->event_mask);
> > +	wmb();
> > +	schedule_delayed_work(&atkbd->event_work, delay);
> > +}
> 
> I don't know whether schedule_delayed_work() requeues event_work, or if
> it adds more work, but both seem to give wrong behaviour:

Well, my advise would be to research the matter before saying that
it will not work.

> In the first case 
> event_work can be postponed forever if atkbd_schedule_event_work() is
> called repeatedly each time within 50 ms, and for the second case there's a
> delay added, but the number of times the LED is switched stays the same,
> so it's not being throttled.
> 

No, once work is queued for execution subsequent attempts to queue the
same work will be ignored (until work starts executing). Therefore first
time work will be scheduled for execution immediately and then execution
be spaced by ~50 ms.

-- 
Dmitry

  reply	other threads:[~2007-06-16  3:34 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-04 11:24 2.6.22-rc[23]: blinking capslock led, stuck keys? Pavel Machek
2007-06-04 12:08 ` Éric Piel
2007-06-04 12:35 ` Jiri Kosina
2007-06-04 13:09   ` Pavel Machek
2007-06-04 13:12     ` Jiri Kosina
2007-06-04 13:36       ` Pavel Machek
2007-06-04 13:38         ` Jiri Kosina
2007-06-04 13:43       ` Andi Kleen
2007-06-04 13:54         ` Pavel Machek
2007-06-04 14:02           ` Dmitry Torokhov
2007-06-04 14:13             ` thinkpad testers wanted (was Re: 2.6.22-rc[23]: blinking capslock led, stuck keys?) Pavel Machek
2007-06-04 15:06               ` Björn Steinbrink
2007-06-04 15:10                 ` Pavel Machek
2007-06-04 16:20                   ` Björn Steinbrink
2007-06-04 15:11               ` Johannes Stezenbach
2007-06-04 15:18               ` Dmitry Torokhov
2007-06-04 20:55                 ` Pavel Machek
2007-06-04 16:40               ` Michael Tokarev
2007-06-04 16:34             ` 2.6.22-rc[23]: blinking capslock led, stuck keys? Henrique de Moraes Holschuh
2007-06-04 17:46               ` Dmitry Torokhov
2007-06-04 20:57                 ` Pavel Machek
2007-06-12  5:42                   ` Dmitry Torokhov
2007-06-12 23:35                     ` Indan Zupancic
2007-06-13  8:18                       ` Pavel Machek
2007-06-13 14:09                         ` Indan Zupancic
2007-06-15  5:41                           ` Dmitry Torokhov
2007-06-16  2:04                             ` Indan Zupancic
2007-06-16  3:34                               ` Dmitry Torokhov [this message]
2007-06-16 11:54                                 ` Indan Zupancic
2007-06-16 15:58                                   ` Dmitry Torokhov
2007-06-04 18:04               ` Andi Kleen
2007-06-04 15:10       ` Indan Zupancic
2007-06-04 15:13         ` Pavel Machek
2007-06-04 12:35 ` Indan Zupancic
2007-06-04 12:38   ` Jiri Kosina
2007-06-04 14:43     ` Indan Zupancic
     [not found] <8siVc-46n-17@gated-at.bofh.it>
     [not found] ` <8sktY-6G7-13@gated-at.bofh.it>
     [not found]   ` <8skDC-6Su-5@gated-at.bofh.it>
     [not found]     ` <8sl6G-7uE-9@gated-at.bofh.it>
     [not found]       ` <8slgk-7Gl-3@gated-at.bofh.it>
     [not found]         ` <8slq0-89X-9@gated-at.bofh.it>
     [not found]           ` <8snLc-3ik-29@gated-at.bofh.it>
2007-06-06 11:26             ` Bodo Eggert

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=200706152334.40387.dtor@insightbb.com \
    --to=dtor@insightbb.com \
    --cc=ak@suse.de \
    --cc=hmh@hmh.eng.br \
    --cc=indan@nul.nu \
    --cc=jikos@jikos.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /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