From: oliver <oohall@gmail.com>
To: Denis Kirjanov <kirjanov@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org,
Michael Neuling <mikey@neuling.org>,
Jack Miller <jack@codezen.org>
Subject: Re: [PATCHv4] powerpc/timer - large decrementer support
Date: Thu, 23 Jun 2016 18:21:23 +1000 [thread overview]
Message-ID: <CAOSf1CGEncYNgqi4gj0SK_v98mypcomgFgngbFjahSx3pnTccA@mail.gmail.com> (raw)
In-Reply-To: <CAHj3AV=V2s2ymM7Sg8TsmuqkopXmGjDceC0c=K1-_BuLQqPvEQ@mail.gmail.com>
On Thu, Jun 23, 2016 at 6:02 PM, Denis Kirjanov <kirjanov@gmail.com> wrote:
> On 6/23/16, Oliver O'Halloran <oohall@gmail.com> wrote:
>> +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);
>> +
>> + if (bits > 64 || bits < 32) {
>> + pr_warn("time_init: firmware supplied invalid ibm,dec-bits");
>> + bits = 32;
>> + }
>> +
>> +
>> + /* calculate the signed maximum given this many bits */
>> + decrementer_max = (1ul << (bits - 1)) - 1;
>> + }
>> +
>> + pr_info("time_init: %llu bit decrementer (max: %llx)\n",
>> + bits, decrementer_max);
>> +}
> the call to of_node_put(cpu) is missing in the function.
Well spotted, thanks.
prev parent reply other threads:[~2016-06-23 8:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 7:23 [PATCHv4] powerpc/timer - large decrementer support Oliver O'Halloran
2016-06-23 8:02 ` Denis Kirjanov
2016-06-23 8:21 ` oliver [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=CAOSf1CGEncYNgqi4gj0SK_v98mypcomgFgngbFjahSx3pnTccA@mail.gmail.com \
--to=oohall@gmail.com \
--cc=jack@codezen.org \
--cc=kirjanov@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.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).