Skip to contentSkip to conversation

pm: Introduce __pm to mark power management code

PATCH In review Guenter Roeck 3 participants 7 messages May 9, 2013

lore
Share & tools
lore
#0 lore raw

cover pm: Introduce __pm to mark power management code

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.

#1 lore raw
Quoted 7 lines · 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.

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

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw
Quoted 7 lines · Alan Stern
Quoted 5 lines · 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.

Quoted 6 lines
Quoted 2 lines

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

#3 lore raw
Quoted 8 lines · Guenter Roeck
Quoted 7 lines · Alan Stern
Quoted 5 lines · 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.

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

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

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#4 lore raw
Quoted 16 lines · Alan Stern
Quoted 14 lines · Guenter Roeck
Quoted 13 lines · Alan Stern
Quoted 7 lines · 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.

What about code that depends on CONFIG_PM_RUNTIME? Or code that depends on CONFIG_PM_SLEEP but not on CONFIG_PM_RUNTIME?

Quoted 6 lines
Quoted 1 line

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

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#5 lore raw
In reply to Guenter Roeck
Quoted 5 lines · 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.

Quoted 8 lines

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

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#6 lore raw
Quoted 9 lines · Rafael J. Wysocki
Quoted 8 lines · 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.

Quoted 8 lines
Quoted 5 lines

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