From: Michael Bringmann <mwb@linux.vnet.ibm.com>
To: Nathan Fontenot <nfont@linux.vnet.ibm.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: RESEND [PATCH V3 3/4] hotplug/drc-info: Add code to search ibm,drc-info property
Date: Thu, 16 Nov 2017 12:33:22 -0600 [thread overview]
Message-ID: <bfe9de35-af0a-58a2-eb26-19d3e147e71b@linux.vnet.ibm.com> (raw)
In-Reply-To: <aa5e5ef6-3a28-0d52-93f6-48fcde133bf2@linux.vnet.ibm.com>
>> +
>> +static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name,
>> + char *drc_type, unsigned int my_index)
>> +{
>> + struct property *info;
>> + unsigned int entries;
>> + struct of_drc_info drc;
>> + void *value;
>
> This should be __be32 *
Okay.
>
>> + int j;
>> +
>> + info = of_find_property(dn->parent, "ibm,drc-info", NULL);
>> + if (info == NULL)
>> + return -EINVAL;
>> +
>> + value = info->value;
>> + value = (void *)of_prop_next_u32(info, value, &entries);
>> + if (!value)
>> + return -EINVAL;
>> +
>> + for (j = 0; j < entries; j++) {
>> + of_one_drc_info(&info, &value, &drc);
>> +
>> + /* Should now know end of current entry */
>> +
>> + WARN_ON((my_index < drc.drc_index_start) ||
>> + (((my_index-drc.drc_index_start)%
>> + drc.sequential_inc) != 0));
>> +
>> + if (my_index > drc.last_drc_index)
>> + continue;
>> +
>> + break;
>> + }
>> + /* Found it */
>> +
>> + if (((drc_name == NULL) ||
>> + (drc_name && !strncmp(drc_name,
>> + drc.drc_name_prefix,
>> + strlen(drc.drc_name_prefix)))) &&
>
> Shouldn't we be doing a string compare on the entire name, not just the prefix?
>
> If I remember correctly the prefix is the same for every cpu.
The prefix may be a value like "CPU", "MEM", "PHB", or other.
I modeled the comparisons using 'drc_name_prefix' after the comparison
of the 'name_tmp' found in the array 'ibm,drc-names' and 'type_tmp'
found in the array 'ibm,drc-types'. This is modeled in the new
function 'rpaphp_check_drc_props_v1' which was lifted from the original
function rpaphp_get_drc_props().
>
> -Nathan
>
--
Michael W. Bringmann
Linux Technology Center
IBM Corporation
Tie-Line 363-5196
External: (512) 286-5196
Cell: (512) 466-0650
mwb@linux.vnet.ibm.com
next prev parent reply other threads:[~2017-11-16 18:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-15 18:08 RESEND [PATCH V3 0/4] powerpc/devtree: Add support for 'ibm, drc-info' property Michael Bringmann
2017-11-15 18:09 ` RESEND [PATCH V3 1/4] powerpc/firmware: Add definitions for new drc-info firmware feature Michael Bringmann
2017-11-16 17:06 ` Nathan Fontenot
2017-11-16 17:37 ` Michael Bringmann
2017-11-15 18:09 ` RESEND [PATCH V3 2/4] pseries/drc-info: Search DRC properties for CPU indexes Michael Bringmann
2017-11-16 17:34 ` Nathan Fontenot
2017-11-16 17:43 ` Michael Bringmann
2017-11-15 18:09 ` RESEND [PATCH V3 3/4] hotplug/drc-info: Add code to search ibm,drc-info property Michael Bringmann
2017-11-16 17:50 ` Nathan Fontenot
2017-11-16 18:33 ` Michael Bringmann [this message]
2017-11-15 18:09 ` RESEND [PATCH V3 4/4] powerpc: Enable support for ibm,drc-info devtree property Michael Bringmann
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=bfe9de35-af0a-58a2-eb26-19d3e147e71b@linux.vnet.ibm.com \
--to=mwb@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nfont@linux.vnet.ibm.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).