From: Michael Neuling <mikey@neuling.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Use 1TB segments
Date: Fri, 10 Aug 2007 13:53:08 +1000 [thread overview]
Message-ID: <32438.1186717988@neuling.org> (raw)
In-Reply-To: <18095.59959.698141.565343@cargo.ozlabs.ibm.com>
> +static int __init htab_dt_scan_seg_sizes(unsigned long node,
> + const char *uname, int depth,
> + void *data)
> +{
> + char *type = of_get_flat_dt_prop(node, "device_type", NULL);
> + u32 *prop;
> + unsigned long size = 0;
> +
> + /* We are scanning "cpu" nodes only */
> + if (type == NULL || strcmp(type, "cpu") != 0)
> + return 0;
> +
> + prop = (u32 *)of_get_flat_dt_prop(node, "ibm,processor-segment-sizes",
> + &size);
> + if (prop != NULL && size >= 8) {
> + if (prop[0] == 0x1c && prop[1] == 0x28) {
> + DBG("1T segment support detected\n");
> + cur_cpu_spec->cpu_features |= CPU_FTR_1T_SEGMENT;
> + }
Shouldn't this iterate through the property prop and _only_ look for a
0x28 entry rather than assuming the first two are going to be 0x1c and
0x28?
Something like:
prop = (u32 *)of_get_flat_dt_prop(node, "ibm,processor-segment-sizes",
&size);
if (prop != NULL)
for (i = 0; i < size/4; i++)
if (prop[1] == 0x28)
DBG("1T segment support detected\n");
cur_cpu_spec->cpu_features |=
CPU_FTR_1T_SEGMENT;
Mikey
next prev parent reply other threads:[~2007-08-10 3:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 2:04 [PATCH] Use 1TB segments Paul Mackerras
2007-08-02 20:41 ` Will Schmidt
2007-08-02 22:37 ` Benjamin Herrenschmidt
2007-08-02 23:56 ` Will Schmidt
2007-08-03 2:53 ` David Gibson
2007-08-06 22:23 ` Jon Tollefson
2007-08-10 3:53 ` Michael Neuling [this message]
2007-10-02 18:37 ` Will Schmidt
2007-10-03 2:11 ` Olof Johansson
2007-10-03 3:07 ` Paul Mackerras
2007-10-03 3:27 ` Olof Johansson
2007-10-03 3:13 ` Paul Mackerras
2007-10-03 14:22 ` Will Schmidt
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=32438.1186717988@neuling.org \
--to=mikey@neuling.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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).