Skip to contentSkip to conversation

spi: spi-pl022: Fixup use of runtime pm

PATCH New Ulf Hansson 5 participants 11 messages Oct 4, 2012 – Oct 7, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover spi: spi-pl022: Fixup use of runtime pm

From: Ulf Hansson <[email protected]>

Some old runtime pm patches got merged whiched messed up things. These are now reverted. Additionaly one patch do a simplification of the use of runtime pm functions.

V2:
Rebased patches and updated commit messages.

Ulf Hansson (3):
Revert "spi/pl022: fix spi-pl022 pm enable at probe" Revert "spi/pl022: enable runtime PM"
spi: spi-pl022: Minor simplification for runtime pm

 drivers/spi/spi-pl022.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.10
#1 lore raw

PATCH v2 1/3 Revert "spi/pl022: fix spi-pl022 pm enable at probe"

From: Ulf Hansson <[email protected]>

This reverts commit 6887237cd7da904184dab2750504040c68f3a080.

This reverts is done due to earlier wrong commit, which is also reverted. "Revert "spi/pl022: enable runtime PM""

---
 drivers/spi/spi-pl022.c |    1 +
 1 file changed, 1 insertion(+)
drivers/spi/spi-pl022.c +1 -0
index 9194641..5cf0643 100644
@@ -2186,6 +2186,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
 	       adev->res.start, pl022->virtbase);
 
+	pm_runtime_enable(dev);
 	pm_runtime_resume(dev);
 
 	pl022->clk = devm_clk_get(&adev->dev, NULL);
Signature · 1 line
1.7.10
#2 lore raw

PATCH v2 1/3 Revert "spi/pl022: fix spi-pl022 pm enable at probe"

Quoted 6 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

This reverts commit 6887237cd7da904184dab2750504040c68f3a080.

This reverts is done due to earlier wrong commit, which is also reverted. "Revert "spi/pl022: enable runtime PM""

Why? "Wrong" isn't terribly detailed...

#3 lore raw

PATCH v2 2/3 Revert "spi/pl022: enable runtime PM"

In reply to Ulf Hansson

From: Ulf Hansson <[email protected]>

This reverts commit 2fb30d1147c599f5657e8c62c862f9a0f58d9d99.

This patch is reverted due to wrong runtime PM code.

Conflicts:

	drivers/spi/spi-pl022.c
---
 drivers/spi/spi-pl022.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/spi/spi-pl022.c +0 -4
index 5cf0643..a1db91a 100644
@@ -2186,9 +2186,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
 	       adev->res.start, pl022->virtbase);
 
-	pm_runtime_enable(dev);
-	pm_runtime_resume(dev);
-
 	pl022->clk = devm_clk_get(&adev->dev, NULL);
 	if (IS_ERR(pl022->clk)) {
 		status = PTR_ERR(pl022->clk);
@@ -2293,7 +2290,6 @@ pl022_remove(struct amba_device *adev)
 
 	clk_disable(pl022->clk);
 	clk_unprepare(pl022->clk);
-	pm_runtime_disable(&adev->dev);
 	amba_release_regions(adev);
 	tasklet_disable(&pl022->pump_transfers);
 	spi_unregister_master(pl022->master);
Signature · 1 line
1.7.10
#4 lore raw

PATCH v2 3/3 spi: spi-pl022: Minor simplification for runtime pm

In reply to Ulf Hansson

From: Ulf Hansson <[email protected]>

In probe pm_runtime_put_autosuspend has the same effect as doing pm_runtime_put. This due to upper layer in driver core is preventing the device from being runtime suspended by a pm_runtime_get*.

---
 drivers/spi/spi-pl022.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/spi/spi-pl022.c +2 -3
index a1db91a..51b7a95 100644
@@ -2246,10 +2246,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 		pm_runtime_set_autosuspend_delay(dev,
 			platform_info->autosuspend_delay);
 		pm_runtime_use_autosuspend(dev);
-		pm_runtime_put_autosuspend(dev);
-	} else {
-		pm_runtime_put(dev);
 	}
+	pm_runtime_put(dev);
+
 	return 0;
 
  err_spi_register:
Signature · 1 line
1.7.10
#5 lore raw

PATCH v2 3/3 spi: spi-pl022: Minor simplification for runtime pm

Hi,

Mark, I am not sure this particular patch is actually wanted. Realized that when reading up on the driver/base/* patches for PM changes this summer. Especially how device probe/suspend/shutdown etc. has been changed for runtime PM point of view.

Maybe you can comment?

Kind regards
Ulf Hansson

Quoted 32 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

In probe pm_runtime_put_autosuspend has the same effect as doing pm_runtime_put. This due to upper layer in driver core is preventing the device from being runtime suspended by a pm_runtime_get*.

---
 drivers/spi/spi-pl022.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/spi/spi-pl022.c +2 -4
index a1db91a..51b7a95 100644
@@ -2246,10 +2246,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
                pm_runtime_set_autosuspend_delay(dev,
                        platform_info->autosuspend_delay);
                pm_runtime_use_autosuspend(dev);
-               pm_runtime_put_autosuspend(dev);
-       } else {
-               pm_runtime_put(dev);
        }
+       pm_runtime_put(dev);
+
        return 0;
 
  err_spi_register:
--

1.7.10

#6 lore raw

PATCH v2 3/3 spi: spi-pl022: Minor simplification for runtime pm

Quoted 4 lines · Ulf Hansson

Mark, I am not sure this particular patch is actually wanted. Realized that when reading up on the driver/base/* patches for PM changes this summer. Especially how device probe/suspend/shutdown etc. has been changed for runtime PM point of view.

Mark will get you for top-posting ;-)

Quoted 12 lines
Quoted 12 lines

From: Ulf Hansson <[email protected]>

In probe pm_runtime_put_autosuspend has the same effect as doing pm_runtime_put. This due to upper layer in driver core is preventing the device from being runtime suspended by a pm_runtime_get*.

---
 drivers/spi/spi-pl022.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
Quoted 15 lines
Quoted 5 lines
drivers/spi/spi-pl022.c +0 -0
index a1db91a..51b7a95 100644

drivers/spi/spi-pl022.c pl022_probe(struct amba_device *adev, const struct amba_id *id) · line 2252

Quoted 10 lines
drivers/spi/spi-pl022.c +2 -3
@@ -2246,10 +2246,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
                pm_runtime_set_autosuspend_delay(dev,
                        platform_info->autosuspend_delay);
                pm_runtime_use_autosuspend(dev);
-               pm_runtime_put_autosuspend(dev);
-       } else {
-               pm_runtime_put(dev);
        }
+       pm_runtime_put(dev);
+
        return 0;

I'm paging Rafael and Magnus for their comments so we don't overload Mark with runtime PM semantics...

Yours,
Linus Walleij

#7 lore raw

PATCH v2 3/3 spi: spi-pl022: Minor simplification for runtime pm

Quoted 31 lines · On Friday 05 of October 2012 14:19:57 Linus Walleij wrote:
Quoted 4 lines · Ulf Hansson

Mark, I am not sure this particular patch is actually wanted. Realized that when reading up on the driver/base/* patches for PM changes this summer. Especially how device probe/suspend/shutdown etc. has been changed for runtime PM point of view.

Mark will get you for top-posting ;-)

Quoted 22 lines
Quoted 22 lines

From: Ulf Hansson <[email protected]>

In probe pm_runtime_put_autosuspend has the same effect as doing pm_runtime_put. This due to upper layer in driver core is preventing the device from being runtime suspended by a pm_runtime_get*.

---
 drivers/spi/spi-pl022.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/spi/spi-pl022.c +0 -2
index a1db91a..51b7a95 100644
@@ -2246,10 +2246,9 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
                pm_runtime_set_autosuspend_delay(dev,
                        platform_info->autosuspend_delay);
                pm_runtime_use_autosuspend(dev);
-               pm_runtime_put_autosuspend(dev);
-       } else {
Quoted 8 lines
Quoted 5 lines

drivers/spi/spi-pl022.c pl022_probe(struct amba_device *adev, const struct amba_id *id) · line 2252

Quoted 5 lines
drivers/spi/spi-pl022.c +2 -1
-               pm_runtime_put(dev);
        }
+       pm_runtime_put(dev);
+
        return 0;

I'm paging Rafael and Magnus for their comments so we don't overload Mark with runtime PM semantics...

The change looks OK. The functional difference is that the .idle() callback will be run earlier in the "use autosuspend" case, but that shouldn't be a big deal.

Thanks,
Rafael

Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
#8 lore raw

v2 cover spi: spi-pl022: Fixup use of runtime pm

In reply to Ulf Hansson
Quoted 6 lines · Ulf Hansson

From: Ulf Hansson <[email protected]>

Some old runtime pm patches got merged whiched messed up things. These are now reverted. Additionaly one patch do a simplification of the use of runtime pm functions.

Quoted 7 lines

V2:
Rebased patches and updated commit messages.

Ulf Hansson (3):
Revert "spi/pl022: fix spi-pl022 pm enable at probe" Revert "spi/pl022: enable runtime PM"
spi: spi-pl022: Minor simplification for runtime pm

I think patch 1/3 and 2/3 needs to go into the -rc fixes.

Who's funneling this now? Grant or Mark?

Yours,
Linus Walleij

#9 lore raw

v2 cover spi: spi-pl022: Fixup use of runtime pm

Quoted 3 lines · Linus Walleij

I think patch 1/3 and 2/3 needs to go into the -rc fixes.

Who's funneling this now? Grant or Mark?

Me still for the moment.

#10 lore raw

v2 cover spi: spi-pl022: Fixup use of runtime pm

Quoted 7 lines · Mark Brown
Quoted 3 lines · Linus Walleij

I think patch 1/3 and 2/3 needs to go into the -rc fixes.

Who's funneling this now? Grant or Mark?

Me still for the moment.

I will post a new series, removing the 3/3 patch and updating the commitmsg accordingly.

Kind regards
Ulf Hansson