All of lore.kernel.org
 help / color / mirror / Atom feed
* Any char device example for runtime PM ?
@ 2014-09-08  5:22 ` Ran Shalit
  0 siblings, 0 replies; 5+ messages in thread
From: Ran Shalit @ 2014-09-08  5:22 UTC (permalink / raw)
  To: linux-pm, kernelnewbies

Hello,

Is there any character device example using runtime PM available ?
It is most helpful,

Thanks,
Ran

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

* Any char device example for runtime PM ?
@ 2014-09-08  5:22 ` Ran Shalit
  0 siblings, 0 replies; 5+ messages in thread
From: Ran Shalit @ 2014-09-08  5:22 UTC (permalink / raw)
  To: kernelnewbies

Hello,

Is there any character device example using runtime PM available ?
It is most helpful,

Thanks,
Ran

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

* Any char device example for runtime PM ?
  2014-09-14 16:45 ` Peter Teoh
@ 2014-09-14 19:21   ` Ran Shalit
  0 siblings, 0 replies; 5+ messages in thread
From: Ran Shalit @ 2014-09-14 19:21 UTC (permalink / raw)
  To: kernelnewbies

On Sun, Sep 14, 2014 at 7:45 PM, Peter Teoh <htmldeveloper@gmail.com> wrote:
>
>
> On Sat, Sep 13, 2014 at 3:50 PM, Ran Shalit <ranshalit@gmail.com> wrote:
>>
>> On Sat, Sep 13, 2014 at 4:14 AM, Peter Teoh <htmldeveloper@gmail.com>
>> wrote:
>> > please elaborate your requirements.   char dev is for I/O to hardware.
>> > but
>> > runtime PM is for hibernating machine.   what is the connection u trying
>> > to
>> > achieve?
>> >
>> > On Mon, Sep 8, 2014 at 1:22 PM, Ran Shalit <ranshalit@gmail.com> wrote:
>> >>
>> >> Hello,
>> >>
>> >> Is there any character device example using runtime PM available ?
>> >> It is most helpful,
>> >>
>> Hi,
>>
>> Some of the drivers I'm using are char devices, while I only saw
>> platform device registration for runtime PM, so my question stem from
>> this.
>>
>> As to the system requirement I have, it is as following:
>> 1. make everything as automatic as possible , so that there won't be
>> any need to add any userspace application for the matter.
>> 2. wakeup from all relevant wakeup sources
>> 3. should not use sysfs (it should be disabled from kernel)
>> 4. platform is OMAP3530.
>>
>> Now, As I understand this far, I have the following options (
>> requirement 3 above I will ignore, don't know how to handle it yet,
>> and assume for meanwhile that I have sysfs) :
>> 1. use suspend scheme (no runtime PM)
>>     1.a. create some kernel periodic thread who check cpu load and will
>> decide
>> to disable system only if its below some minimum threshold (which
>> should indicate no activity)
>>     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
>>     with this scheme only this thread is responsible for the suspend,
>> and there is no use of the runtime PM, right ?
>>
>> 2. use runtime PM scheme :
>>     With this scheme I don't understand how some device will wake the
>> system , or doesn't it need to  ? If a driver wakes up maybe it need
>> to deliver some info to system    ?
>>
>
> as a general comment, your requirement for PM sounds weird.
>
> a.   normally, the linux kernel has its own PM protocol....and it governs
> which devices to saves states, and restore it later.....there is a hierarchy
> of calls to be made.   and it is a complex daisy chain from devices to
> higher logical level.   but yours never seem to mention or plan to integrate
> to this infrastructure?
>
> b.   hardware PM (sorry, i am a software guy...may be wrong) for
> microcontroller/CPU normally means different states resulting in different
> external PINs being disable, and for the least powered state only one or two
> pins are available to wake up the CP/microcontroller.   but when u mentioned
> so many pins are potential wake up source......then it is not powered down
> at all.
>
> i am being vague and brief, not to waste time, as this is a big topic,
> sorry.
>
>
>
> --
> Regards,
> Peter Teoh

 Hi Peter,

Thanks very much for the time,
Your answer makes a lot of sense actually.
I gave you the requirement I got AS-IS, and some of the difficulties I
have, partly stem from the things you meantion in your answer. After
this delving and research into this hugh issue of PM, I will
defenitely return with feedback about these requirements.

I would like to use your knowledge if I may. Is it possible to use
scheme b only, i.e. configure it all in low level (HW registers) and
not to use any linux mechanism ?

Thanks,
Ran

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

* Any char device example for runtime PM ?
  2014-09-13  7:50 Ran Shalit
@ 2014-09-14 16:45 ` Peter Teoh
  2014-09-14 19:21   ` Ran Shalit
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Teoh @ 2014-09-14 16:45 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Sep 13, 2014 at 3:50 PM, Ran Shalit <ranshalit@gmail.com> wrote:

> On Sat, Sep 13, 2014 at 4:14 AM, Peter Teoh <htmldeveloper@gmail.com>
> wrote:
> > please elaborate your requirements.   char dev is for I/O to hardware.
>  but
> > runtime PM is for hibernating machine.   what is the connection u trying
> to
> > achieve?
> >
> > On Mon, Sep 8, 2014 at 1:22 PM, Ran Shalit <ranshalit@gmail.com> wrote:
> >>
> >> Hello,
> >>
> >> Is there any character device example using runtime PM available ?
> >> It is most helpful,
> >>
> Hi,
>
> Some of the drivers I'm using are char devices, while I only saw
> platform device registration for runtime PM, so my question stem from
> this.
>
> As to the system requirement I have, it is as following:
> 1. make everything as automatic as possible , so that there won't be
> any need to add any userspace application for the matter.
> 2. wakeup from all relevant wakeup sources
> 3. should not use sysfs (it should be disabled from kernel)
> 4. platform is OMAP3530.
>
> Now, As I understand this far, I have the following options (
> requirement 3 above I will ignore, don't know how to handle it yet,
> and assume for meanwhile that I have sysfs) :
> 1. use suspend scheme (no runtime PM)
>     1.a. create some kernel periodic thread who check cpu load and will
> decide
> to disable system only if its below some minimum threshold (which
> should indicate no activity)
>     1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
>     with this scheme only this thread is responsible for the suspend,
> and there is no use of the runtime PM, right ?
>
> 2. use runtime PM scheme :
>     With this scheme I don't understand how some device will wake the
> system , or doesn't it need to  ? If a driver wakes up maybe it need
> to deliver some info to system    ?
>
>
as a general comment, your requirement for PM sounds weird.

a.   normally, the linux kernel has its own PM protocol....and it governs
which devices to saves states, and restore it later.....there is a
hierarchy of calls to be made.   and it is a complex daisy chain from
devices to higher logical level.   but yours never seem to mention or plan
to integrate to this infrastructure?

b.   hardware PM (sorry, i am a software guy...may be wrong) for
microcontroller/CPU normally means different states resulting in different
external PINs being disable, and for the least powered state only one or
two pins are available to wake up the CP/microcontroller.   but when u
mentioned so many pins are potential wake up source......then it is not
powered down at all.

i am being vague and brief, not to waste time, as this is a big topic,
sorry.



-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140915/94bce826/attachment.html 

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

* Any char device example for runtime PM ?
@ 2014-09-13  7:50 Ran Shalit
  2014-09-14 16:45 ` Peter Teoh
  0 siblings, 1 reply; 5+ messages in thread
From: Ran Shalit @ 2014-09-13  7:50 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Sep 13, 2014 at 4:14 AM, Peter Teoh <htmldeveloper@gmail.com> wrote:
> please elaborate your requirements.   char dev is for I/O to hardware.   but
> runtime PM is for hibernating machine.   what is the connection u trying to
> achieve?
>
> On Mon, Sep 8, 2014 at 1:22 PM, Ran Shalit <ranshalit@gmail.com> wrote:
>>
>> Hello,
>>
>> Is there any character device example using runtime PM available ?
>> It is most helpful,
>>
Hi,

Some of the drivers I'm using are char devices, while I only saw
platform device registration for runtime PM, so my question stem from
this.

As to the system requirement I have, it is as following:
1. make everything as automatic as possible , so that there won't be
any need to add any userspace application for the matter.
2. wakeup from all relevant wakeup sources
3. should not use sysfs (it should be disabled from kernel)
4. platform is OMAP3530.

Now, As I understand this far, I have the following options (
requirement 3 above I will ignore, don't know how to handle it yet,
and assume for meanwhile that I have sysfs) :
1. use suspend scheme (no runtime PM)
    1.a. create some kernel periodic thread who check cpu load and will decide
to disable system only if its below some minimum threshold (which
should indicate no activity)
    1.b. initialize all HW interrupts (gpio, uart, etc) as wakeup sources
    with this scheme only this thread is responsible for the suspend,
and there is no use of the runtime PM, right ?

2. use runtime PM scheme :
    With this scheme I don't understand how some device will wake the
system , or doesn't it need to  ? If a driver wakes up maybe it need
to deliver some info to system    ?

Thanks for any ideas,
Ran

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

end of thread, other threads:[~2014-09-14 19:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08  5:22 Any char device example for runtime PM ? Ran Shalit
2014-09-08  5:22 ` Ran Shalit
2014-09-13  7:50 Ran Shalit
2014-09-14 16:45 ` Peter Teoh
2014-09-14 19:21   ` Ran Shalit

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.