linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm
@ 2012-10-04  8:04 Ulf Hansson
  2012-10-04  8:04 ` [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe" Ulf Hansson
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ulf Hansson @ 2012-10-04  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ulf Hansson <ulf.hansson@linaro.org>

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(-)

-- 
1.7.10

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

* [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe"
  2012-10-04  8:04 [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm Ulf Hansson
@ 2012-10-04  8:04 ` Ulf Hansson
  2012-10-05 12:23   ` Mark Brown
  2012-10-04  8:04 ` [PATCH V2 2/3] Revert "spi/pl022: enable runtime PM" Ulf Hansson
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Ulf Hansson @ 2012-10-04  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ulf Hansson <ulf.hansson@linaro.org>

This reverts commit 6887237cd7da904184dab2750504040c68f3a080.

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

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/spi/spi-pl022.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 9194641..5cf0643 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -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);
-- 
1.7.10

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

* [PATCH V2 2/3] Revert "spi/pl022: enable runtime PM"
  2012-10-04  8:04 [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm Ulf Hansson
  2012-10-04  8:04 ` [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe" Ulf Hansson
@ 2012-10-04  8:04 ` Ulf Hansson
  2012-10-04  8:04 ` [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm Ulf Hansson
  2012-10-05 12:21 ` [PATCH V2 0/3] spi: spi-pl022: Fixup use of " Linus Walleij
  3 siblings, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2012-10-04  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ulf Hansson <ulf.hansson@linaro.org>

This reverts commit 2fb30d1147c599f5657e8c62c862f9a0f58d9d99.

This patch is reverted due to wrong runtime PM code.

Conflicts:

	drivers/spi/spi-pl022.c

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/spi/spi-pl022.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 5cf0643..a1db91a 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -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);
-- 
1.7.10

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

* [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm
  2012-10-04  8:04 [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm Ulf Hansson
  2012-10-04  8:04 ` [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe" Ulf Hansson
  2012-10-04  8:04 ` [PATCH V2 2/3] Revert "spi/pl022: enable runtime PM" Ulf Hansson
@ 2012-10-04  8:04 ` Ulf Hansson
  2012-10-04  9:07   ` Ulf Hansson
  2012-10-05 12:21 ` [PATCH V2 0/3] spi: spi-pl022: Fixup use of " Linus Walleij
  3 siblings, 1 reply; 11+ messages in thread
From: Ulf Hansson @ 2012-10-04  8:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Ulf Hansson <ulf.hansson@linaro.org>

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*.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/spi/spi-pl022.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index a1db91a..51b7a95 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -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

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

* [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm
  2012-10-04  8:04 ` [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm Ulf Hansson
@ 2012-10-04  9:07   ` Ulf Hansson
  2012-10-05 12:19     ` Linus Walleij
  0 siblings, 1 reply; 11+ messages in thread
From: Ulf Hansson @ 2012-10-04  9:07 UTC (permalink / raw)
  To: linux-arm-kernel

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

On 4 October 2012 10:04, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> 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*.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/spi/spi-pl022.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> index a1db91a..51b7a95 100644
> --- a/drivers/spi/spi-pl022.c
> +++ b/drivers/spi/spi-pl022.c
> @@ -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
>

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

* [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm
  2012-10-04  9:07   ` Ulf Hansson
@ 2012-10-05 12:19     ` Linus Walleij
  2012-10-07 21:35       ` Rafael J. Wysocki
  0 siblings, 1 reply; 11+ messages in thread
From: Linus Walleij @ 2012-10-05 12:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 4, 2012 at 11:07 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:

> 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 ;-)

>> From: Ulf Hansson <ulf.hansson@linaro.org>
>>
>> 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*.
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>  drivers/spi/spi-pl022.c |    5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
>> index a1db91a..51b7a95 100644
>> --- a/drivers/spi/spi-pl022.c
>> +++ b/drivers/spi/spi-pl022.c
>> @@ -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

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

* [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm
  2012-10-04  8:04 [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm Ulf Hansson
                   ` (2 preceding siblings ...)
  2012-10-04  8:04 ` [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm Ulf Hansson
@ 2012-10-05 12:21 ` Linus Walleij
  2012-10-05 12:23   ` Mark Brown
  3 siblings, 1 reply; 11+ messages in thread
From: Linus Walleij @ 2012-10-05 12:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 4, 2012 at 10:04 AM, Ulf Hansson <ulf.hansson@stericsson.com> wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
>
> 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

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

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

* [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe"
  2012-10-04  8:04 ` [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe" Ulf Hansson
@ 2012-10-05 12:23   ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2012-10-05 12:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Oct 04, 2012 at 10:04:39AM +0200, Ulf Hansson wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
> 
> 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...

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

* [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm
  2012-10-05 12:21 ` [PATCH V2 0/3] spi: spi-pl022: Fixup use of " Linus Walleij
@ 2012-10-05 12:23   ` Mark Brown
  2012-10-05 15:49     ` Ulf Hansson
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2012-10-05 12:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Oct 05, 2012 at 02:21:15PM +0200, Linus Walleij wrote:

> 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.

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

* [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm
  2012-10-05 12:23   ` Mark Brown
@ 2012-10-05 15:49     ` Ulf Hansson
  0 siblings, 0 replies; 11+ messages in thread
From: Ulf Hansson @ 2012-10-05 15:49 UTC (permalink / raw)
  To: linux-arm-kernel

On 5 October 2012 14:23, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Fri, Oct 05, 2012 at 02:21:15PM +0200, Linus Walleij wrote:
>
>> 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

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

* [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm
  2012-10-05 12:19     ` Linus Walleij
@ 2012-10-07 21:35       ` Rafael J. Wysocki
  0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2012-10-07 21:35 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 05 of October 2012 14:19:57 Linus Walleij wrote:
> On Thu, Oct 4, 2012 at 11:07 AM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> 
> > 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 ;-)
> 
> >> From: Ulf Hansson <ulf.hansson@linaro.org>
> >>
> >> 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*.
> >>
> >> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> >> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> >> ---
> >>  drivers/spi/spi-pl022.c |    5 ++---
> >>  1 file changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
> >> index a1db91a..51b7a95 100644
> >> --- a/drivers/spi/spi-pl022.c
> >> +++ b/drivers/spi/spi-pl022.c
> >> @@ -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...

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


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2012-10-07 21:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04  8:04 [PATCH V2 0/3] spi: spi-pl022: Fixup use of runtime pm Ulf Hansson
2012-10-04  8:04 ` [PATCH V2 1/3] Revert "spi/pl022: fix spi-pl022 pm enable at probe" Ulf Hansson
2012-10-05 12:23   ` Mark Brown
2012-10-04  8:04 ` [PATCH V2 2/3] Revert "spi/pl022: enable runtime PM" Ulf Hansson
2012-10-04  8:04 ` [PATCH V2 3/3] spi: spi-pl022: Minor simplification for runtime pm Ulf Hansson
2012-10-04  9:07   ` Ulf Hansson
2012-10-05 12:19     ` Linus Walleij
2012-10-07 21:35       ` Rafael J. Wysocki
2012-10-05 12:21 ` [PATCH V2 0/3] spi: spi-pl022: Fixup use of " Linus Walleij
2012-10-05 12:23   ` Mark Brown
2012-10-05 15:49     ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).