* [PATCH 0/3] pm: Introduce __pm to mark power management code
@ 2013-05-09 17:09 Guenter Roeck
2013-05-09 17:38 ` Alan Stern
2013-05-09 19:15 ` Rafael J. Wysocki
0 siblings, 2 replies; 9+ messages in thread
From: Guenter Roeck @ 2013-05-09 17:09 UTC (permalink / raw)
To: linux-pm
Cc: linux-kernel, lm-sensors, Jean Delvare, Len Brown, Pavel Machek,
Jingoo Han, Guenter Roeck
The following patch series introduces a marker for power management functions
and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
can be removed from most of the code. This ensures that the conditional code
still compiles but is not included in the object file.
As a side effect, drivers declaring struct dev_pm_ops unconditionally
get a bit smaller if CONFIG_PM_SLEEP is not configured.
The first patch in the series introduces the marker, the following
two patches introduce the marker in two drivers to demonstrate its use.
The patch series depends on the "PM: Add pm_ops_ptr() macro" patch
submitted by Jingoo Han.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 17:09 [PATCH 0/3] pm: Introduce __pm to mark power management code Guenter Roeck
@ 2013-05-09 17:38 ` Alan Stern
2013-05-09 17:48 ` Guenter Roeck
2013-05-09 19:15 ` Rafael J. Wysocki
1 sibling, 1 reply; 9+ messages in thread
From: Alan Stern @ 2013-05-09 17:38 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-pm, linux-kernel, lm-sensors, Jean Delvare, Len Brown,
Pavel Machek, Jingoo Han
On Thu, 9 May 2013, Guenter Roeck wrote:
> The following patch series introduces a marker for power management functions
> and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> can be removed from most of the code. This ensures that the conditional code
> still compiles but is not included in the object file.
>
> As a side effect, drivers declaring struct dev_pm_ops unconditionally
> get a bit smaller if CONFIG_PM_SLEEP is not configured.
What about code that depends on CONFIG_PM_RUNTIME? Or code that
depends on CONFIG_PM_SLEEP but not on CONFIG_PM_RUNTIME?
Alan Stern
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 17:38 ` Alan Stern
@ 2013-05-09 17:48 ` Guenter Roeck
2013-05-09 18:31 ` Alan Stern
0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2013-05-09 17:48 UTC (permalink / raw)
To: Alan Stern
Cc: linux-pm, linux-kernel, lm-sensors, Jean Delvare, Len Brown,
Pavel Machek, Jingoo Han
On Thu, May 09, 2013 at 01:38:36PM -0400, Alan Stern wrote:
> On Thu, 9 May 2013, Guenter Roeck wrote:
>
> > The following patch series introduces a marker for power management functions
> > and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> > can be removed from most of the code. This ensures that the conditional code
> > still compiles but is not included in the object file.
> >
> > As a side effect, drivers declaring struct dev_pm_ops unconditionally
> > get a bit smaller if CONFIG_PM_SLEEP is not configured.
>
> What about code that depends on CONFIG_PM_RUNTIME? Or code that
> depends on CONFIG_PM_SLEEP but not on CONFIG_PM_RUNTIME?
>
Should we also introduce __pm_sleep and __pm_runtime ?
Thanks,
Guenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 17:48 ` Guenter Roeck
@ 2013-05-09 18:31 ` Alan Stern
2013-05-09 19:12 ` Rafael J. Wysocki
0 siblings, 1 reply; 9+ messages in thread
From: Alan Stern @ 2013-05-09 18:31 UTC (permalink / raw)
To: Guenter Roeck, Rafael J. Wysocki
Cc: Linux-pm mailing list, Kernel development list, lm-sensors,
Jean Delvare, Len Brown, Pavel Machek, Jingoo Han
On Thu, 9 May 2013, Guenter Roeck wrote:
> On Thu, May 09, 2013 at 01:38:36PM -0400, Alan Stern wrote:
> > On Thu, 9 May 2013, Guenter Roeck wrote:
> >
> > > The following patch series introduces a marker for power management functions
> > > and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> > > can be removed from most of the code. This ensures that the conditional code
> > > still compiles but is not included in the object file.
> > >
> > > As a side effect, drivers declaring struct dev_pm_ops unconditionally
> > > get a bit smaller if CONFIG_PM_SLEEP is not configured.
> >
> > What about code that depends on CONFIG_PM_RUNTIME? Or code that
> > depends on CONFIG_PM_SLEEP but not on CONFIG_PM_RUNTIME?
> >
> Should we also introduce __pm_sleep and __pm_runtime ?
If you want to implement this correctly, I think you have to.
As for whether the additional complication is desirable ... I'll leave
that up to Rafael to decide.
Alan Stern
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 18:31 ` Alan Stern
@ 2013-05-09 19:12 ` Rafael J. Wysocki
0 siblings, 0 replies; 9+ messages in thread
From: Rafael J. Wysocki @ 2013-05-09 19:12 UTC (permalink / raw)
To: Alan Stern, Guenter Roeck
Cc: Linux-pm mailing list, Kernel development list, lm-sensors,
Jean Delvare, Len Brown, Pavel Machek, Jingoo Han
On Thursday, May 09, 2013 02:31:46 PM Alan Stern wrote:
> On Thu, 9 May 2013, Guenter Roeck wrote:
>
> > On Thu, May 09, 2013 at 01:38:36PM -0400, Alan Stern wrote:
> > > On Thu, 9 May 2013, Guenter Roeck wrote:
> > >
> > > > The following patch series introduces a marker for power management functions
> > > > and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> > > > can be removed from most of the code. This ensures that the conditional code
> > > > still compiles but is not included in the object file.
> > > >
> > > > As a side effect, drivers declaring struct dev_pm_ops unconditionally
> > > > get a bit smaller if CONFIG_PM_SLEEP is not configured.
> > >
> > > What about code that depends on CONFIG_PM_RUNTIME? Or code that
> > > depends on CONFIG_PM_SLEEP but not on CONFIG_PM_RUNTIME?
> > >
> > Should we also introduce __pm_sleep and __pm_runtime ?
>
> If you want to implement this correctly, I think you have to.
>
> As for whether the additional complication is desirable ... I'll leave
> that up to Rafael to decide.
Well, if that had been so easy to do, we would have done it already before.
I think that we first should try to combine PM_SLEEP with PM_RUNTIME (plus
some other power management options related to CPU PM) and then introduce
something like __pm. Otherwise, it's going to be a mess.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 17:09 [PATCH 0/3] pm: Introduce __pm to mark power management code Guenter Roeck
2013-05-09 17:38 ` Alan Stern
@ 2013-05-09 19:15 ` Rafael J. Wysocki
2013-05-09 20:30 ` Guenter Roeck
1 sibling, 1 reply; 9+ messages in thread
From: Rafael J. Wysocki @ 2013-05-09 19:15 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-pm, linux-kernel, lm-sensors, Jean Delvare, Len Brown,
Pavel Machek, Jingoo Han
On Thursday, May 09, 2013 10:09:23 AM Guenter Roeck wrote:
> The following patch series introduces a marker for power management functions
> and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> can be removed from most of the code. This ensures that the conditional code
> still compiles but is not included in the object file.
>
> As a side effect, drivers declaring struct dev_pm_ops unconditionally
> get a bit smaller if CONFIG_PM_SLEEP is not configured.
>
> The first patch in the series introduces the marker, the following
> two patches introduce the marker in two drivers to demonstrate its use.
>
> The patch series depends on the "PM: Add pm_ops_ptr() macro" patch
> submitted by Jingoo Han.
What about CCing a PM core maintainer?
Please see my reply to Alan Stern for my opinion.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 19:15 ` Rafael J. Wysocki
@ 2013-05-09 20:30 ` Guenter Roeck
0 siblings, 0 replies; 9+ messages in thread
From: Guenter Roeck @ 2013-05-09 20:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-pm, linux-kernel, lm-sensors, Jean Delvare, Len Brown,
Pavel Machek, Jingoo Han
On Thu, May 09, 2013 at 09:15:00PM +0200, Rafael J. Wysocki wrote:
> On Thursday, May 09, 2013 10:09:23 AM Guenter Roeck wrote:
> > The following patch series introduces a marker for power management functions
> > and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> > can be removed from most of the code. This ensures that the conditional code
> > still compiles but is not included in the object file.
> >
> > As a side effect, drivers declaring struct dev_pm_ops unconditionally
> > get a bit smaller if CONFIG_PM_SLEEP is not configured.
> >
> > The first patch in the series introduces the marker, the following
> > two patches introduce the marker in two drivers to demonstrate its use.
> >
> > The patch series depends on the "PM: Add pm_ops_ptr() macro" patch
> > submitted by Jingoo Han.
>
> What about CCing a PM core maintainer?
>
Actually, that was the idea. Somehow my send script got screwed up.
No idea what happened. Sorry for that.
Guenter
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 0/3] pm: Introduce __pm to mark power management code
@ 2013-05-09 17:09 Guenter Roeck
2013-05-10 10:54 ` Pavel Machek
0 siblings, 1 reply; 9+ messages in thread
From: Guenter Roeck @ 2013-05-09 17:09 UTC (permalink / raw)
To: linux-pm
Cc: linux-kernel, lm-sensors, Jean Delvare, Len Brown, Pavel Machek,
Jingoo Han, Guenter Roeck
The following patch series introduces a marker for power management functions
and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
can be removed from most of the code. This ensures that the conditional code
still compiles but is not included in the object file.
As a side effect, drivers declaring struct dev_pm_ops unconditionally
get a bit smaller if CONFIG_PM_SLEEP is not configured.
The first patch in the series introduces the marker, the following
two patches introduce the marker in two drivers to demonstrate its use.
The patch series depends on the "PM: Add pm_ops_ptr() macro" patch
submitted by Jingoo Han.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/3] pm: Introduce __pm to mark power management code
2013-05-09 17:09 Guenter Roeck
@ 2013-05-10 10:54 ` Pavel Machek
0 siblings, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2013-05-10 10:54 UTC (permalink / raw)
To: Guenter Roeck
Cc: linux-pm, linux-kernel, lm-sensors, Jean Delvare, Len Brown,
Jingoo Han
On Thu 2013-05-09 10:09:48, Guenter Roeck wrote:
> The following patch series introduces a marker for power management functions
> and data. This this marker, #ifdef CONFIG_PM and #ifdef CONFIG_PM_SLEEP
> can be removed from most of the code. This ensures that the conditional code
> still compiles but is not included in the object file.
Was it compile-tested for both PM_SLEEP and !PM_SLEEP cases?
If driver wants to have pm-specific fields in its structures, this
will make it harder.
Ifdefs are ugly, and this has better compiler coverage in !PM_SLEEP
case. Good. OTOH most people are running with PM_SLEEP, so advantage
is not great...
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-05-10 10:54 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-09 17:09 [PATCH 0/3] pm: Introduce __pm to mark power management code Guenter Roeck
2013-05-09 17:38 ` Alan Stern
2013-05-09 17:48 ` Guenter Roeck
2013-05-09 18:31 ` Alan Stern
2013-05-09 19:12 ` Rafael J. Wysocki
2013-05-09 19:15 ` Rafael J. Wysocki
2013-05-09 20:30 ` Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2013-05-09 17:09 Guenter Roeck
2013-05-10 10:54 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox