linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id
@ 2015-05-29 16:35 Geert Uytterhoeven
  2015-06-02 12:31 ` Grygorii.Strashko@linaro.org
  2015-06-04  9:27 ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2015-05-29 16:35 UTC (permalink / raw)
  To: Rafael J. Wysocki, Kevin Hilman, Ulf Hansson, Grygorii Strashko
  Cc: linux-pm, linux-clk, Geert Uytterhoeven

Currently the con_id of the acquired clock is printed for debugging
purposes.  But in several cases, the con_id is NULL, which doesn't
provide much debugging information when printed.  These cases are:
  - When explicitly passing a NULL con_id (which means the first clock
    tied to the device, if available),
  - When not using pm_clk_add(), but pm_clk_add_clk() (which takes a
    "struct clk *" directly).

Hence print the actual clock name in addition to (and not instead of;
thanks Grygorii Strashko!) the con_id.

Note that the clock name is not available with legacy clock frameworks,
and the hex pointer address will be printed instead.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is v2 of "PM / clock_ops: Print acquired clock name instead of
con_id".

v2:
  - Print both clock and con_id, as suggested by Grygorii Strashko
    <grygorii.strashko@linaro.org>.
---
 drivers/base/power/clock_ops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
index 442ce010559bf531..acef9f9f759a2530 100644
--- a/drivers/base/power/clock_ops.c
+++ b/drivers/base/power/clock_ops.c
@@ -68,7 +68,8 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
 	} else {
 		clk_prepare(ce->clk);
 		ce->status = PCE_STATUS_ACQUIRED;
-		dev_dbg(dev, "Clock %s managed by runtime PM.\n", ce->con_id);
+		dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",
+			ce->clk, ce->con_id);
 	}
 }
 
-- 
1.9.1


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

* Re: [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id
  2015-05-29 16:35 [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id Geert Uytterhoeven
@ 2015-06-02 12:31 ` Grygorii.Strashko@linaro.org
  2015-06-04  9:27 ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Grygorii.Strashko@linaro.org @ 2015-06-02 12:31 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rafael J. Wysocki, Kevin Hilman, Ulf Hansson
  Cc: linux-pm, linux-clk

On 05/29/2015 07:35 PM, Geert Uytterhoeven wrote:
> Currently the con_id of the acquired clock is printed for debugging
> purposes.  But in several cases, the con_id is NULL, which doesn't
> provide much debugging information when printed.  These cases are:
>    - When explicitly passing a NULL con_id (which means the first clock
>      tied to the device, if available),
>    - When not using pm_clk_add(), but pm_clk_add_clk() (which takes a
>      "struct clk *" directly).
>
> Hence print the actual clock name in addition to (and not instead of;
> thanks Grygorii Strashko!) the con_id.
>
> Note that the clock name is not available with legacy clock frameworks,
> and the hex pointer address will be printed instead.
>

Looks good for me.
Reviewed-by: Grygorii Strashko <grygorii.strashko@linaro.org>

> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is v2 of "PM / clock_ops: Print acquired clock name instead of
> con_id".
>
> v2:
>    - Print both clock and con_id, as suggested by Grygorii Strashko
>      <grygorii.strashko@linaro.org>.
> ---
>   drivers/base/power/clock_ops.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index 442ce010559bf531..acef9f9f759a2530 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -68,7 +68,8 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
>   	} else {
>   		clk_prepare(ce->clk);
>   		ce->status = PCE_STATUS_ACQUIRED;
> -		dev_dbg(dev, "Clock %s managed by runtime PM.\n", ce->con_id);
> +		dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",
> +			ce->clk, ce->con_id);
>   	}
>   }
>
>


-- 
regards,
-grygorii

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

* Re: [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id
  2015-05-29 16:35 [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id Geert Uytterhoeven
  2015-06-02 12:31 ` Grygorii.Strashko@linaro.org
@ 2015-06-04  9:27 ` Ulf Hansson
  2015-06-15 23:40   ` Rafael J. Wysocki
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2015-06-04  9:27 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J. Wysocki, Kevin Hilman, Grygorii Strashko,
	linux-pm@vger.kernel.org, linux-clk

On 29 May 2015 at 18:35, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Currently the con_id of the acquired clock is printed for debugging
> purposes.  But in several cases, the con_id is NULL, which doesn't
> provide much debugging information when printed.  These cases are:
>   - When explicitly passing a NULL con_id (which means the first clock
>     tied to the device, if available),
>   - When not using pm_clk_add(), but pm_clk_add_clk() (which takes a
>     "struct clk *" directly).
>
> Hence print the actual clock name in addition to (and not instead of;
> thanks Grygorii Strashko!) the con_id.
>
> Note that the clock name is not available with legacy clock frameworks,
> and the hex pointer address will be printed instead.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

> ---
> This is v2 of "PM / clock_ops: Print acquired clock name instead of
> con_id".
>
> v2:
>   - Print both clock and con_id, as suggested by Grygorii Strashko
>     <grygorii.strashko@linaro.org>.
> ---
>  drivers/base/power/clock_ops.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/power/clock_ops.c b/drivers/base/power/clock_ops.c
> index 442ce010559bf531..acef9f9f759a2530 100644
> --- a/drivers/base/power/clock_ops.c
> +++ b/drivers/base/power/clock_ops.c
> @@ -68,7 +68,8 @@ static void pm_clk_acquire(struct device *dev, struct pm_clock_entry *ce)
>         } else {
>                 clk_prepare(ce->clk);
>                 ce->status = PCE_STATUS_ACQUIRED;
> -               dev_dbg(dev, "Clock %s managed by runtime PM.\n", ce->con_id);
> +               dev_dbg(dev, "Clock %pC con_id %s managed by runtime PM.\n",

Oh, I didn't know "%pC" handle the clock name printing. Cool! :-)

> +                       ce->clk, ce->con_id);
>         }
>  }
>
> --
> 1.9.1
>

Kind regards
Uffe

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

* Re: [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id
  2015-06-04  9:27 ` Ulf Hansson
@ 2015-06-15 23:40   ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2015-06-15 23:40 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Geert Uytterhoeven, Kevin Hilman, Grygorii Strashko,
	linux-pm@vger.kernel.org, linux-clk

On Thursday, June 04, 2015 11:27:01 AM Ulf Hansson wrote:
> On 29 May 2015 at 18:35, Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> > Currently the con_id of the acquired clock is printed for debugging
> > purposes.  But in several cases, the con_id is NULL, which doesn't
> > provide much debugging information when printed.  These cases are:
> >   - When explicitly passing a NULL con_id (which means the first clock
> >     tied to the device, if available),
> >   - When not using pm_clk_add(), but pm_clk_add_clk() (which takes a
> >     "struct clk *" directly).
> >
> > Hence print the actual clock name in addition to (and not instead of;
> > thanks Grygorii Strashko!) the con_id.
> >
> > Note that the clock name is not available with legacy clock frameworks,
> > and the hex pointer address will be printed instead.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Queued up for 4.2, thanks!


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

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

end of thread, other threads:[~2015-06-15 23:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29 16:35 [PATCH v2] PM / clock_ops: Print acquired clock name in addition to con_id Geert Uytterhoeven
2015-06-02 12:31 ` Grygorii.Strashko@linaro.org
2015-06-04  9:27 ` Ulf Hansson
2015-06-15 23:40   ` Rafael J. Wysocki

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