public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Locke <matt@nomadgs.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@lists.osdl.org, "Scott E. Preece" <preece@motorola.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [linux-pm] [PATCH] PowerOP, PowerOP Core, 1/2
Date: Tue, 26 Sep 2006 14:45:56 -0700	[thread overview]
Message-ID: <d1d1aeaa8d132e6bf987956d9623ad88@nomadgs.com> (raw)
In-Reply-To: <20060922140937.GL3478@elf.ucw.cz>


On Sep 22, 2006, at 7:09 AM, Pavel Machek wrote:

> Hi!
>
>> | > >>+struct powerop_driver {
>> | > >>+	char *name;
>> | > >>+	void *(*create_point) (const char *pwr_params, va_list args);
>> | > >>+	int (*set_point) (void *md_opt);
>> | > >>+	int (*get_point) (void *md_opt, const char *pwr_params, 
>> va_list
>> | > >>args);
>> | > >>+};
>> | > >
>> | > >We can certainly get better interface than va_list, right?
>> | >
>> | > Please elaborate.
>> |
>> | va_list does not provide adequate type checking. I do not think it
>> | suitable in driver<->core interface.
>> ---
>>
>> Well, in this particular case the typing probably has to be weak, one
>> way or another. The meaning of the parameters is arguably opaque at
>
> Why not have struct powerop_parameters, defined in machine-specific
> header somewhere, but used everywhere?

We started out with a machine-specific header.  The general feedback on 
the linux-pm list was that a complete machine independent interface was 
preferred.  At first Eugeny and I were against that but the resulting 
interface is much more flexible.  Users of the PowerOP API do not have 
to include an asm/powerop.h to use it.  Instead you can get all the 
information you need from the interface.  Also, using the current 
implementation you can get/set any arbitrary number and order of the 
power parameters.  For example, a platform has parameters p0-p5.  An 
operating point could be registered with values for p0,p1 and another 
with p0,p1,p2,p3,p4 and p5.  The code that registers operating points 
and accesses existing operating points don't have to know the correct 
order of  parameters, provide values for the entire parameter list or 
have a machine specific header.  In addition to being machine 
independent, the current implementation seems to  works nicely for 
integrating with cpufreq.

We are not completely satisfied with the string parsing that results 
from the current interface but we can improve it over time.


>
>> the interface - the attributes may be meaningful to specific 
>> components
>> of the system, but are not defined in the standardized interface 
>> (which
>> would otherwise have to know about all possible kinds of power
>> attributes and be changed every time a new one is added).
>>
>> So, if you'd rather have an array of char* or void* values, that would
>> probably also meet the need, but my guess is that the typing is
>> intentionally opaque.
>
> Actually array of integers would be better than this.
>
>> | > >How is it going to work on 8cpu box? will
>> | > >you have states like cpu1_800MHz_cpu2_1600MHz_cpu3_800MHz_... ?
>> | >
>> | > i do not operate with term 'state' so I don't understand what it 
>> means here.
>> |
>> | Okay, state here means "operating point". How will operating points
>> | look on 8cpu box? That's 256 states if cpus only support "low" and
>> | "high". How do you name them?
>>
>> I don't think you would name the compounded states. Each CPU would 
>> need
>> to have its own defined set of operating points (since the 
>> capabilities
>> of the CPUs can reasonably be different).
>
> Well, having few "powerop domains" per system would likely solve that
> problem... and problem of 20 devices on my PC. Can we get that?
>
> 								Pavel
> -- 
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) 
> http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.osdl.org
> https://lists.osdl.org/mailman/listinfo/linux-pm
>

  reply	other threads:[~2006-09-26 21:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-19 19:46 [linux-pm] [PATCH] PowerOP, PowerOP Core, 1/2 Scott E. Preece
2006-09-19 20:06 ` Eugeny S. Mints
2006-09-22 14:09 ` Pavel Machek
2006-09-26 21:45   ` Matthew Locke [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-22 21:10 Woodruff, Richard
2006-09-22 20:34 Scott E. Preece
2006-09-23 11:18 ` [linux-pm] " Pavel Machek
2006-09-24 21:33   ` Matthew Locke
2006-09-22 20:28 Scott E. Preece
2006-09-22 21:18 ` Vitaly Wool
2006-09-19 21:37 Scott E. Preece
2006-09-22 14:11 ` [linux-pm] " Pavel Machek
2006-09-22 14:48   ` Igor Stoppa
2006-09-14 14:37 Eugeny S. Mints
2006-09-18 10:44 ` [linux-pm] " Pavel Machek
2006-09-18 11:32   ` Eugeny S. Mints
2006-09-18 19:58     ` Eugeny S. Mints
2006-09-19 18:22     ` Pavel Machek

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=d1d1aeaa8d132e6bf987956d9623ad88@nomadgs.com \
    --to=matt@nomadgs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.osdl.org \
    --cc=pavel@ucw.cz \
    --cc=preece@motorola.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