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.

In the kbc we ignore all keypresses until kbc_resume re-enables the fifo 
interrupt.
So the only way to generate this key would be if the tegra_syscoreops_resume 
finds that kbc was wake source

Maybe my understanding is wrong. Please feel free to correct me.

Regards
Rakesh

> -----Original Message-----
> From: Dmitry Torokhov [mailto:[email protected]]
> Sent: Wednesday, November 30, 2011 11:27 PM
> To: Rakesh Iyer
> Cc: [email protected]; Stephen Warren; Laxman Dewangan; linux-
> [email protected]; [email protected]; 
> [email protected]
> Subject: Re: [PATCH v1] Input: tegra-kbc - report wakeup key for some 
> platforms.
> 
> On Wed, Nov 30, 2011 at 02:14:03PM -0800, Rakesh Iyer wrote:
> > Thanks Dmitry.
> >
> > Since there can be multiple wake causes I wanted to isolate wake key
> > generation to the case where keyboard actually generated the wake
> > interrupt.
> 
> I do not think you can guarantee this though because if user touches
> keyboard "too early", before your resume method had a chance to disable
> kbc interrupt as a wakeup source, you are still going to get that
> interrupt and deliver KEY_POWER even though KBC is not the actual wakeup
> source.
> 
> So don't over-complicate it. If hardware can't detect actual key pressed
> just emit KEY_POWER if a key was at any time between calls to
> tegra_kbc_suspend() and tegra_kbc_resume().
> 
> BTW, could you please have your MUA wrap long lines around 75 column or so?
> 
> Thanks.
> 
> --
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to