linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Daniel Drake <dsd@laptop.org>
Cc: rjw@sisk.pl, Paul Fox <pgf@laptop.org>,
	linux-input@vger.kernel.org,
	Alan Stern <stern@rowland.harvard.edu>,
	linux-pm@lists.linux-foundation.org
Subject: Re: Problem statement: Opportunistic suspend and i8042 wakeups
Date: Wed, 26 Oct 2011 22:47:26 -0700	[thread overview]
Message-ID: <20111027054726.GE15725@core.coreip.homeip.net> (raw)
In-Reply-To: <CAMLZHHTjZdxiRsEP=tQyQafkPHftOtq6XRgd09MdCJowSxKCvA@mail.gmail.com>

On Thu, Oct 13, 2011 at 03:25:04PM +0100, Daniel Drake wrote:
> Hi,
> 
> Thanks for not getting bored of this :)
> 
> On Mon, Oct 10, 2011 at 9:38 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > I think input layer releasing keys at resume time is actually in the
> > wrong here, as it meddles with device state after physical device
> > (i8042, atkbd, etc) are fully woken up.
> 
> Yes, that's whats happening here.
> 
> > IIRC I put releasing originally in resume because I was concerned
> > with events getting discarded after S2D because we thew away the state
> > that happens after taking snapshot and there weren't enough granularity
> > in PM callbacks to differentiate between S2D and S2R.
> >
> > I believe if we move release of the keys into suspend handlers then
> > input core should not get into the middle of things for your case as you
> > said that the OLPC device will not suspend with a key still pressed and
> > upon release we would not be doing anything with key state (but
> > restore LED/SOUND only) which you do not care about.
> 
> Not quite.
> 
> The system will suspend, but will resume immediately (because of an
> incoming key press interrupt, which are repeated when the key is held
> down).

Ah, I thought it won't even attempt to suspend while key is depressed.

> So, if Linux fabricates a key release event in the suspend
> handler, userspace would see two key release events: the fabricated
> one, and the one that comes from when the user later releases the key
> resulting in a break interrupt.  This would cause two characters to be
> printed on screen when the user only pressed the key once.

Input core will suppress the 2nd release though so I do not think that
userspace will see it.

Thanks.

-- 
Dmitry

  reply	other threads:[~2011-10-27  5:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-10 19:24 Problem statement: Opportunistic suspend and i8042 wakeups Daniel Drake
2011-10-10 20:38 ` Dmitry Torokhov
2011-10-13 14:25   ` Daniel Drake
2011-10-27  5:47     ` Dmitry Torokhov [this message]
2011-10-11  0:10 ` Alan Stern

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=20111027054726.GE15725@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --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 \
    --cc=stern@rowland.harvard.edu \
    /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).