From: Michael Ellerman <mpe@ellerman.id.au>
To: Oliver O'Halloran <oohall@gmail.com>, linuxppc-dev@lists.ozlabs.org
Cc: Oliver O'Halloran <oohall@gmail.com>,
Michael Neuling <mikey@neuling.org>,
Jack Miller <jack@codezen.org>
Subject: Re: [v5] powerpc/timer - large decrementer support
Date: Tue, 28 Jun 2016 14:19:55 +1000 (AEST) [thread overview]
Message-ID: <3rdsyz3N1hz9sCp@ozlabs.org> (raw)
In-Reply-To: <1466729755-18618-1-git-send-email-oohall@gmail.com>
On Fri, 2016-24-06 at 00:55:55 UTC, Oliver O'Halloran wrote:
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index 7a482a7f4d8d..efebe52133ef 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -893,6 +894,86 @@ static void register_decrementer_clockevent(int cpu)
...
> +static void __init set_decrementer_max(void)
> +{
> + struct device_node *cpu;
> + const __be32 *fp;
> + u64 bits = 32;
> +
> + /* Prior to ISAv3 the decrementer is always 32 bit */
> + if (!cpu_has_feature(CPU_FTR_ARCH_300))
> + return;
> +
> + cpu = of_find_node_by_type(NULL, "cpu");
> + if (cpu)
> + fp = of_get_property(cpu, "ibm,dec-bits", NULL);
> +
> + if (cpu && fp) {
> + bits = of_read_number(fp, 1);
Sorry I didn't catch it earlier, but I prefer of_property_read_u32().
You should be able to do:
cpu = of_find_node_by_type(NULL, "cpu");
if (of_property_read_u32(cpu, "ibm,dec-bits", &bits) == 0) {
...
}
cheers
prev parent reply other threads:[~2016-06-28 4:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-24 0:55 [PATCH v5] powerpc/timer - large decrementer support Oliver O'Halloran
2016-06-28 4:19 ` Michael Ellerman [this message]
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=3rdsyz3N1hz9sCp@ozlabs.org \
--to=mpe@ellerman.id.au \
--cc=jack@codezen.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.org \
--cc=oohall@gmail.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;
as well as URLs for NNTP newsgroup(s).