powerpc/powernv: Refactor PHB diag-data dump
authorGavin Shan <shangw@linux.vnet.ibm.com>
Tue, 25 Feb 2014 07:28:38 +0000 (15:28 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 28 Feb 2014 07:43:19 +0000 (18:43 +1100)
commitaf87d2fe95444d107e0c0cf0ba7e20e6716a7bfd
tree26a31e82f783a7125c5b506c0fb801f54299b9b8
parent947166043732b69878123bf31f51933ad0316080
powerpc/powernv: Refactor PHB diag-data dump

As Ben suggested, the patch prints PHB diag-data with multiple
fields in one line and omits the line if the fields of that
line are all zero.

With the patch applied, the PHB3 diag-data dump looks like:

PHB3 PHB#3 Diag-data (Version: 1)

  brdgCtl:     00000002
  RootSts:     0000000f 00400000 b0830008 00100147 00002000
  nFir:        0000000000000000 0030006e00000000 0000000000000000
  PhbSts:      0000001c00000000 0000000000000000
  Lem:         0000000000100000 42498e327f502eae 0000000000000000
  InAErr:      8000000000000000 8000000000000000 0402030000000000 0000000000000000
  PE[  8] A/B: 8480002b00000000 8000000000000000

[ The current diag data is so big that it overflows the printk
  buffer pretty quickly in cases when we get a handful of errors
  at once which can happen. --BenH
]

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
CC: <stable@vger.kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/powernv/pci.c