public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux•vnet.ibm.com>
To: Tyrel Datwyler <tyreld@linux•vnet.ibm.com>
Cc: Gavin Shan <gwshan@linux•vnet.ibm.com>,
	Russell Currey <ruscur@russell•cc>,
	linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH] powernv/pci: Add PHB register dump debugfs handle
Date: Tue, 26 Jul 2016 09:45:05 +1000	[thread overview]
Message-ID: <20160725234505.GA4217@gwshan> (raw)
In-Reply-To: <5796522D.9040601@linux.vnet.ibm.com>

On Mon, Jul 25, 2016 at 10:53:49AM -0700, Tyrel Datwyler wrote:
>On 07/21/2016 11:36 PM, Gavin Shan wrote:
>> On Fri, Jul 22, 2016 at 03:23:36PM +1000, Russell Currey wrote:
>>> On EEH events the kernel will print a dump of relevant registers.
>>> If EEH is unavailable (i.e. CONFIG_EEH is disabled, a new platform
>>> doesn't have EEH support, etc) this information isn't readily available.
>>>
>>> Add a new debugfs handler to trigger a PHB register dump, so that this
>>> information can be made available on demand.
>>>
>>> Signed-off-by: Russell Currey <ruscur@russell•cc>
>> 
>> Reviewed-by: Gavin Shan <gwshan@linux•vnet.ibm.com>
>> 
>>> ---
>>> arch/powerpc/platforms/powernv/pci-ioda.c | 35 +++++++++++++++++++++++++++++++
>>> 1 file changed, 35 insertions(+)
>>>
>>> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
>>> index 891fc4a..ada2f3c 100644
>>> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
>>> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
>>> @@ -3018,6 +3018,38 @@ static void pnv_ioda_setup_pe_seg(struct pnv_ioda_pe *pe)
>>> 	}
>>> }
>>>
>>> +#ifdef CONFIG_DEBUG_FS
>>> +static ssize_t pnv_pci_debug_write(struct file *filp,
>>> +				   const char __user *user_buf,
>>> +				   size_t count, loff_t *ppos)
>>> +{
>>> +	struct pci_controller *hose = filp->private_data;
>>> +	struct pnv_phb *phb;
>>> +	int ret = 0;
>> 
>> Needn't initialize @ret in advance. The code might be simpler, but it's
>> only a personal preference:
>
>I believe its actually preferred that it not be initialized in advance
>so that the tooling can warn you about conditional code paths where you
>may have forgotten to set a value. Or as Gavin suggests to explicitly
>use error values in the return statements.
>

Yeah, the data type should be int64_t as well.

Thanks,
Gavin

  reply	other threads:[~2016-07-25 23:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22  5:23 [PATCH] powernv/pci: Add PHB register dump debugfs handle Russell Currey
2016-07-22  6:36 ` Gavin Shan
2016-07-25 17:53   ` Tyrel Datwyler
2016-07-25 23:45     ` Gavin Shan [this message]
2016-07-26  1:06     ` Michael Ellerman
2016-07-26  0:37   ` Russell Currey
2016-07-26  1:45 ` Michael Ellerman
2016-07-26  5:37   ` Russell Currey
2016-07-26  9:47     ` Michael Ellerman

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=20160725234505.GA4217@gwshan \
    --to=gwshan@linux$(echo .)vnet.ibm.com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=ruscur@russell$(echo .)cc \
    --cc=tyreld@linux$(echo .)vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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