All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about timers during system suspend
@ 2011-01-04 21:14 Raj Kumar
  2011-01-04 23:05 ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Raj Kumar @ 2011-01-04 21:14 UTC (permalink / raw)
  To: linux-pm



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?
 
If the timer is active, will it prevent the system from full suspend?
 
The another thing is during system suspend, how the user space code know about suspend?
 
One way is that device driver gets the suspend and it notifies the user space. 
 
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?
 
 
Regards
Raj 		 	   		  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Question about timers during system suspend
  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
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-01-04 23:05 UTC (permalink / raw)
  To: Raj Kumar; +Cc: linux-pm

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Question about timers during system suspend
  2011-01-04 23:05 ` Rafael J. Wysocki
@ 2011-01-04 23:57   ` Raj Kumar
  2011-01-05  8:27     ` Rafael J. Wysocki
  0 siblings, 1 reply; 7+ messages in thread
From: Raj Kumar @ 2011-01-04 23:57 UTC (permalink / raw)
  To: rjw; +Cc: linux-pm


 
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.
 
right??
 
or is it mandatory to cancel the software timer during suspend callback to device driver?
 
 
Regards
raj
 



----------------------------------------
> 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 		 	   		  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Question about timers during system suspend
  2011-01-04 23:57   ` Raj Kumar
@ 2011-01-05  8:27     ` Rafael J. Wysocki
  2011-03-18 13:45       ` Question about hibernation Raj Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2011-01-05  8:27 UTC (permalink / raw)
  To: Raj Kumar; +Cc: linux-pm

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 		 	   		  
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Question about hibernation
  2011-01-05  8:27     ` Rafael J. Wysocki
@ 2011-03-18 13:45       ` Raj Kumar
  2011-03-18 14:09         ` Oliver Neukum
  0 siblings, 1 reply; 7+ messages in thread
From: Raj Kumar @ 2011-03-18 13:45 UTC (permalink / raw)
  To: linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 439 bytes --]



Hi,

I have following question regarding the hibernation. If a device driver uses dedicated memory (dedicated memory in linux which is not OS addressable e.g. device driver is using some pages from dedicated memory), When the system hibernates, will this be responsibility of device driver to save this area 
or 
OS hibernation procedure save this area of ram (dedicated memory area) into swap image?

Thanks
Raj  
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 659 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Question about hibernation
  2011-03-18 13:45       ` Question about hibernation Raj Kumar
@ 2011-03-18 14:09         ` Oliver Neukum
  2011-03-19 23:47           ` Raj Kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Oliver Neukum @ 2011-03-18 14:09 UTC (permalink / raw)
  To: linux-pm; +Cc: Raj Kumar

Am Freitag, 18. März 2011, 14:45:24 schrieb Raj Kumar:
> 
> Hi,
> 
> I have following question regarding the hibernation. If a device driver uses dedicated memory (dedicated memory in linux which is not OS addressable e.g. device driver is using some pages from dedicated memory), When the system hibernates, will this be responsibility of device driver to save this area 
> or 
> OS hibernation procedure save this area of ram (dedicated memory area) into swap image?

If you got it from get_free_pages (at the end of a long call chain) the
kernel saves it. If not, it is your problem.

	HTH
		Oliver

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Question about hibernation
  2011-03-18 14:09         ` Oliver Neukum
@ 2011-03-19 23:47           ` Raj Kumar
  0 siblings, 0 replies; 7+ messages in thread
From: Raj Kumar @ 2011-03-19 23:47 UTC (permalink / raw)
  To: oneukum, linux-pm


[-- Attachment #1.1: Type: text/plain, Size: 1136 bytes --]


Hi,
 
Thanks for reply. What if memory is allocated using dma_alloc_coherent where the physical address is from dedicated area of RAM(which is not addressable by OS)? I also believe that all the buffers and state variables are taken care by OS kernel. Right?
 
Thanks
Raj
 

 
> From: oneukum@suse.de
> To: linux-pm@lists.linux-foundation.org
> Subject: Re: [linux-pm] Question about hibernation
> Date: Fri, 18 Mar 2011 15:09:02 +0100
> CC: rajkumar278@hotmail.com
> 
> Am Freitag, 18. März 2011, 14:45:24 schrieb Raj Kumar:
> > 
> > Hi,
> > 
> > I have following question regarding the hibernation. If a device driver uses dedicated memory (dedicated memory in linux which is not OS addressable e.g. device driver is using some pages from dedicated memory), When the system hibernates, will this be responsibility of device driver to save this area 
> > or 
> > OS hibernation procedure save this area of ram (dedicated memory area) into swap image?
> 
> If you got it from get_free_pages (at the end of a long call chain) the
> kernel saves it. If not, it is your problem.
> 
> HTH
> Oliver
 		 	   		  

[-- Attachment #1.2: Type: text/html, Size: 1500 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-03-19 23:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2011-03-18 13:45       ` Question about hibernation Raj Kumar
2011-03-18 14:09         ` Oliver Neukum
2011-03-19 23:47           ` Raj Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.