From: Scott Wood <scottwood@freescale.com>
To: avorontsov@ru.mvista.com
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support
Date: Tue, 18 Mar 2008 15:48:12 -0500 [thread overview]
Message-ID: <47E02A8C.2080705@freescale.com> (raw)
In-Reply-To: <20080318202717.GA1030@localhost.localdomain>
Anton Vorontsov wrote:
> On Tue, Mar 18, 2008 at 02:55:14PM -0500, Scott Wood wrote:
>> Anton Vorontsov wrote:
>>>>> +arch_initcall(qe_init_gtm);
>>>> If this happens before the gtm_init_gtm(),
>>> "If" isn't possible, order is guaranteed.
>> You use arch_initcall for both, so you're relying on link order. I
>> think this at least merits a comment.
>>>> then np->data will not be set.
>>> It's a bug in the device tree or in the Linux code then.
>> Hmm? It's set by gtm_init_gtm(). If this code runs before
>> gtm_init_gtm(), what are you expecting to initialize np->data?
>
> What code exactly?
Sorry, "this code" == qe_init_gtm(). Obviously, if you assume that
gtm_init_gtm() will always be linked earlier, then it's not an issue.
>> Also, what if some arch_initcall runs between gtm_init_gtm and
>> qe_init_gtm, that registers itself as a client of the gtm driver, and
>> uses the wrong clock value?
>
> Again, what code exactly? If it is a driver (for what this API is
> created for), it hardly will run earlier than arch/ code. If this is
> platform code (arch/powerpc/platform/), then it is hardly will run
> earlier than arch/sysdev/. Inside the arch/sysdev/ fsl_gtm.c is
> guaranteed to run earlier than qe_lib/gtm.c. So, where is the problem?
That's a lot of implicit, undocumented dependency on link order...
Things can be moved around, and driver-ish code can pop up in surprising
places. All I meant was that having the gtm driver present itself as
ready when it isn't, in a way which isn't readily apparent if it
happens, is worrysome.
> Since I'll implement clock-frequency inside the timer node, this
> isn't relevant anymore...
OK, good.
> Ah. You need specific timer. No problem. I don't like idea of new arguments
> to the gtm_get_timer() function (complicates things), but we can just
> implement another one. gtm_get_timer_<name>, choice the name please.
> _specific, _2, _for, __gtm_get_timer, ...
How about:
struct gtm_timer *gtm_get_specific_timer(struct gtm *gtm, int timer,
int width);
...with np->data used by the caller to figure out which gtm pointer to
pass in.
-Scott
next prev parent reply other threads:[~2008-03-18 20:48 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-11 17:21 [PATCH 0/8] A bit of new code and sparse cleanups along the way Anton Vorontsov
2008-03-11 17:23 ` [PATCH 1/8] [POWERPC] fsl_elbc_nand: factor out localbus defines Anton Vorontsov
2008-04-11 14:06 ` Kumar Gala
2008-04-13 12:53 ` David Woodhouse
2008-04-14 15:10 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 2/8] [POWERPC] fsl_lbc: implement few routines to manage FSL UPMs Anton Vorontsov
2008-04-11 14:09 ` Kumar Gala
2008-04-11 16:13 ` Anton Vorontsov
2008-04-11 16:18 ` Scott Wood
2008-04-11 17:03 ` Anton Vorontsov
2008-04-12 4:09 ` Paul Mackerras
2008-04-14 15:11 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 3/8] [POWERPC] qe_lib: implement qe_muram_offset Anton Vorontsov
2008-03-18 17:48 ` Scott Wood
2008-04-14 15:11 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 4/8] [POWERPC] immap_qe.h should include asm/io.h Anton Vorontsov
2008-04-14 15:11 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 5/8] [POWERPC] qe_lib: export qe_get_brg_clk() Anton Vorontsov
2008-03-11 18:36 ` Kumar Gala
2008-03-11 18:44 ` Anton Vorontsov
2008-04-14 15:11 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support Anton Vorontsov
2008-03-18 17:43 ` Scott Wood
2008-03-18 19:21 ` Anton Vorontsov
2008-03-18 19:55 ` Scott Wood
2008-03-18 20:27 ` Anton Vorontsov
2008-03-18 20:48 ` Scott Wood [this message]
2008-04-16 18:39 ` Anton Vorontsov
2008-04-16 18:44 ` Scott Wood
2008-04-16 21:00 ` Anton Vorontsov
2008-04-16 21:58 ` Scott Wood
2008-04-17 12:52 ` Anton Vorontsov
2008-04-17 14:19 ` Scott Wood
2008-04-17 15:07 ` Anton Vorontsov
2008-04-17 16:14 ` Scott Wood
2008-04-17 16:43 ` Anton Vorontsov
2008-04-17 14:23 ` Laurent Pinchart
2008-04-17 15:13 ` Anton Vorontsov
2008-04-17 16:12 ` Anton Vorontsov
2008-04-08 9:01 ` Laurent Pinchart
2008-04-08 11:48 ` Anton Vorontsov
2008-03-11 17:24 ` [PATCH 7/8] [POWERPC] qe_lib: add support for QE USB Anton Vorontsov
2008-04-14 20:29 ` Kumar Gala
2008-03-11 17:24 ` [PATCH 8/8] [POWERPC] qe_io: fix sparse warnings Anton Vorontsov
2008-04-14 15:12 ` Kumar Gala
2008-04-14 15:14 ` [PATCH 0/8] A bit of new code and sparse cleanups along the way Kumar Gala
2008-04-14 17:49 ` Anton Vorontsov
-- strict thread matches above, loose matches on Subject: below --
2008-04-17 16:22 [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support Scott Wood
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=47E02A8C.2080705@freescale.com \
--to=scottwood@freescale.com \
--cc=avorontsov@ru.mvista.com \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).