public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Raj Kumar <rajkumar278@hotmail.com>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Question about timers during system suspend
Date: Wed, 5 Jan 2011 09:27:53 +0100	[thread overview]
Message-ID: <201101050927.53977.rjw@sisk.pl> (raw)
In-Reply-To: <BLU102-W11E15CD0A639C1DE2097CAEB080@phx.gbl>

On Wednesday, January 05, 2011, Raj Kumar wrote:
> 
> Dear rafael,
>  
> Thanks for quick reply.
>  
> >> I have question regarding the timers during system suspend. If a software timer is
> > > active in device driver, will this timer be stopped during system suspend?
> >
> > What do you mean by "stopped"? Do you mean canceled?
>  
> I mean cancel the software timer. But if the software timer is active as you
> already mentioned it will not prevent system suspend. I mean to say if the
> driver has active software timer means software timer is not fired yet and
> device driver will return from suspend callback without cancelation software
> timer and it times out after this will not prevent system suspend to return
> error code.

I'm not really sure what you mean.  If the timer expires right after the
suspend routine has returned, then either the timer function will run
immediately (so you need to take that into consideration), if the timer
interrupt is still enabled at this point, or it will run during resume
(asynchronously with respect to the driver's resume routine).

> right??
>  
> or is it mandatory to cancel the software timer during suspend callback to device driver?

I guess it's better to cancel the timer directly from the suspend routine, but
it is not formally required to do so.

Thanks,
Rafael

 
> ----------------------------------------
> > From: rjw@sisk.pl
> > To: rajkumar278@hotmail.com
> > Subject: Re: [linux-pm] Question about timers during system suspend
> > Date: Wed, 5 Jan 2011 00:05:42 +0100
> > CC: linux-pm@lists.linux-foundation.org
> >
> > On Tuesday, January 04, 2011, Raj Kumar wrote:
> > >
> > > Hi,
> >
> > Hi,
> >
> > > I have question regarding the timers during system suspend. If a software timer is
> > > active in device driver, will this timer be stopped during system suspend?
> >
> > What do you mean by "stopped"? Do you mean canceled?
> >
> > > If the timer is active, will it prevent the system from full suspend?
> >
> > No, it won't.
> >
> > > The another thing is during system suspend, how the user space code know about suspend?
> >
> > It doesn't, unless it's notified by the user space process initiating suspend.
> >
> > > One way is that device driver gets the suspend and it notifies the user space.
> >
> > That doesn't work, because user space is frozen when drivers' suspend routines
> > are being called. It might work if the driver in question registered a power
> > management notifier and sent a notification to user space from there.
> >
> > > But is there way that during system goes into full suspend, is any user space component that will
> > > give notifications to applications that has registered for system suspend transition?
> >
> > That depends on the configuration of user space. pm-utils can do that for one
> > example.
> >
> > Thanks,
> > Rafael 		 	   		  
> 

  reply	other threads:[~2011-01-05  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 21:14 Question about timers during system suspend Raj Kumar
2011-01-04 23:05 ` Rafael J. Wysocki
2011-01-04 23:57   ` Raj Kumar
2011-01-05  8:27     ` Rafael J. Wysocki [this message]
2011-03-18 13:45       ` Question about hibernation Raj Kumar
2011-03-18 14:09         ` Oliver Neukum
2011-03-19 23:47           ` Raj Kumar

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=201101050927.53977.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rajkumar278@hotmail.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