All of lore.kernel.org
 help / color / mirror / Atom feed
From: lethal@linux-sh.org (Paul Mundt)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] Add a common struct clk
Date: Tue, 18 Jan 2011 18:23:19 +0900	[thread overview]
Message-ID: <20110118092319.GB18525@linux-sh.org> (raw)
In-Reply-To: <20110118092128.GO9041@pengutronix.de>

On Tue, Jan 18, 2011 at 10:21:28AM +0100, Sascha Hauer wrote:
> On Tue, Jan 18, 2011 at 05:44:45PM +0900, Paul Mundt wrote:
> > Do you guys even bother to grep the kernel for users of the API before
> > coming up with arbitrary policy?
> 
> Actually I did bother to grep the kernel and I came up with these
> results:
> 
> drivers/video/omap2/dss/dss.c:219:      dpll4_ck_rate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:312:      prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:325:              prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:344:              prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:359:              return clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/sh_mobile_hdmi.c:716:     else if (clk_get_parent(hdmi->hdmi_clk))
> drivers/video/sh_mobile_hdmi.c:717:             *parent_rate = clk_get_rate(clk_get_parent(hdmi->hdmi_clk));
> drivers/video/sh_mobile_hdmi.c:1089:    if (parent_rate && clk_get_parent(hdmi->hdmi_clk)) {
> drivers/video/sh_mobile_hdmi.c:1090:            ret = clk_set_rate(clk_get_parent(hdmi->hdmi_clk), parent_rate);
> drivers/usb/host/ehci-omap.c:405:                       ret = clk_set_parent(omap->utmi_p1_fck,
> drivers/usb/host/ehci-omap.c:435:                       ret = clk_set_parent(omap->utmi_p2_fck,
> 
Then I recommend you grep harder. There are more drivers than the ones
that simply live in drivers/.

> > There are plenty of cases where clocks are allocated dynamically by
> > driver code that in turn can be set up as a parent for other dynamically
> > allocated clocks. This has not a damn thing to do with platform code and
> > everything to do with the clock circuitry of the device or IP block in
> > question.
> 
> The majority of users do not use clk_{get,set}_parent at all. And it's
> really questionable whether drivers should know anything about the
> layout of the clock tree. I'm pretty sure that these are the code pieces
> where there will be a if_soc_rev(x) around it once the next incarnation
> of a SoC comes out.
> 
It's not questionable in the least, you're simply dealing with cases
where you personally haven't had a need to do so and are attempting to
project that as a policy. I'm getting pretty tired of this.

We have many IP blocks that can use external clocks or drive their own
clock circuitry, in which case the internal clocks are parented by a
parent clock that is likewise also dynamically created. Your lack of
imagination is really not my concern, and again, this has nothing to do
with the SoC.

WARNING: multiple messages have this Message-ID (diff)
From: Paul Mundt <lethal@linux-sh.org>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Jeremy Kerr <jeremy.kerr@canonical.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Ben Herrenchmidt <benh@kernel.crashing.org>,
	Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH 1/2] Add a common struct clk
Date: Tue, 18 Jan 2011 18:23:19 +0900	[thread overview]
Message-ID: <20110118092319.GB18525@linux-sh.org> (raw)
In-Reply-To: <20110118092128.GO9041@pengutronix.de>

On Tue, Jan 18, 2011 at 10:21:28AM +0100, Sascha Hauer wrote:
> On Tue, Jan 18, 2011 at 05:44:45PM +0900, Paul Mundt wrote:
> > Do you guys even bother to grep the kernel for users of the API before
> > coming up with arbitrary policy?
> 
> Actually I did bother to grep the kernel and I came up with these
> results:
> 
> drivers/video/omap2/dss/dss.c:219:      dpll4_ck_rate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:312:      prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:325:              prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:344:              prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/omap2/dss/dss.c:359:              return clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
> drivers/video/sh_mobile_hdmi.c:716:     else if (clk_get_parent(hdmi->hdmi_clk))
> drivers/video/sh_mobile_hdmi.c:717:             *parent_rate = clk_get_rate(clk_get_parent(hdmi->hdmi_clk));
> drivers/video/sh_mobile_hdmi.c:1089:    if (parent_rate && clk_get_parent(hdmi->hdmi_clk)) {
> drivers/video/sh_mobile_hdmi.c:1090:            ret = clk_set_rate(clk_get_parent(hdmi->hdmi_clk), parent_rate);
> drivers/usb/host/ehci-omap.c:405:                       ret = clk_set_parent(omap->utmi_p1_fck,
> drivers/usb/host/ehci-omap.c:435:                       ret = clk_set_parent(omap->utmi_p2_fck,
> 
Then I recommend you grep harder. There are more drivers than the ones
that simply live in drivers/.

> > There are plenty of cases where clocks are allocated dynamically by
> > driver code that in turn can be set up as a parent for other dynamically
> > allocated clocks. This has not a damn thing to do with platform code and
> > everything to do with the clock circuitry of the device or IP block in
> > question.
> 
> The majority of users do not use clk_{get,set}_parent at all. And it's
> really questionable whether drivers should know anything about the
> layout of the clock tree. I'm pretty sure that these are the code pieces
> where there will be a if_soc_rev(x) around it once the next incarnation
> of a SoC comes out.
> 
It's not questionable in the least, you're simply dealing with cases
where you personally haven't had a need to do so and are attempting to
project that as a policy. I'm getting pretty tired of this.

We have many IP blocks that can use external clocks or drive their own
clock circuitry, in which case the internal clocks are parented by a
parent clock that is likewise also dynamically created. Your lack of
imagination is really not my concern, and again, this has nothing to do
with the SoC.

  reply	other threads:[~2011-01-18  9:23 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-05  3:51 [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-05  3:51 ` Jeremy Kerr
2011-01-05  3:51 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2011-01-05  3:51   ` Jeremy Kerr
2011-01-06 16:07   ` Richard Cochran
2011-01-06 16:07     ` Richard Cochran
2011-01-06 20:11     ` Uwe Kleine-König
2011-01-06 20:11       ` Uwe Kleine-König
2011-01-07  0:10       ` Jeremy Kerr
2011-01-07  0:10         ` Jeremy Kerr
2011-01-07  0:32         ` Russell King - ARM Linux
2011-01-07  0:32           ` Russell King - ARM Linux
2011-01-07  9:40           ` Uwe Kleine-König
2011-01-07  9:40             ` Uwe Kleine-König
2011-01-08 13:15   ` Sascha Hauer
2011-01-08 13:15     ` Sascha Hauer
2011-01-10  2:43     ` Jeremy Kerr
2011-01-10  2:43       ` Jeremy Kerr
2011-01-10 10:41       ` Sascha Hauer
2011-01-10 10:41         ` Sascha Hauer
2011-01-10 11:00         ` Russell King - ARM Linux
2011-01-10 11:00           ` Russell King - ARM Linux
2011-01-11  0:54           ` Jeremy Kerr
2011-01-11  0:54             ` Jeremy Kerr
2011-01-16  7:26             ` Grant Likely
2011-01-16  7:26               ` Grant Likely
2011-01-16 20:41               ` Ryan Mallon
2011-01-16 20:41                 ` Ryan Mallon
2011-01-16 21:07                 ` Uwe Kleine-König
2011-01-16 21:07                   ` Uwe Kleine-König
2011-01-16 21:39                   ` Ryan Mallon
2011-01-16 21:39                     ` Ryan Mallon
2011-01-11 10:16   ` Sascha Hauer
2011-01-11 10:16     ` Sascha Hauer
2011-01-11 10:27     ` Jeremy Kerr
2011-01-11 10:27       ` Jeremy Kerr
2011-01-11 11:22       ` Sascha Hauer
2011-01-11 11:22         ` Sascha Hauer
2011-01-18  8:44         ` Paul Mundt
2011-01-18  8:44           ` Paul Mundt
2011-01-18  9:21           ` Sascha Hauer
2011-01-18  9:21             ` Sascha Hauer
2011-01-18  9:23             ` Paul Mundt [this message]
2011-01-18  9:23               ` Paul Mundt
2011-01-18 12:21   ` Russell King - ARM Linux
2011-01-18 12:21     ` Russell King - ARM Linux
2011-01-05  3:51 ` [PATCH 2/2] clk: Generic support for fixed-rate clocks Jeremy Kerr
2011-01-05  3:51   ` Jeremy Kerr
2011-01-05  3:55 ` [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-07  1:33 ` Ben Dooks
2011-01-07  9:49   ` Uwe Kleine-König
  -- strict thread matches above, loose matches on Subject: below --
2011-03-03  6:40 [PATCH 0/2] Common struct clk implementation, v14 Jeremy Kerr
2011-02-21  2:50 [PATCH 0/2] Common struct clk implementation, v13 Jeremy Kerr
2011-02-21  2:50 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2011-02-21  2:50   ` Jeremy Kerr
2011-02-21  2:50   ` Jeremy Kerr
2011-02-22 20:17   ` 
2011-02-22 20:17     ` Uwe Kleine-König
2011-02-22 20:17     ` Uwe Kleine-König
2011-02-23  2:49     ` Jeremy Kerr
2011-02-23  2:49       ` Jeremy Kerr
2011-02-23  2:49       ` Jeremy Kerr
2011-03-03  6:40   ` Jeremy Kerr
2011-03-03  6:40     ` Jeremy Kerr
2011-03-03  6:40     ` Jeremy Kerr
2011-04-14 12:49     ` Tony Lindgren
2011-04-14 12:49       ` Tony Lindgren
2011-04-14 12:49       ` Tony Lindgren
2011-01-05  3:18 [PATCH 0/2] Common struct clk implementation, v10 Jeremy Kerr
2011-01-05  3:18 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-12-08  2:08 [PATCH 0/2] Common struct clk implementation, v8 Jeremy Kerr
2010-12-08  2:08 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-12-08  2:08   ` Jeremy Kerr
2010-12-08  2:05 Jeremy Kerr
2010-12-08  2:05 ` Jeremy Kerr
2010-12-08 10:21 ` Uwe Kleine-König
2010-12-08 10:21   ` Uwe Kleine-König
2010-12-10  1:58   ` Jeremy Kerr
2010-12-10  1:58     ` Jeremy Kerr
2010-12-10  9:21     ` Uwe Kleine-König
2010-07-12  2:37 [PATCH 0/2] Common struct clk implementation, v6 Jeremy Kerr
2010-07-12  2:37 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-07-12  2:37   ` Jeremy Kerr
2010-06-21  5:35 [PATCH 0/2] Common struct clk implementation, v5 Jeremy Kerr
2010-06-21  5:35 ` [PATCH 1/2] Add a common struct clk Jeremy Kerr
2010-06-21  5:35   ` Jeremy Kerr
2010-06-22  4:43   ` Baruch Siach
2010-06-22  4:43     ` Baruch Siach
2010-07-05  2:33   ` MyungJoo Ham
2010-07-05  2:33     ` MyungJoo Ham
2010-07-12  2:19     ` Jeremy Kerr
2010-07-12  2:19       ` Jeremy Kerr

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=20110118092319.GB18525@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-arm-kernel@lists.infradead.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.