From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Daniel Drake <dsd@laptop.org>
Cc: linux-input@vger.kernel.org, linux-pm@lists.linux-foundation.org,
rjw@sisk.pl, dilinger@queued.net, pgf@laptop.org
Subject: Re: [PATCH v4 1/2] Input: enable i8042-level wakeup control
Date: Wed, 17 Aug 2011 00:03:51 -0700 [thread overview]
Message-ID: <20110817070351.GE29361@core.coreip.homeip.net> (raw)
In-Reply-To: <CAMLZHHTie_u40NZ40o+LCwffk=3LbY96YTwxQt5wcVtbTc53qg@mail.gmail.com>
Hi Daniel,
On Thu, Aug 11, 2011 at 07:02:17PM +0100, Daniel Drake wrote:
> Hi Dmitry,
>
> On Fri, Aug 5, 2011 at 4:24 PM, Daniel Drake <dsd@laptop.org> wrote:
> > I've started looking at this, but my first problem is that when the
> > input layer asks atkbd to turn off LEDs, atkbd schedules a workqueue
> > item to undertake this work. However, as there is no synchronization,
> > this work only seems to get executed during or after system resume.
> > This makes it hard to catch with such a scheme. Any ideas?
>
> I've looked closer, and am keeping my eyes open for other options too.
>
> During suspend of the input layer, input_dev_suspend() calls
> input_dev_toggle(dev, false) which turns off LEDs and sounds.
>
> On the XO laptops, we don't have LEDs, nor sounds, and we don't have
> num lock, scroll lock or caps lock keys. So the suspend code does
> nothing - there are no lights to turn off. So far so good.
>
> Moving to the resume case: input_dev_resume() calls
> input_reset_device(). This calls input_dev_toggle(dev, true), which
> asks atkbd to turn the non-existent keyboard LEDs off. I guess this is
> harmless and is unlikely to be the cause of the problems which led us
> to need to disable this code in light of the following:
>
> After calling input_dev_toggle(), input_dev_resume() does this:
>
> /*
> * Keys that have been pressed at suspend time are unlikely
> * to be still pressed when we resume.
> */
> spin_lock_irq(&dev->event_lock);
> input_dev_release_keys(dev);
> spin_unlock_irq(&dev->event_lock);
>
> We definitely don't want this to happen in our case, where we have
> maintained full control and power of the device during suspend/resume.
>
> This particular important code snippet would not even have been
> disabled by your suggestion of blocking data transfer at the
> i8042-level.
>
> So, I think we need a new approach at solving this, and I think it has
> to be one that interacts at the input_dev layer.
OK, so we have the following scenario:
- we do not need to worry about SND and LED on OLPC;
- we do not need to worry about releasing the key that was pressed
when we went to sleep because they system would not go to sleep while
there is a key pressed. So the code in input_dev_resume() won't
actually release any keys unless a key was held pressed and we forced
system to sleep somehow.
- we need to make sure we do not loose key press (and following events)
when we are waking up.
Can atkbd driver stash away serio byte data (when not in command mode)
and replay it when pm notifier signals us that resume process is done?
Thanks.
--
Dmitry
next prev parent reply other threads:[~2011-08-17 7:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 15:49 [PATCH v4 1/2] Input: enable i8042-level wakeup control Daniel Drake
2011-08-03 6:59 ` Dmitry Torokhov
2011-08-03 8:04 ` Daniel Drake
2011-08-03 18:43 ` Dmitry Torokhov
2011-08-03 19:24 ` Daniel Drake
2011-08-03 19:38 ` Dmitry Torokhov
2011-08-03 19:51 ` Daniel Drake
2011-08-05 15:24 ` Daniel Drake
2011-08-11 18:02 ` Daniel Drake
2011-08-17 7:03 ` Dmitry Torokhov [this message]
2011-09-03 12:45 ` Daniel Drake
2011-08-03 8:12 ` Wanlong Gao
-- strict thread matches above, loose matches on Subject: below --
2011-08-02 15:49 Daniel Drake
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=20110817070351.GE29361@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=dilinger@queued.net \
--cc=dsd@laptop.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pgf@laptop.org \
--cc=rjw@sisk.pl \
/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;
as well as URLs for NNTP newsgroup(s).