Skip to content

Commit

Permalink
[Fix] Only clear AER errors when AER is available (#3073)
Browse files Browse the repository at this point in the history
When using the rsu --force option on systems without AER support
the clearing of correctable/uncorrectable errors fails and setpci
command returns exit code 1. Fix this by checking for AER support
before clearing errors.

Signed-off-by: Lars Munch <lmu@silicom.dk>
  • Loading branch information
lmu-silicom authored Jan 11, 2024
1 parent 4d757b6 commit 672e2ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/opae.admin/opae/admin/fpga.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,11 +666,17 @@ def clear_device_status(self, device):
call_process(f'{cmd}={output:08x}')

def clear_uncorrectable_errors(self, device):
if not device.supports_ecap('aer'):
self.log.debug(f'No AER support in device {device.pci_address}')
return
self.log.debug(f'Clearing uncorrectable errors for {device.pci_address}')
cmd = f'setpci -s {device.pci_address} ECAP_AER+0x04.L'
call_process(f'{cmd}=FFFFFFFF')

def clear_correctable_errors(self, device):
if not device.supports_ecap('aer'):
self.log.debug(f'No AER support in device {device.pci_address}')
return
self.log.debug(f'Clearing correctable errors for {device.pci_address}')
cmd = f'setpci -s {device.pci_address} ECAP_AER+0x10.L'
call_process(f'{cmd}=FFFFFFFF')
Expand Down

0 comments on commit 672e2ec

Please sign in to comment.