Skip to contentSkip to conversation

hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM

PATCH In review Rafael J. Wysocki 3 participants 5 messages Dec 3, 2014 – Dec 4, 2014 HSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM

From: Rafael J. Wysocki <[email protected]>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM.

Do that for the omap_ssi driver.

---

Note: This depends on commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) which is only in linux-next at the moment (via the linux-pm tree).

Please let me know if it is OK to take this one into linux-pm.

---
 drivers/hsi/controllers/omap_ssi.c      |    2 +-
 drivers/hsi/controllers/omap_ssi_port.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/hsi/controllers/omap_ssi.c +1 -1
Index: linux-pm/drivers/hsi/controllers/omap_ssi.c
===================================================================
@@ -555,7 +555,7 @@ static int __exit ssi_remove(struct plat
 	return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 static int omap_ssi_runtime_suspend(struct device *dev)
 {
 	struct hsi_controller *ssi = dev_get_drvdata(dev);
drivers/hsi/controllers/omap_ssi_port.c +1 -1
Index: linux-pm/drivers/hsi/controllers/omap_ssi_port.c
===================================================================
@@ -1260,7 +1260,7 @@ static int __exit ssi_port_remove(struct
 	return 0;
 }
 
-#ifdef CONFIG_PM_RUNTIME
+#ifdef CONFIG_PM
 static int ssi_save_port_ctx(struct omap_ssi_port *omap_port)
 {
 	struct hsi_port *port = to_hsi_port(omap_port->dev);
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 9 lines · On Wednesday 03 December 2014 03:02:24 Rafael J. Wysocki wrote:

From: Rafael J. Wysocki <[email protected]>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM.

Do that for the omap_ssi driver.

Just for clarification: does that mean that PM, PM_RUNTIME, and PM_SLEEP are all synonyms now, or is there still some other combination that allows a subset to be set?

Before we do lots of s/CONFIG_PM_SLEEP/CONFIG_PM/ changes in lots of other drivers, it would be nice to come up with a new set of macros to replace all the SET_RUNTIME_PM_OPS/SIMPLE_DEV_PM_OPS/..._OPS with a version that avoided the #ifdefs altogether.

Arnd

#3 lore raw
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · On Wednesday 03 December 2014 03:02:24 Rafael J. Wysocki wrote:

From: Rafael J. Wysocki <[email protected]>

After commit b2b49ccbdd54 (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks depending on CONFIG_PM_RUNTIME may now be changed to depend on CONFIG_PM.

Quoted 6 lines
Quoted 2 lines

Do that for the omap_ssi driver.

Just for clarification: does that mean that PM, PM_RUNTIME, and PM_SLEEP are all synonyms now, or is there still some other combination that allows a subset to be set?

PM_RUNTIME is always set when PM is, but PM_SLEEP still may not be set then.

The plan is to drop PM_RUNTIME and use PM as a user-visible option instead of it (which can be selected automatically by PM_SLEEP too).

As stated here:
http://marc.info/?l=linux-kernel&m=141710589711818&w=4
http://marc.info/?l=linux-kernel&m=141712284917133&w=4

Quoted 4 lines

Before we do lots of s/CONFIG_PM_SLEEP/CONFIG_PM/ changes in lots of other drivers, it would be nice to come up with a new set of macros to replace all the SET_RUNTIME_PM_OPS/SIMPLE_DEV_PM_OPS/..._OPS with a version that avoided the #ifdefs altogether.

I don't think we can avoid all of the #ifdefs and the macros still work (except for one which is redundant, but I have a patch to clean that up).

Rafael

#4 lore raw
Quoted 9 lines · On Wednesday 03 December 2014 23:45:22 Rafael J. Wysocki wrote:

http://marc.info/?l=linux-kernel&m=141712284917133&w=4

Quoted 4 lines

Before we do lots of s/CONFIG_PM_SLEEP/CONFIG_PM/ changes in lots of other drivers, it would be nice to come up with a new set of macros to replace all the SET_RUNTIME_PM_OPS/SIMPLE_DEV_PM_OPS/..._OPS with a version that avoided the #ifdefs altogether.

I don't think we can avoid all of the #ifdefs and the macros still work (except for one which is redundant, but I have a patch to clean that up).

Right, while we can create a version that does not require the #ifdef, that would still mean we'd have to touch every file and replace SET_RUNTIME_PM_OPS with PM_SET_RUNTIME_OPS or something like that because the new macro would not work if the function is not defined.

Arnd