linux/drivers/pci/pcie
Hidetoshi Seto f158575696 PCI: pcie, aer: rework MASK macros in aerdrv_errprint.c
Definitions of MASK macros in aerdrv_errprint.c are tricky and unsafe.

For example, AER_AGENT_TRANSMITTER_MASK(_sev, _stat) does work like:
  static inline func(int _sev, int _stat)
  {
    if (_sev == AER_CORRECTABLE)
      return (_stat & (PCI_ERR_COR_REP_ROLL|PCI_ERR_COR_REP_TIMER));
    else
      return (_stat & PCI_ERR_COR_REP_ROLL);
  }
In case of else path here, for uncorrectable errors, testing bits in
_stat by PCI_ERR_COR_* does not make sense because _stat should have only
PCI_ERR_UNC_* bits originated in uncorrectable error status register.
But at this time this is safe because uncorrectable error using bit
position same to PCI_ERR_COR_REP_ROLL(= bit position 8) is not defined.
Likewise, AER_AGENT_COMPLETER_MASK is always PCI_ERR_UNC_COMP_ABORT but
it works because bit 15 of correctable error status is not defined.

It means that these MASK macros will turn to be wrong once if new error
is defined. (In fact, bit 15 of correctable is now defined in PCIe 2.1)

This patch changes these MASK macros to be more strict, not to return
PCI_ERR_COR_* bits for uncorrectable error status and vise versa.

Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Reviewed-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2009-09-09 13:47:16 -07:00
..
aer PCI: pcie, aer: rework MASK macros in aerdrv_errprint.c 2009-09-09 13:47:16 -07:00
aspm.c PCI ASPM: support per direction l0s management 2009-09-09 13:29:49 -07:00
Kconfig PCI Express ASPM support should default to 'No' 2008-04-23 15:41:14 -07:00
Makefile PCI: add PCI Express ASPM support 2008-04-20 21:47:03 -07:00
portdrv_bus.c PCI: PCIe portdrv: Remove struct pcie_port_service_id 2009-03-19 19:29:23 -07:00
portdrv_core.c PCIE: remove driver_data direct access of struct device 2009-06-11 12:04:04 -07:00
portdrv_pci.c PCI: Fix pci-e port driver slot_reset bad default return value 2009-05-05 12:20:57 -07:00
portdrv.h PCI: PCIe portdrv: Implement pm object 2009-03-20 10:47:49 -07:00