linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chen, Gong" <gong.chen@linux.intel.com>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: rdunlap@infradead.org, bp@alien8.de, tony.luck@intel.com,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RESEND 2/5] PCIe, AER: Replenish missed AER status bits for AER driver
Date: Tue, 9 Sep 2014 03:03:22 -0400	[thread overview]
Message-ID: <20140909070321.GA27821@gchen.bj.intel.com> (raw)
In-Reply-To: <20140905231543.GK8080@google.com>

[-- Attachment #1: Type: text/plain, Size: 3143 bytes --]

On Fri, Sep 05, 2014 at 05:15:43PM -0600, Bjorn Helgaas wrote:
> Date: Fri, 5 Sep 2014 17:15:43 -0600
> From: Bjorn Helgaas <bhelgaas@google.com>
> To: "Chen, Gong" <gong.chen@linux.intel.com>
> Cc: rdunlap@infradead.org, bp@alien8.de, tony.luck@intel.com,
>  linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
> Subject: Re: [RESEND 2/5] PCIe, AER: Replenish missed AER status bits for
>  AER driver
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> On Wed, Aug 13, 2014 at 02:22:38AM -0400, Chen, Gong wrote:
> > Since commit 6c2b374d is commited, the capability of PCI-e AER
> > has changed a lot. This patch adds all missed CE/UC error bits
> > existed in PCI-e SPEC r3.0. Meanwhile, adjust the code format
> > to make it simpler to read/maintain.
> > 
> > Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
> > ---
> >  drivers/pci/pcie/aer/aerdrv_errprint.c | 60 ++++++++++++++--------------------
> >  1 file changed, 25 insertions(+), 35 deletions(-)
> > 
> > diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c
> > index 35d06e177917..5c4f7e252e5e 100644
> > --- a/drivers/pci/pcie/aer/aerdrv_errprint.c
> > +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c
> > @@ -75,44 +75,34 @@ static const char *aer_error_layer[] = {
> >  };
> >  
> >  static const char *aer_correctable_error_string[] = {
> > -	"Receiver Error",		/* Bit Position 0	*/
> > -	NULL,
> > -	NULL,
> > -	NULL,
> > -	NULL,
> > -	NULL,
> > -	"Bad TLP",			/* Bit Position 6	*/
> > -	"Bad DLLP",			/* Bit Position 7	*/
> > -	"RELAY_NUM Rollover",		/* Bit Position 8	*/
> > -	NULL,
> > -	NULL,
> > -	NULL,
> > -	"Replay Timer Timeout",		/* Bit Position 12	*/
> > -	"Advisory Non-Fatal",		/* Bit Position 13	*/
> > +	[0] = "Receiver Error",
> > +	[6] = "Bad TLP",
> > +	[7] = "Bad DLLP",
> > +	[8] = "RELAY_NUM Rollover",
> > +	[12] = "Replay Timer Timeout",
> > +	[13] = "Advisory Non-Fatal Error",
> > +	[14] = "Corrected Internal Error",
> > +	[15] = "Header Log Overflow",
> 
> You replaced bare numbers with the existing #defines in the previous patch
> (thank you), but now we're adding them here.  I'm pretty sure you can use
> the #defines here, e.g.,
> 
>     [PCI_ERR_COR_RCVR] = "Receiver Error",
Considering PCI_ERR_COR_* stuff are not BIT offset, I need a conversion like
[ilog2(PCI_ERR_COR_RCVR)] = "xxx". But in ras_event.h I need the same
conversion like aer_correctable_error_string[ilog2(PCI_ERR_COR_RCVR)]. It looks
like a little bit clumsy and suboptimal. I can add extra BIT definition in
include/uapi/linux/pci_regs.h like below:

#define  PCI_ERR_COR_RCVR       0x00000001      /* Receiver Error Status */
+#define  PCI_ERR_COR_RCVR_BIT   ilog2(PCI_ERR_COR_RCVR)

or more direct way:
#define  PCI_ERR_COR_RCVR       0x00000001      /* Receiver Error Status */
+#define  PCI_ERR_COR_RCVR_BIT   0

I can't find better method by now.
> 
> In fact, it would be really nice if you could figure out a way to have only
> one set of these strings.  Right now, we have the set in
As above implied, I can export aer_correctable_error_string etc.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2014-09-09  7:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  6:22 [RESEND 0/5] PCIe, AER: Misc cleanup Chen, Gong
2014-08-13  6:22 ` [RESEND 1/5] RAS, trace: Update error definition format Chen, Gong
2014-08-13  6:22 ` [RESEND 2/5] PCIe, AER: Replenish missed AER status bits for AER driver Chen, Gong
2014-09-05 23:15   ` Bjorn Helgaas
2014-09-09  7:03     ` Chen, Gong [this message]
2014-09-25 15:51   ` Bjorn Helgaas
2014-08-13  6:22 ` [RESEND 3/5] PCIe, trace: Replenish missed AER status bits for PCIE trace I/F Chen, Gong
2014-08-13  6:22 ` [RESEND 4/5] PCIe, AER: Make AER UC status naming clearer Chen, Gong
2014-08-13  6:22 ` [RESEND RFC 5/5] PCIe, AER: Update initial value of UC error mask Chen, Gong
2014-09-05 23:34   ` Bjorn Helgaas
2014-09-09  7:12     ` Chen, Gong
2014-08-13 13:52 ` [RESEND 0/5] PCIe, AER: Misc cleanup Bjorn Helgaas
2014-08-14  1:52   ` Chen, Gong
2014-09-02  1:31     ` Chen, Gong
2014-09-25 15:54 ` Bjorn Helgaas

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=20140909070321.GA27821@gchen.bj.intel.com \
    --to=gong.chen@linux.intel.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=tony.luck@intel.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).