From: Prashant Gaikwad <pgaikwad@nvidia.com>
To: Mike Turquette <mturquette@ti.com>
Cc: Peter De Schrijver <pdeschrijver@nvidia.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: Clock register in early init
Date: Fri, 18 May 2012 10:18:37 +0530 [thread overview]
Message-ID: <1337316517.22560.19.camel@pgaikwad-dt2> (raw)
In-Reply-To: <20120517062131.GA9305@gmail.com>
Thanks for the reply Mike!!
On Thu, 2012-05-17 at 11:51 +0530, Mike Turquette wrote:
> On 20120517-09:41, Prashant Gaikwad wrote:
> > Hi Mike,
> >
> > While porting Tegra to common clock framework I observed that if we try
> > to allocate struct clk dynamically in early init, kernel panics since
> > memory is not initialized yet.
> >
> > In your clk-next for omap you are registering clocks in early init and
> > clk_register allocates struct clk dynamically.
> >
> > So, am I missing something here?
> >
>
> You have the same problem as my platform (OMAP). Please check out
> include/linux/clk-private.h. That is a really nasty terrible hack that
> exists for statically initializing all data. It exposes the definition
> of struct clk (which is bad and violates the design philosophy that
> struct clk should be an opaque cookie).
>
> Please review Documentat/clk.txt to understand the rules around
> clk-private.h. Namely that you MUST separate your data from your clock
> function definitions (the clk_ops should never know the definition of
> struct clk).
>
Yes, currently I am also doing same for Tegra and it works well. clk_ops
and clk initialization data are in separate files. clk_ops does not
include clk-private.h so it does not know the definition of struct clk.
Will send patches for shortly.
> Finally, I really want to kill off clk-private.h. Currently OMAP does
> clock registration during early init and that is why this crap exists.
> However we are going to move our clock initialization to be initcall
> based at some point in the future. No other platform (until now) was
> using these macros in clk-private.h, so I had planned on removing them
> after OMAP migrated.
>
> What are the plans for Tegra? I really don't want to have to support
> this stuff. Can you migrate your clock initialization to be initcall
> based at some point in the future?
>
We had initcall based implementation in old kernel versions. It was
moved to early init since some clocks were required for delay
calibrations. It may be possible to migrate it be initcall based in
future.
> Regards,
> Mike
>
> p.s: best to have these kinds of discussions on the list, out in the
> open. If you want to continue our discussion can you loop in LAKML?
>
Added LAKML in loop.
> > Same is observed if we try to allocate parent list dynamically.
> >
> > Thanks & regards,
> > Prashant G
Prashant G
next parent reply other threads:[~2012-05-18 4:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1337227884.2066.9.camel@pgaikwad-dt2>
[not found] ` <20120517062131.GA9305@gmail.com>
2012-05-18 4:48 ` Prashant Gaikwad [this message]
2012-05-18 11:21 ` Peter De Schrijver
2012-05-18 20:17 ` Turquette, Mike
2012-05-21 8:46 ` Peter De Schrijver
2012-05-21 18:05 ` Turquette, Mike
2012-05-22 11:15 ` Peter De Schrijver
2012-05-22 9:20 ` Ben Dooks
2012-05-22 12:08 ` Peter De Schrijver
2012-05-22 17:37 ` Turquette, Mike
2012-05-23 9:19 ` Peter De Schrijver
2012-05-23 16:20 ` Turquette, Mike
2012-05-24 1:02 ` Paul Mundt
2012-05-24 15:51 ` Turquette, Mike
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=1337316517.22560.19.camel@pgaikwad-dt2 \
--to=pgaikwad@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@ti.com \
--cc=pdeschrijver@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®