All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Figa <tomasz.figa@gmail.com>
To: Tomasz Figa <t.figa@samsung.com>,
	Tomasz Stanislawski <t.stanislaws@samsung.com>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	dri-devel@lists.freedesktop.org, mturquette@linaro.org
Cc: kgene.kim@samsung.com, sw0312.kim@samsung.com,
	rob.herring@calxeda.com, kishon@ti.com, a.hajda@samsung.com,
	kyungmin.park@samsung.com, sylvester.nawrocki@gmail.com
Subject: Re: [PATCH 1/4] clk: propagate parent change up one level
Date: Thu, 01 May 2014 00:19:09 +0200	[thread overview]
Message-ID: <536176DD.5020507@gmail.com> (raw)
In-Reply-To: <5344198B.2030604@samsung.com>

Mike,

On 08.04.2014 17:45, Tomasz Figa wrote:
> Hi,
>
> On 04.04.2014 16:53, Tomasz Stanislawski wrote:
>> This patch adds support for propagation of setup of clock's parent one
>> level
>> up.
>>
>> This feature is helpful when a driver changes topology of its clocks
>> using
>> clk_set_parent().  The problem occurs when on one platform/SoC
>> driver's clock
>> is located at MUX output but on the other platform/SoC there is a
>> gated proxy
>> clock between the MUX and driver's clock.  In such a case, driver's
>> code has to
>> be modified to use one clock for enabling and the other clock for
>> setup of a
>> parent.
>>
>> The code updates are avoided by propagating setup of a parent up one
>> level.
>>
>> Additionally, this patch adds CLK_SET_PARENT_PARENT (sorry for naming)
>> flag to
>> inform clk-core that clk_set_parent() should be propagated.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>   drivers/clk/clk.c            |    6 ++++++
>>   include/linux/clk-provider.h |    1 +
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index dff0373..53bbfda 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -1737,6 +1737,12 @@ int clk_set_parent(struct clk *clk, struct clk
>> *parent)
>>
>>       /* try finding the new parent index */
>>       if (parent) {
>> +        if ((clk->flags & CLK_SET_PARENT_PARENT)
>> +            && clk->num_parents == 1) {
>> +            ret = clk_set_parent(clk->parent, parent);
>> +            goto out;
>> +        }
>> +
>>           p_index = clk_fetch_parent_index(clk, parent);
>>           p_rate = parent->rate;
>>           if (p_index < 0) {
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index 5119174..daa0b03 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -30,6 +30,7 @@
>>   #define CLK_GET_RATE_NOCACHE    BIT(6) /* do not use the cached clk
>> rate */
>>   #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate
>> change */
>>   #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk
>> accuracy */
>> +#define CLK_SET_PARENT_PARENT    BIT(9) /* propagate parent change up
>> one level */
>>
>>   struct clk_hw;
>>   struct dentry;
>>
>
> This would be very useful, at least on Exynos platforms, with
> mux-div-gate clock paths. PARENT_PARENT sounds a bit funny, though.
>
> Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Your opinion on this would be greatly appreciated.

Best regards,
Tomasz

WARNING: multiple messages have this Message-ID (diff)
From: tomasz.figa@gmail.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] clk: propagate parent change up one level
Date: Thu, 01 May 2014 00:19:09 +0200	[thread overview]
Message-ID: <536176DD.5020507@gmail.com> (raw)
In-Reply-To: <5344198B.2030604@samsung.com>

Mike,

On 08.04.2014 17:45, Tomasz Figa wrote:
> Hi,
>
> On 04.04.2014 16:53, Tomasz Stanislawski wrote:
>> This patch adds support for propagation of setup of clock's parent one
>> level
>> up.
>>
>> This feature is helpful when a driver changes topology of its clocks
>> using
>> clk_set_parent().  The problem occurs when on one platform/SoC
>> driver's clock
>> is located at MUX output but on the other platform/SoC there is a
>> gated proxy
>> clock between the MUX and driver's clock.  In such a case, driver's
>> code has to
>> be modified to use one clock for enabling and the other clock for
>> setup of a
>> parent.
>>
>> The code updates are avoided by propagating setup of a parent up one
>> level.
>>
>> Additionally, this patch adds CLK_SET_PARENT_PARENT (sorry for naming)
>> flag to
>> inform clk-core that clk_set_parent() should be propagated.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>   drivers/clk/clk.c            |    6 ++++++
>>   include/linux/clk-provider.h |    1 +
>>   2 files changed, 7 insertions(+)
>>
>> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
>> index dff0373..53bbfda 100644
>> --- a/drivers/clk/clk.c
>> +++ b/drivers/clk/clk.c
>> @@ -1737,6 +1737,12 @@ int clk_set_parent(struct clk *clk, struct clk
>> *parent)
>>
>>       /* try finding the new parent index */
>>       if (parent) {
>> +        if ((clk->flags & CLK_SET_PARENT_PARENT)
>> +            && clk->num_parents == 1) {
>> +            ret = clk_set_parent(clk->parent, parent);
>> +            goto out;
>> +        }
>> +
>>           p_index = clk_fetch_parent_index(clk, parent);
>>           p_rate = parent->rate;
>>           if (p_index < 0) {
>> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
>> index 5119174..daa0b03 100644
>> --- a/include/linux/clk-provider.h
>> +++ b/include/linux/clk-provider.h
>> @@ -30,6 +30,7 @@
>>   #define CLK_GET_RATE_NOCACHE    BIT(6) /* do not use the cached clk
>> rate */
>>   #define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate
>> change */
>>   #define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk
>> accuracy */
>> +#define CLK_SET_PARENT_PARENT    BIT(9) /* propagate parent change up
>> one level */
>>
>>   struct clk_hw;
>>   struct dentry;
>>
>
> This would be very useful, at least on Exynos platforms, with
> mux-div-gate clock paths. PARENT_PARENT sounds a bit funny, though.
>
> Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Your opinion on this would be greatly appreciated.

Best regards,
Tomasz

  reply	other threads:[~2014-04-30 22:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 14:53 [PATCH 0/4] Update to Exynos clocks Tomasz Stanislawski
2014-04-04 14:53 ` Tomasz Stanislawski
2014-04-04 14:53 ` [PATCH 1/4] clk: propagate parent change up one level Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-08 15:45   ` Tomasz Figa
2014-04-08 15:45     ` Tomasz Figa
2014-04-08 15:45     ` Tomasz Figa
2014-04-30 22:19     ` Tomasz Figa [this message]
2014-04-30 22:19       ` Tomasz Figa
2014-06-18 10:11       ` Tomasz Stanislawski
2014-06-18 10:11         ` Tomasz Stanislawski
2014-04-04 14:53 ` [PATCH 2/4] clk: exynos4: export sclk_hdmiphy clock Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-08 15:48   ` Tomasz Figa
2014-04-08 15:48     ` Tomasz Figa
2014-04-30 22:49   ` Tomasz Figa
2014-04-30 22:49     ` Tomasz Figa
2014-04-04 14:53 ` [PATCH 3/4] clk: exynos4: enable clk_set_parent() propagation for sclk_hdmi and sclk_mixer clocks Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-08 15:49   ` Tomasz Figa
2014-04-08 15:49     ` Tomasz Figa
2014-04-08 15:49     ` Tomasz Figa
2014-04-04 14:53 ` [PATCH 4/4] Revert "drm/exynos: add mout_hdmi clock in hdmi driver to change parent" Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-04 14:53   ` Tomasz Stanislawski
2014-04-08 15:52   ` Tomasz Figa
2014-04-08 15:52     ` Tomasz Figa
2014-04-08 15:52     ` Tomasz Figa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=536176DD.5020507@gmail.com \
    --to=tomasz.figa@gmail.com \
    --cc=a.hajda@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kgene.kim@samsung.com \
    --cc=kishon@ti.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=sw0312.kim@samsung.com \
    --cc=sylvester.nawrocki@gmail.com \
    --cc=t.figa@samsung.com \
    --cc=t.stanislaws@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.