PCI: unconditionally clear AER uncorr status register during cleanup
commit1ebf19e8a1402842dcd2f34a4032922170de4218
authorAndrew Patterson <andrew.patterson@hp.com>
Thu, 3 Dec 2009 17:28:20 +0000 (3 10:28 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:58:12 +0000 (1 15:58 -0700)
treee5827b5ad6d2eb373d08bce33ebf9d9e30232105
parent80736c50f92cc545fe190d5ca47ca04fd3eca860
PCI: unconditionally clear AER uncorr status register during cleanup

commit 6cdfd995a65a52e05b99e3a72a9b979abe73b312 upstream.

The current implementation of pci_cleanup_aer_uncorrect_error_status
only clears either fatal or non-fatal error status bits depending
on the state of the I/O channel. This implementation will then often
leave some bits set after PCI error recovery completes.  The uncleared bit
settings will then be falsely reported the next time an AER interrupt is
generated for that hierarchy. An easy way to illustrate this issue is to
use the aer-inject module to simultaneously inject both an uncorrectable
non-fatal and uncorrectable fatal error.  One of the errors will not be
cleared.

This patch resolves this issue by unconditionally clearing all bits in
the AER uncorrectable status register. All settings and corrective action
strategies are saved and determined before
pci_cleanup_aer_uncorrect_error_status is called, so this change should not
affect errory handling functionality.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Alex Chiang <achiang@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/pcie/aer/aerdrv_core.c