From: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Rahul Sharma <rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-samsung-soc
<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Pankaj Dubey
<pankaj.dubey-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kukjin Kim <kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
Marek Szyprowski
<m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
Tushar Behera
<tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: Re: [PATCH RFC 3/4] clk: samsung: Add driver to control CLKOUT line on Exynos SoCs
Date: Fri, 16 May 2014 16:58:36 +0200 [thread overview]
Message-ID: <5376279C.4070006@samsung.com> (raw)
In-Reply-To: <CAPdUM4O4RKFZFR_tcwG4pd7E6KMkneG9R_VbZPt+m4fGG_UFVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 16.05.2014 16:35, Rahul Sharma wrote:
> On 16 May 2014 16:22, Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
>> Hi Rahul,
>>
>> On 16.05.2014 12:39, Rahul Sharma wrote:
>>> [snip]
>>>> + gate->lock = &clkout_lock;
>>>> +
>>>> + mux->reg = reg + EXYNOS_PMU_DEBUG_REG;
>>>> + mux->mask = EXYNOS_CLKOUT_MUX_MASK;
>>>> + mux->shift = EXYNOS_CLKOUT_MUX_SHIFT;
>>>> + mux->lock = &clkout_lock;
>>>> +
>>>> + clk = clk_register_composite(NULL, "clkout", parent_names,
>>>> + parent_count, &mux->hw,
>>>> + &clk_mux_ops, NULL, NULL, &gate->hw,
>>>> + &clk_gate_ops, 0);
>>>> + if (IS_ERR(clk))
>>>> + goto err_unmap;
>>>> +
>>>
>>> Hi Tomasz,
>>>
>>> Do we really need a composite clock here? How about registering
>>> a mux and a gate separately?
>>
>> What's wrong with a composite clock? It simplifies the code as just a
>> single clock needs to be registered. I don't see any drawbacks compared
>> to registering two clocks separately.
>>
>
> I always took it as a thumb rule to not to use composite clocks if you
> can easily represent the block using basic clocks structures.
>
> There can be a problem when drivers using such clocks assume that such
> clock continue to offer composite functionality for all futures SoCs and
> write code around it. This is what we faced when fixing drivers during
> CCF migration.
The drivers using CLKOUT need to be designed this way, because they are
not Exynos-specific, such as drivers for HSIC hubs or audio codecs. They
can't have any Exynos-specific knowledge about clock hierarchy.
So regardless of whether this is implemented using the composite clock
or not, consumer device drivers need to be able to use just a single
clock to do whatever they need, e.g. gating or rate configuration.
However I can see one problem here with my implementation - it is
missing the CLK_SET_RATE_PARENT flag, so dividers of particular CLK_OUTs
from CMU blocks could be reconfigured.
Also the driver is missing save and restore of PMU_DEBUG register.
I will fix both in next version.
Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 3/4] clk: samsung: Add driver to control CLKOUT line on Exynos SoCs
Date: Fri, 16 May 2014 16:58:36 +0200 [thread overview]
Message-ID: <5376279C.4070006@samsung.com> (raw)
In-Reply-To: <CAPdUM4O4RKFZFR_tcwG4pd7E6KMkneG9R_VbZPt+m4fGG_UFVg@mail.gmail.com>
On 16.05.2014 16:35, Rahul Sharma wrote:
> On 16 May 2014 16:22, Tomasz Figa <t.figa@samsung.com> wrote:
>> Hi Rahul,
>>
>> On 16.05.2014 12:39, Rahul Sharma wrote:
>>> [snip]
>>>> + gate->lock = &clkout_lock;
>>>> +
>>>> + mux->reg = reg + EXYNOS_PMU_DEBUG_REG;
>>>> + mux->mask = EXYNOS_CLKOUT_MUX_MASK;
>>>> + mux->shift = EXYNOS_CLKOUT_MUX_SHIFT;
>>>> + mux->lock = &clkout_lock;
>>>> +
>>>> + clk = clk_register_composite(NULL, "clkout", parent_names,
>>>> + parent_count, &mux->hw,
>>>> + &clk_mux_ops, NULL, NULL, &gate->hw,
>>>> + &clk_gate_ops, 0);
>>>> + if (IS_ERR(clk))
>>>> + goto err_unmap;
>>>> +
>>>
>>> Hi Tomasz,
>>>
>>> Do we really need a composite clock here? How about registering
>>> a mux and a gate separately?
>>
>> What's wrong with a composite clock? It simplifies the code as just a
>> single clock needs to be registered. I don't see any drawbacks compared
>> to registering two clocks separately.
>>
>
> I always took it as a thumb rule to not to use composite clocks if you
> can easily represent the block using basic clocks structures.
>
> There can be a problem when drivers using such clocks assume that such
> clock continue to offer composite functionality for all futures SoCs and
> write code around it. This is what we faced when fixing drivers during
> CCF migration.
The drivers using CLKOUT need to be designed this way, because they are
not Exynos-specific, such as drivers for HSIC hubs or audio codecs. They
can't have any Exynos-specific knowledge about clock hierarchy.
So regardless of whether this is implemented using the composite clock
or not, consumer device drivers need to be able to use just a single
clock to do whatever they need, e.g. gating or rate configuration.
However I can see one problem here with my implementation - it is
missing the CLK_SET_RATE_PARENT flag, so dividers of particular CLK_OUTs
from CMU blocks could be reconfigured.
Also the driver is missing save and restore of PMU_DEBUG register.
I will fix both in next version.
Best regards,
Tomasz
WARNING: multiple messages have this Message-ID (diff)
From: Tomasz Figa <t.figa@samsung.com>
To: Rahul Sharma <rahul.sharma@samsung.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
Mike Turquette <mturquette@linaro.org>,
Pankaj Dubey <pankaj.dubey@samsung.com>,
Mark Brown <broonie@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Tomasz Figa <tomasz.figa@gmail.com>,
Kukjin Kim <kgene.kim@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Tushar Behera <tushar.behera@linaro.org>
Subject: Re: [PATCH RFC 3/4] clk: samsung: Add driver to control CLKOUT line on Exynos SoCs
Date: Fri, 16 May 2014 16:58:36 +0200 [thread overview]
Message-ID: <5376279C.4070006@samsung.com> (raw)
In-Reply-To: <CAPdUM4O4RKFZFR_tcwG4pd7E6KMkneG9R_VbZPt+m4fGG_UFVg@mail.gmail.com>
On 16.05.2014 16:35, Rahul Sharma wrote:
> On 16 May 2014 16:22, Tomasz Figa <t.figa@samsung.com> wrote:
>> Hi Rahul,
>>
>> On 16.05.2014 12:39, Rahul Sharma wrote:
>>> [snip]
>>>> + gate->lock = &clkout_lock;
>>>> +
>>>> + mux->reg = reg + EXYNOS_PMU_DEBUG_REG;
>>>> + mux->mask = EXYNOS_CLKOUT_MUX_MASK;
>>>> + mux->shift = EXYNOS_CLKOUT_MUX_SHIFT;
>>>> + mux->lock = &clkout_lock;
>>>> +
>>>> + clk = clk_register_composite(NULL, "clkout", parent_names,
>>>> + parent_count, &mux->hw,
>>>> + &clk_mux_ops, NULL, NULL, &gate->hw,
>>>> + &clk_gate_ops, 0);
>>>> + if (IS_ERR(clk))
>>>> + goto err_unmap;
>>>> +
>>>
>>> Hi Tomasz,
>>>
>>> Do we really need a composite clock here? How about registering
>>> a mux and a gate separately?
>>
>> What's wrong with a composite clock? It simplifies the code as just a
>> single clock needs to be registered. I don't see any drawbacks compared
>> to registering two clocks separately.
>>
>
> I always took it as a thumb rule to not to use composite clocks if you
> can easily represent the block using basic clocks structures.
>
> There can be a problem when drivers using such clocks assume that such
> clock continue to offer composite functionality for all futures SoCs and
> write code around it. This is what we faced when fixing drivers during
> CCF migration.
The drivers using CLKOUT need to be designed this way, because they are
not Exynos-specific, such as drivers for HSIC hubs or audio codecs. They
can't have any Exynos-specific knowledge about clock hierarchy.
So regardless of whether this is implemented using the composite clock
or not, consumer device drivers need to be able to use just a single
clock to do whatever they need, e.g. gating or rate configuration.
However I can see one problem here with my implementation - it is
missing the CLK_SET_RATE_PARENT flag, so dividers of particular CLK_OUTs
from CMU blocks could be reconfigured.
Also the driver is missing save and restore of PMU_DEBUG register.
I will fix both in next version.
Best regards,
Tomasz
next prev parent reply other threads:[~2014-05-16 14:58 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 17:32 [PATCH RFC 0/4] Add support for Exynos clock output configuration Tomasz Figa
2014-05-15 17:32 ` Tomasz Figa
2014-05-15 17:32 ` [PATCH RFC 1/4] clk: samsung: exynos4: Add missing DMC clock hierarchy Tomasz Figa
2014-05-15 17:32 ` Tomasz Figa
2014-05-15 17:32 ` [PATCH RFC 2/4] clk: samsung: exynos4: Add CLKOUT " Tomasz Figa
2014-05-15 17:32 ` Tomasz Figa
2014-05-15 17:32 ` [PATCH RFC 3/4] clk: samsung: Add driver to control CLKOUT line on Exynos SoCs Tomasz Figa
2014-05-15 17:32 ` Tomasz Figa
2014-05-15 17:32 ` Tomasz Figa
2014-05-16 10:39 ` Rahul Sharma
2014-05-16 10:39 ` Rahul Sharma
2014-05-16 10:52 ` Tomasz Figa
2014-05-16 10:52 ` Tomasz Figa
2014-05-16 14:35 ` Rahul Sharma
2014-05-16 14:35 ` Rahul Sharma
[not found] ` <CAPdUM4O4RKFZFR_tcwG4pd7E6KMkneG9R_VbZPt+m4fGG_UFVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-05-16 14:58 ` Tomasz Figa [this message]
2014-05-16 14:58 ` Tomasz Figa
2014-05-16 14:58 ` Tomasz Figa
2014-05-16 23:04 ` Mike Turquette
2014-05-16 23:04 ` Mike Turquette
2014-05-16 23:04 ` Mike Turquette
2014-05-19 7:16 ` Tushar Behera
2014-05-19 7:16 ` Tushar Behera
2014-05-19 10:25 ` Tomasz Figa
2014-05-19 10:25 ` Tomasz Figa
2014-05-15 17:32 ` [PATCH RFC 4/4] ARM: dts: exynos: Update PMU node with CLKOUT related data Tomasz Figa
2014-05-15 17:32 ` 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=5376279C.4070006@samsung.com \
--to=t.figa-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=pankaj.dubey-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=rahul.sharma-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=tushar.behera-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/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.