public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>,
	Thierry Reding
	<thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Mikko Perttunen
	<mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Peter De Schrijver
	<pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	Prashant Gaikwad
	<pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 8/8] clk: tegra: Add EMC clock driver
Date: Thu, 31 Jul 2014 16:08:04 -0700	[thread overview]
Message-ID: <20140731230804.4463.12253@quantum> (raw)
In-Reply-To: <53DA9ED2.5000003-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>

Quoting Stephen Warren (2014-07-31 12:53:54)
> On 07/31/2014 01:06 PM, Mike Turquette wrote:
> > Quoting Thierry Reding (2014-07-30 02:34:57)
> >> On Tue, Jul 29, 2014 at 04:14:44PM -0600, Stephen Warren wrote:
> >>> On 07/29/2014 02:19 PM, Mike Turquette wrote:
> >>>> Quoting Mikko Perttunen (2014-07-29 01:47:35)
> >>>>> On 22/07/14 19:57, Stephen Warren wrote:
> >>>>>> On 07/11/2014 08:18 AM, Mikko Perttunen wrote:
> >>>>>>> +static int emc_debug_rate_set(void *data, u64 rate)
> >>>>>>> +{
> >>>>>>> +    struct tegra_emc *tegra = data;
> >>>>>>> +
> >>>>>>> +    return clk_set_rate(tegra->hw.clk, rate);
> >>>>>>> +}
> >>>>>>> +
> >>>>>>> +DEFINE_SIMPLE_ATTRIBUTE(emc_debug_rate_fops, emc_debug_rate_get,
> >>>>>>> +                    emc_debug_rate_set, "%lld\n");
> >>>>>>
> >>>>>> I think the rate can already be obtained through
> >>>>>> ...debug/clock/clock_summary. I'm not sure about changing the rate, but
> >>>>>> shouldn't that be a feature of the common clock core, not individual
> >>>>>> drivers?
> >>>>>
> >>>>> The core doesn't allow writing to the rate debugfs files, so this is the
> >>>>> only way to trigger an EMC clock change for now. I agree that the core
> >>>>> might be a better place. I don't know if there are any philosophical
> >>>>> objections to that. I'd like to keep this in until a possible core
> >>>>> feature addition. Mike, any comments?
> >>>>
> >>>> Yes, there is a philosophical rejection to exposing rate-change knobs to
> >>>> userspace through debugfs. These can and will ship in real products
> >>>> (typically Android) with lots of nasty userspace hacks, and also
> >>>> represent pretty dangerous things to expose to userspace. I have always
> >>>> maintained that such knobs should remain out of tree or, with the advent
> >>>> of the custom debugfs entries, should be burden of the clock drivers.
> >>>
> >>> That argument seems a bit inconsistent.
> >>>
> >>> I can see the argument to disallow code that lets user-space fiddle with
> >>> clocks. However, if that argument holds, then surely it must apply to either
> >>> the clock core *or* a clock driver; the end effect of allowing the code in
> >
> > Stephen,
> >
> > You meant to say, "it must apply to both the clock core and a clock
> > driver"? I agree.
> 
> Sure; s/either/both/ in what I said.
> 
> >>> either place is that people will be able to implement the user-space hacks
> >>> you want to avoid. Yet, if we allow the code because it's a useful debug
> >>> tool, then surely it should be in the clock core so we don't implement it
> >>> redundantly in each clock driver.
> >
> > I don't want it anywhere to be honest. Read-only debugfs stuff is great
> > and I'm happy to merge it. I have repeatedly NAK'd any attempt to get
> > the userspace rate-change stuff merged into the core.
> >
> > Recently we have the ability to assign custom debugfs entries that are
> > specific to the clock driver. I'm trying to find the right balance
> > between giving the clock driver authors the right amount of autonomy to
> > implement what they need while trying to keep the crazy out of the
> > kernel. Maybe in this case I should stick to my guns and NAK this patch.
> 
> If someone implements the same thing in some downstream/product kernel, 
> and it can't be upstreamed, I'd argue they should still do that in the 
> clock core rather than individual clock drivers, since they'll probably 
> want the feature for multiple clocks. I don't think  the per-clock 
> debugfs hook is useful in this case, although I can certainly imagine 
> other read-only per-clock debug files could be useful.

That is sensible, and all the more reason that this patch shouldn't
implement the rate-change feature within the clock driver. So consider
it NAK'd.

Also I agree that the per-clock debugfs entries are very useful for RO
operations, especially exposing how registers are programmed or other
relevant data.

Regards,
Mike

  parent reply	other threads:[~2014-07-31 23:08 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 14:18 [PATCH 0/8] Tegra124 EMC (external memory controller) support Mikko Perttunen
2014-07-11 14:18 ` [PATCH 1/8] clk: tegra124: Remove old emc_mux and emc clocks Mikko Perttunen
2014-07-11 14:18 ` [PATCH 2/8] ARM: tegra: Remove TEGRA124_CLK_EMC from tegra124-car.h Mikko Perttunen
     [not found]   ` <1405088313-20048-3-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-21 22:37     ` Stephen Warren
2014-07-29  8:28       ` Mikko Perttunen
     [not found] ` <1405088313-20048-1-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-11 14:18   ` [PATCH 3/8] ARM: tegra: Add PLL_M_UD and PLL_C_UD to tegra124-car binding header Mikko Perttunen
     [not found]     ` <1405088313-20048-4-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-08-25 17:41       ` Stephen Warren
     [not found]         ` <53FB7564.7020304-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-09-17 13:41           ` Peter De Schrijver
2014-07-11 14:18 ` [PATCH 4/8] clk: tegra124: Add PLL_M_UD and PLL_C_UD clocks Mikko Perttunen
2014-07-11 14:18 ` [PATCH 5/8] of: Add Tegra124 EMC bindings Mikko Perttunen
     [not found]   ` <1405088313-20048-6-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-11 14:51     ` Thierry Reding
2014-07-11 16:01       ` Mikko Perttunen
     [not found]         ` <53C00A57.5070102-/1wQRMveznE@public.gmane.org>
2014-07-14  7:55           ` Mikko Perttunen
     [not found]             ` <53C38D07.4030402-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-14  8:15               ` Thierry Reding
2014-07-14  9:06                 ` Mikko Perttunen
     [not found]                   ` <53C39D98.9040802-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-14  9:31                     ` Thierry Reding
2014-07-14  9:57                       ` Mikko Perttunen
     [not found]                         ` <53C3A986.9050602-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-14 10:29                           ` Thierry Reding
2014-07-14 10:54                             ` Mikko Perttunen
     [not found]                               ` <53C3B6EC.9090904-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-14 11:10                                 ` Thierry Reding
2014-07-14 12:28                                   ` Mikko Perttunen
2014-07-11 16:43   ` Andrew Bresticker
2014-07-11 16:48     ` Mikko Perttunen
     [not found]     ` <CAL1qeaGHfjQhLHvgzt85hmbuY4FOG5-k=f80=CNvzPDEgi9_6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-21 21:28       ` Stephen Warren
2014-07-21 22:52         ` Andrew Bresticker
     [not found]           ` <CAL1qeaHtGQxCO3cGdeCRUYuk6mxei6z1B63-iZdBECEbFqGhHw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-22 16:45             ` Stephen Warren
     [not found]               ` <53CE9514.1050903-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-22 17:22                 ` Andrew Bresticker
     [not found]                   ` <CAL1qeaEkL+mxb0S4JhQbXBjyNyKJndffTSjMaAFQD6ooDJPd+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-07-22 17:34                     ` Stephen Warren
     [not found]                       ` <53CEA093.6060106-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-29  8:30                         ` Mikko Perttunen
     [not found]                           ` <53D75B90.7050501-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-29 15:49                             ` Stephen Warren
     [not found]                               ` <53D7C276.2080204-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-31 10:48                                 ` Mikko Perttunen
     [not found]                                   ` <53DA1EF0.7060207-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-31 11:05                                     ` Mikko Perttunen
     [not found]                                       ` <53DA230E.7060903-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-31 15:32                                         ` Stephen Warren
2014-07-21 22:36   ` Stephen Warren
2014-07-11 14:18 ` [PATCH 6/8] ARM: tegra: Add EMC to Tegra124 device tree Mikko Perttunen
2014-07-11 14:18 ` [PATCH 7/8] ARM: tegra: Add EMC timings to Jetson TK1 " Mikko Perttunen
2014-07-11 14:18 ` [PATCH 8/8] clk: tegra: Add EMC clock driver Mikko Perttunen
     [not found]   ` <1405088313-20048-9-git-send-email-mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-22 16:57     ` Stephen Warren
     [not found]       ` <53CE97F2.80300-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-29  8:47         ` Mikko Perttunen
     [not found]           ` <53D75FA7.1030300-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-07-29 20:19             ` Mike Turquette
2014-07-29 22:14               ` Stephen Warren
     [not found]                 ` <53D81CD4.5010307-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-30  9:34                   ` Thierry Reding
2014-07-31 19:06                     ` Mike Turquette
2014-07-31 19:53                       ` Stephen Warren
     [not found]                         ` <53DA9ED2.5000003-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-07-31 23:08                           ` Mike Turquette [this message]
2014-08-01  6:31                             ` Mikko Perttunen
2014-08-01  8:40                       ` Thierry Reding
2014-08-25 17:40 ` [PATCH 0/8] Tegra124 EMC (external memory controller) support Stephen Warren
     [not found]   ` <53FB7511.9090205-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2014-08-26  7:42     ` Mikko Perttunen
2014-08-26  7:47       ` Thierry Reding
2014-08-26  8:02         ` Mikko Perttunen
     [not found]       ` <53FC3A5D.8030708-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2014-09-05 10:22         ` Tomeu Vizoso
2014-09-05 10:55           ` Mikko Perttunen

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=20140731230804.4463.12253@quantum \
    --to=mturquette-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=pgaikwad-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org \
    --cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox