public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* In Embedded system the dev_pm_info.power_state is useful
@ 2008-05-23  5:56 Francesco VIRLINZI
  2008-05-23  6:17 ` Francesco VIRLINZI
  2008-05-23 14:07 ` Alan Stern
  0 siblings, 2 replies; 5+ messages in thread
From: Francesco VIRLINZI @ 2008-05-23  5:56 UTC (permalink / raw)
  To: linux-pm

Hi all
I'm Francesco Virlinzi and I work in STMicroelectronics, I'm a 
developers of STLinux (www.stlinux.com) an
  embedded Linux distribution for ST Set Top Box.

I read in the pm mail list that you are going to remove in the kernel the
 dev_pm_info.power_state field in the dev_pm_info struct replaced by 
bus-specific field.

My request is: don't do that.
In embedded system it' s really useful because there are a lot of 
generic IP on a single bus (the pltaform bus)
  and the only way to check the power state of each IP is based on  
'dev_pm_info.power_state'
  without this filed we will have our IP (platform_device) with no power 
state concept...

At least we could put it under CONFIG_EMBEDDED.

What do you know?
Regards
 Francesco

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

* Re: In Embedded system the dev_pm_info.power_state is useful
  2008-05-23  5:56 In Embedded system the dev_pm_info.power_state is useful Francesco VIRLINZI
@ 2008-05-23  6:17 ` Francesco VIRLINZI
  2008-05-23 14:07 ` Alan Stern
  1 sibling, 0 replies; 5+ messages in thread
From: Francesco VIRLINZI @ 2008-05-23  6:17 UTC (permalink / raw)
  To: linux-pm

Hi all
> I'm Francesco Virlinzi and I work in STMicroelectronics, I'm a 
> developers of STLinux (www.stlinux.com) an
>   embedded Linux distribution for ST Set Top Box.
>
> I read in the pm mail list that you are going to remove in the kernel the
>  dev_pm_info.power_state field in the dev_pm_info struct replaced by 
> bus-specific field.
>
> My request is: don't do that.
> In embedded system it' s really useful because there are a lot of 
> generic IP on a single bus (the pltaform bus)
>   and the only way to check the power state of each IP is based on  
> 'dev_pm_info.power_state'
>   without this filed we will have our IP (platform_device) with no power 
> state concept...
>
> At least we could put it under CONFIG_EMBEDDED.
>
> >>What do you THINK ? 
>   

> Regards
>  Francesco
>   

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

* Re: In Embedded system the dev_pm_info.power_state is useful
  2008-05-23  5:56 In Embedded system the dev_pm_info.power_state is useful Francesco VIRLINZI
  2008-05-23  6:17 ` Francesco VIRLINZI
@ 2008-05-23 14:07 ` Alan Stern
  2008-05-23 14:32   ` Francesco VIRLINZI
  1 sibling, 1 reply; 5+ messages in thread
From: Alan Stern @ 2008-05-23 14:07 UTC (permalink / raw)
  To: Francesco VIRLINZI; +Cc: linux-pm

On Fri, 23 May 2008, Francesco VIRLINZI wrote:

> Hi all
> I'm Francesco Virlinzi and I work in STMicroelectronics, I'm a 
> developers of STLinux (www.stlinux.com) an
>   embedded Linux distribution for ST Set Top Box.
> 
> I read in the pm mail list that you are going to remove in the kernel the
>  dev_pm_info.power_state field in the dev_pm_info struct replaced by 
> bus-specific field.
> 
> My request is: don't do that.
> In embedded system it' s really useful because there are a lot of 
> generic IP on a single bus (the pltaform bus)
>   and the only way to check the power state of each IP is based on  
> 'dev_pm_info.power_state'
>   without this filed we will have our IP (platform_device) with no power 
> state concept...

That isn't the only way to check the power state.  You should have a 
private data structure associated with each of the devices you care 
about.  The address of the private data structure is what you store in 
platform_set_drvdata().  In the private data structure you can have a 
field to indicate the device's power state.

If the platform-bus IP really is generic then you can't possibly know
what its dev_pm_info.power_state value means, anyway.

Alan Stern

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

* Re: In Embedded system the dev_pm_info.power_state is useful
  2008-05-23 14:07 ` Alan Stern
@ 2008-05-23 14:32   ` Francesco VIRLINZI
  2008-05-23 18:19     ` Alan Stern
  0 siblings, 1 reply; 5+ messages in thread
From: Francesco VIRLINZI @ 2008-05-23 14:32 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-pm

Hi Alan
Thank for your reply.
> That isn't the only way to check the power state.  You should have a 
> private data structure associated with each of the devices you care 
> about.  The address of the private data structure is what you store in 
> platform_set_drvdata().  In the private data structure you can have a 
> field to indicate the device's power state.
>   
Yes you are right.
The problem is that each driver can use the private_data as it wants, 
while I need a generic
 API to understand the power state of device.
Your suggestion works fine if (internally) we assume an agreement
 (i.e.: the first word in the private data is the power state) and in 
this manner
 I can analyse several IP with a single API.
But to do that (at the moment) I just do
    (dev->power.power_state.event == xx)

and PM_EVENT_ON/PM_EVENT_SUSPEND are good enough.

Why did you decide to remove it?

Regards
 Francesco


> If the platform-bus IP really is generic then you can't possibly know
> what its dev_pm_info.power_state value means, anyway.
>
> Alan Stern
>
>   

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

* Re: In Embedded system the dev_pm_info.power_state is useful
  2008-05-23 14:32   ` Francesco VIRLINZI
@ 2008-05-23 18:19     ` Alan Stern
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Stern @ 2008-05-23 18:19 UTC (permalink / raw)
  To: Francesco VIRLINZI; +Cc: linux-pm

On Fri, 23 May 2008, Francesco VIRLINZI wrote:

> Hi Alan
> Thank for your reply.
> > That isn't the only way to check the power state.  You should have a 
> > private data structure associated with each of the devices you care 
> > about.  The address of the private data structure is what you store in 
> > platform_set_drvdata().  In the private data structure you can have a 
> > field to indicate the device's power state.
> >   
> Yes you are right.
> The problem is that each driver can use the private_data as it wants, 
> while I need a generic
>  API to understand the power state of device.

That's not the only problem.  Each driver can also use 
dev->power.power_state.event the way it wants.  So looking at that 
field won't tell you anything.

> Your suggestion works fine if (internally) we assume an agreement
>  (i.e.: the first word in the private data is the power state) and in 
> this manner
>  I can analyse several IP with a single API.
> But to do that (at the moment) I just do
>     (dev->power.power_state.event == xx)
> 
> and PM_EVENT_ON/PM_EVENT_SUSPEND are good enough.
> 
> Why did you decide to remove it?

Because it is almost meaningless.  For example, suppose a particular
platform device has 3 power states: On with high performance, on with
low performance, and off.  Then how can you tell which state it is in
by looking at dev->power.power_state.event?

I suspect that you are trying to solve some problem in the wrong way.  
But without knowing what that problem is, I can't advise you on better
ways to solve it.

Alan Stern

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

end of thread, other threads:[~2008-05-23 18:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-23  5:56 In Embedded system the dev_pm_info.power_state is useful Francesco VIRLINZI
2008-05-23  6:17 ` Francesco VIRLINZI
2008-05-23 14:07 ` Alan Stern
2008-05-23 14:32   ` Francesco VIRLINZI
2008-05-23 18:19     ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox