From: Ralf Baechle <ralf@linux-mips.org>
To: John Crispin <john@phrozen.org>
Cc: linux-mips@linux-mips.org, Florian Fainelli <florian@openwrt.org>
Subject: Re: [PATCH] MIPS: add proper set_mode() to cevt-r4k
Date: Thu, 1 Aug 2013 16:13:58 +0200 [thread overview]
Message-ID: <20130801141358.GB3466@linux-mips.org> (raw)
In-Reply-To: <51F9FD16.4030706@phrozen.org>
On Thu, Aug 01, 2013 at 08:15:50AM +0200, John Crispin wrote:
> >Whatever works for you. I still would like to understand why plat_time_init()
> >is not suitable for John's specific use case.
>
> Hi Florian,
>
> the reason is that fixing it in plat_time_init() works around the
> real problem. the double request of the irq is a symptom of the
> actual problem, which is, that the cevt-r4k sets up the timer during
> init and not during setup. additionally, plat_time_init is used to
> probe the cevt drivers from OF already. currently the mips code just
> assumes that on a r4k we always have and want to run the cevt-r4k.
> this assumption is wrong and can quickly be fixed by making the
> cevt-r4k use the correct api.
>
> also fixing it this way allows the user to control the clocksource
> and change it at runtime via sysfs, a feature als not working
> currently on r4k as the cevt driver did not implement the set_mode()
> handler correctly. to be quite honest, i cannot think of a single
> way in which this can be fixed cleanly in the ralink
> plat_time_init() without using some weird heuristic. also if i fix
> this inside ralink plat_time_init() it is fixed only on ralink SoC
> and not on any other platform.
setup_irq() may fail but set_mode doesn't have a way to communicate an
error - other than leaving back a half-wrecked system so set_mode is not
a good place to do that kind of job.
How about using get_c0_compare_int() for a solution? Currently
get_c0_compare_int() can not return an error. If it could return a
negative value to indicate the unavailability of an interrupt for
cevt-r4k's use, that interrupt would be available for alternative use.
Ralf
next prev parent reply other threads:[~2013-08-01 14:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 9:55 [PATCH] MIPS: add proper set_mode() to cevt-r4k John Crispin
2013-07-29 10:40 ` Florian Fainelli
2013-07-29 10:52 ` John Crispin
2013-07-29 11:14 ` Florian Fainelli
2013-07-29 11:14 ` John Crispin
2013-07-30 10:01 ` Florian Fainelli
2013-07-31 19:22 ` David Daney
2013-07-31 19:26 ` Florian Fainelli
2013-08-01 6:15 ` John Crispin
2013-08-01 14:13 ` Ralf Baechle [this message]
2013-08-01 14:16 ` John Crispin
2013-07-29 14:53 ` Maciej W. Rozycki
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=20130801141358.GB3466@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=florian@openwrt.org \
--cc=john@phrozen.org \
--cc=linux-mips@linux-mips.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