mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: riyer <riyer@nvidia.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "rydberg@euromail.se" <rydberg@euromail.se>,
	Stephen Warren <swarren@nvidia.com>,
	Laxman Dewangan <ldewangan@nvidia.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Subject: Re: [PATCH v1] Input: tegra-kbc - report wakeup key for some platforms.
Date: Sun, 4 Dec 2011 17:18:17 -0800	[thread overview]
Message-ID: <1323047897.3056.14.camel@riyer-dt2.nvidia.com> (raw)
In-Reply-To: <20111204085038.GC14593@core.coreip.homeip.net>

Hello Dmitry.
Please find replies inline.

On Sun, 2011-12-04 at 00:50 -0800, Dmitry Torokhov wrote:
> Hi Rakesh,
> 
> On Thu, Dec 01, 2011 at 01:09:59PM -0800, Rakesh Iyer wrote:
> > Hello Dmitry.
> > 
> > Sorry for the wrap issue, my Outlook does not seem to obey the settings.
> > 
> > I wanted to explain the tegra system resume path implementation so I can justify 
> > why I am doing this complicated fix and why I feel it will guarantee the resume 
> > is due to keypress.
> > 
> > The tegra wake resume code is registered as a syscore ops.
> > When the system is resumed due to a wake event, the suspend_enter (after wakeup) 
> > routine will invoke the tegra syscoreops_resume method and that routine will propagate 
> > the wake event to the individual ISR's through genirq.
> > If kbc was wake source, kbc_isr will be invoked in this execution path.
> > 
> > If system is resumed due to other reason, the tegra_syscoreops_resume code will not 
> > find the event.
> 
> Consider the following sequence:
> 
> 1. Something other than keyboard generates wakeup event
> 2. It's IRQ fires up and gets serviced
At this point syscoreops_resume has finished all its wakeup processing.

> 3. System starts resuming devices
> 4. User presses a key on the keypad while it is still suspended _and_
>    registered as a wakeup source
This will have no impact on the system and keypad ISR will not be
invoked.
> 5. Keypad's ISR runs as well and you decide that KEY_POWER should be
>    reported even though keypad wasn't the real reason the system
>    woke up.
The interrupt line we use to detect wakeup processing is the keypress
interrupt which is disabled and will never cause the ISR invocation from
a device interrupt(i.e. the PIC).

In other words KBC isr gets invoked for 2 reasons
a) FIFO interrupt is generated, which will not happen as long as
scanning logic is disabled until kbc_resume executes.
b) The syscoreops_resume codepath calls into the ISR after finding KBC
was a wakesource. If this happens it will happen only when the kernel
resumes from its suspend code path.
> 
> Is this scenario not possible?
> 
> Thanks.
> 
With that being the case do you think the fix makes sense?

Regards
Rakesh


  reply	other threads:[~2011-12-05  1:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-30 20:43 riyer
2011-11-30 21:07 ` Stephen Warren
2011-11-30 21:20 ` Dmitry Torokhov
2011-11-30 22:14   ` Rakesh Iyer
2011-12-01  7:26     ` Dmitry Torokhov
2011-12-01 21:09       ` Rakesh Iyer
2011-12-04  8:50         ` Dmitry Torokhov
2011-12-05  1:18           ` riyer [this message]
2011-12-05  4:27             ` Dmitry Torokhov
2011-12-05  5:52               ` Rakesh Iyer
2011-12-29 10:32 ` Dmitry Torokhov

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=1323047897.3056.14.camel@riyer-dt2.nvidia.com \
    --to=riyer@nvidia.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rydberg@euromail.se \
    --cc=swarren@nvidia.com \
    /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

all inboxes | Powered by JetHome®