From: maddy <maddy@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Qian Cai <cai@lca.pw>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc/imc: Dont create debugfs files for cpu-less nodes
Date: Mon, 15 Jul 2019 11:52:17 +0530 [thread overview]
Message-ID: <cfb89a0b-8f70-8a19-2b14-c93d46b2b900@linux.vnet.ibm.com> (raw)
In-Reply-To: <87d0ihgojp.fsf@concordia.ellerman.id.au>
On 7/11/19 10:23 AM, Michael Ellerman wrote:
> Hi Maddy,
>
> Madhavan Srinivasan <maddy@linux.vnet.ibm.com> writes:
>> diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
>> index 186109bdd41b..e04b20625cb9 100644
>> --- a/arch/powerpc/platforms/powernv/opal-imc.c
>> +++ b/arch/powerpc/platforms/powernv/opal-imc.c
>> @@ -69,20 +69,20 @@ static void export_imc_mode_and_cmd(struct device_node *node,
>> if (of_property_read_u32(node, "cb_offset", &cb_offset))
>> cb_offset = IMC_CNTL_BLK_OFFSET;
>>
>> - for_each_node(nid) {
>> - loc = (u64)(pmu_ptr->mem_info[chip].vbase) + cb_offset;
>> + while (ptr->vbase != NULL) {
> This means you'll bail out as soon as you find a node with no vbase, but
> it's possible we could have a CPU-less node intermingled with other
> nodes.
Nice catch. Thanks for the review, will fix it.
Maddy
>
> So I think you want to keep the for loop, but continue if you see a NULL
> vbase?
>
>
>> + loc = (u64)(ptr->vbase) + cb_offset;
>> imc_mode_addr = (u64 *)(loc + IMC_CNTL_BLK_MODE_OFFSET);
>> - sprintf(mode, "imc_mode_%d", nid);
>> + sprintf(mode, "imc_mode_%d", (u32)(ptr->id));
>> if (!imc_debugfs_create_x64(mode, 0600, imc_debugfs_parent,
>> imc_mode_addr))
>> goto err;
>>
>> imc_cmd_addr = (u64 *)(loc + IMC_CNTL_BLK_CMD_OFFSET);
>> - sprintf(cmd, "imc_cmd_%d", nid);
>> + sprintf(cmd, "imc_cmd_%d", (u32)(ptr->id));
>> if (!imc_debugfs_create_x64(cmd, 0600, imc_debugfs_parent,
>> imc_cmd_addr))
>> goto err;
>> - chip++;
>> + ptr++;
>> }
>> return;
> cheers
>
next prev parent reply other threads:[~2019-07-15 6:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 9:21 [PATCH v2] powerpc/imc: Dont create debugfs files for cpu-less nodes Madhavan Srinivasan
2019-07-11 4:53 ` Michael Ellerman
2019-07-15 6:22 ` maddy [this message]
2019-07-15 18:41 ` Qian Cai
2019-07-23 11:27 ` Anju T Sudhakar
2019-07-29 12:36 ` Michael Ellerman
2019-10-30 18:37 ` Qian Cai
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=cfb89a0b-8f70-8a19-2b14-c93d46b2b900@linux.vnet.ibm.com \
--to=maddy@linux.vnet.ibm.com \
--cc=cai@lca.pw \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).