<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 14, 2014 at 2:11 AM, Ran Shalit <span dir="ltr"><<a href="mailto:ranshalit@gmail.com" target="_blank">ranshalit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Thu, Sep 11, 2014 at 12:24 PM, Ran Shalit <<a href="mailto:ranshalit@gmail.com">ranshalit@gmail.com</a>> wrote:<br>
> On Thu, Sep 11, 2014 at 8:32 AM, AYAN KUMAR HALDER <<a href="mailto:ayankumarh@gmail.com">ayankumarh@gmail.com</a>> wrote:<br>
>> On Thu, Sep 11, 2014 at 12:55 AM, <<a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a>> wrote:<br>
>>> On Wed, 10 Sep 2014 21:58:48 +0300, Ran Shalit said:<br>
>>><br>
>>>> 1. How can I make a process to notice this inactivity ? Do you think<br>
>>>> it can be implemented by some periodic process who check if there is<br>
>>>> activity ? It returns to the original question I raised, that I will<br>
>>>> use some periodic process who checks maybe cpu load or something like<br>
>>>> that. What do you think ?<br>
>>><br>
>>> That's going to depend on your system and what processes are running.<br>
>>><br>
>>> You may have an MP3 player going that doesn't take much CPU at all - but<br>
>>> shutting down because the user hasn't hit a button in 47 minutes will probably<br>
>>> irritate the user no end. Or there may be a screensaver running that takes<br>
>>> twice as much CPU as the MP3 player, but is totally OK on the system<br>
>>> suspending whenever the rest of the system wants it.<br>
>>><br>
>>> You're going to have to look at your system design, and decide for yourself<br>
>>> what the criteria are.<br>
>><br>
>> Please correct me if my understanding is wrong:-<br>
>><br>
>> I believe that autosuspend feature (for system suspend) is not present<br>
>> in kernel. I believe that there is no feature in kernel which checks<br>
>> for system ( cpu, devices) inactivity and suspends the entire system.<br>
>> System suspend is caused when :-<br>
>> 1. the user issues a command<br>
>> 2. The system receives some interrupt or event (lid closing event)<br>
>> 3. There is an external process which monitors system inactivity and<br>
>> suspends the system.<br>
>><br>
>> For runtime suspend of a device, I believe it is the driver who has<br>
>> the complete responsibility to decide when to suspend the device or<br>
>> resume it. The driver can take this decision on user intervention (eg<br>
>> when user writes to /sys/devices/<my-device>/power/* ) or when the<br>
>> driver has completed servicing an interrupt and feels it has nothing<br>
>> more to do, etc<br>
><br>
> Thanks Vlaid, Ayan,<br>
><br>
> I am a bit yet struggling for couple of days on this PM issue, and I<br>
> would appreciate your continous advise.<br>
> The system requirement I have is as following:<br>
> 1. make everything as automatic as possible , so that there won't be<br>
> any need to add any userspace application for the matter.<br>
> 2. wakeup from all relevant wakeup sources<br>
> 3. should not use sysfs (it should be disabled from kernel)<br>
> 4. platform is OMAP3530.<br></div></div></blockquote><div><br>a. look into /arch/arm/mach-omap2 of kernel source and grep for "sleep" and "wakeup" functionality: power management is just managing with the different frequencies of the the CPU. as far as I can tell, once sleep, only uart pin can be used for waking up....not sure.</div><div><br></div><div>b. read this:</div><div><br></div><div><a href="http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx">http://e2e.ti.com/support/dsp/omap_applications_processors/f/447/t/30005.aspx</a></div><div><br></div><div><a href="http://www.ti.com/lit/an/slva310b/slva310b.pdf">http://www.ti.com/lit/an/slva310b/slva310b.pdf</a> (read page 2, which describe the different powerup-sequence of the CPU, "Powering-Up Sequence". <br></div><div><br></div><div>c. the technology brand name for omap3530 is "DVFS"....search for this inside the arch/arm kernel source.....you can find lots of sample codes there.</div><div><br></div><div>(don't confuse with another omap CPU brand name "DeepSleep" but is PM for another type of omap cpu.)</div><div><br></div><div>d. <a href="http://www.ti.com/product/omap3530">http://www.ti.com/product/omap3530</a> --> on the right is a DVSDK + Android source code for 3530....grep the codes for the above keywords...<br></div><div><br></div><div>hopefully it helps?</div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">
><br>
> Now, As I understand thus far, I have the following options (<br>
> requirement 3 above I will ignore, don't know how to handle it yet,<br>
> and assume for meanwhile that I have sysfs) :<br>
> 1. use suspend scheme (no runtime PM)<br>
> 1.a. create some kernel thread who check cpu load and will decide<br>
> to disable system only if its below some minimum threshold (which<br>
> should indicate no activity)<br>
> 1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources<br>
> with this scheme only this thread is responsible for the suspend,<br>
> and there is no use of the runtime PM, right ?<br>
><br>
> 2. use runtime PM scheme :<br>
> With this scheme I don't understand how some device will wake the<br>
> system , or doesn't it need to ? If a driver wakes up maybe it need<br>
> to deliver some info to system ?<br>
><br>
> I think option 1 is also easier to support, what do you think about both ?<br>
><br>
> Thanks!!<br>
> Ran<br>
<br>
</div></div>Does Anyone have any suggestions and feedback on the above requirements ?<br>
<br>
Thank you,<br>
<div class=""><div class="h5">Ran<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards,<br>Peter Teoh
</div></div>