public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: balrogg@gmail.com
Cc: Linux-OMAP <linux-omap-open-source@linux.omap.com>
Subject: Re: Suspending with keypad bug (RFC)
Date: Fri, 11 Aug 2006 13:04:04 +0300	[thread overview]
Message-ID: <20060811100403.GF6720@atomide.com> (raw)
In-Reply-To: <fb249edb0608092155r20c17f5dl6397c3d9d191105b@mail.gmail.com>

* andrzej zaborowski <balrog@zabor.org> [060810 07:56]:
> On 06/08/06, Juha Yrjölä <juha.yrjola@solidboot.com> wrote:
> >andrzej zaborowski wrote:
> >
> >> I came up with a different fix, in the keypad driver but it's a bit
> >> more intrusive. With this the device sleeps peacefully until another
> >> key-press is detected. What should be the correct behavior?
> >> I'm attaching both changes.
> >
> >This approach is better; the generic PM code should not have to care
> >that much about different wakeup sources.
> >
> >I'm not exactly sure in which state the system is when the suspend
> >function is called.  Can there still be timer activity, for example?
> 
> I think yes, some suspend functions may rely on timers because they
> are not obliged to return immdiately.
> 
> >Nevertheless, you're safer doing a spin_lock_irqsave() in the suspend
> >function first, and releasing the lock only after setting the suspended
> >variable and re-enabling the interrupt.
> >
> >You should also check whether you're actually running on OMAP1 before
> >you write to the register.
> >
> >In the IRQ handler, you should also do a spin_lock_irqsave() before
> >accessing the suspended variable.
> 
> Thanks for help! I'm attaching the corrected version, it works nicely.
> 
> In the irq handler I release the lock just after accessing the
> "suspended" variable because as I understand an irq handler will never
> be interrupted by something that calls the suspend function.

Can you please repost with proper comments and Signed-off-by?

Thanks,

Tony

  reply	other threads:[~2006-08-11 10:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-04 23:33 Suspending with keypad bug (RFC) andrzej zaborowski
2006-08-06 19:25 ` Juha Yrjölä
2006-08-10  4:55   ` andrzej zaborowski
2006-08-11 10:04     ` Tony Lindgren [this message]
2006-08-13  9:36     ` Juha Yrjölä
2006-08-17 19:43       ` andrzej zaborowski

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=20060811100403.GF6720@atomide.com \
    --to=tony@atomide.com \
    --cc=balrogg@gmail.com \
    --cc=linux-omap-open-source@linux.omap.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