From: "Oliver O'Halloran" <oohall@gmail.com>
To: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] platform/powernv: Avoid re-registration of imc debugfs directory
Date: Wed, 21 Aug 2019 16:08:35 +1000 [thread overview]
Message-ID: <CAOSf1CFPrhJoXYmV6E4rHZSSeFbYO3bYV7=r4v1x4Vwz19=0KA@mail.gmail.com> (raw)
In-Reply-To: <94672ed1-59fc-3a51-658d-364481418d8c@linux.vnet.ibm.com>
On Wed, Aug 21, 2019 at 3:37 PM Anju T Sudhakar <anju@linux.vnet.ibm.com> wrote:
>
> Hi,
>
> On 8/21/19 10:16 AM, Oliver O'Halloran wrote:
> > Is there a reason why we create the debugfs directory here and not in
> > opal_imc_counters_probe()? There's logic to remove the debugfs
> > directory in _probe() already so it seems like a more natural place to
> > it.
> >
> Good point. But we can only create the parent directory,
> i.e 'imc' directory in `_probe()` function and the entries can be
> created only here.
I know the entries can't be added in the probe function and I'm not
suggesting they should be.
> The reason is, this debugfs entries are only for
> IMC nest units. So, to get the imc mode and command values from
> the nest memory region we need the relevant offsets from the control
> block structure.
>
> Since imc_get_mem_addr_nest() function reads this address
> for each chip, we invoke the function to create the debugfs
> entries after this values are populated(i.e export_imc_mode_and_cmd() in
> invoked by imc_get_mem_addr_nest()).
>
> Also, if we create the parent directory in `_probe()` function,
> we need to track whether the entries(i.e imc_cmd and imc_mode) are
> created or not.
I think you should be tracking this anyway so you can do proper
cleanup if a debugfs entry can't be added. The current approach of
nuking the entire debugfs directory is pretty questionable.
> Regards,
>
> Anju
>
prev parent reply other threads:[~2019-08-21 6:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-21 4:09 [PATCH] platform/powernv: Avoid re-registration of imc debugfs directory Anju T Sudhakar
2019-08-21 4:46 ` Oliver O'Halloran
2019-08-21 5:37 ` Anju T Sudhakar
2019-08-21 6:08 ` Oliver O'Halloran [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='CAOSf1CFPrhJoXYmV6E4rHZSSeFbYO3bYV7=r4v1x4Vwz19=0KA@mail.gmail.com' \
--to=oohall@gmail.com \
--cc=anju@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.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).