-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Some sysfs objects of the dfl/intel-m10bmc driver can return -EINVAL when read.
In this case, reading the fpga_boot_page file results in -EINVAL if PMCI_CONFIGED bit of the PMCI CSR M10BMC_PMCI_FPGA_CONF_STS word is 0.
(i.e. the FPGA failed to be configured from FLASH, but is configured from JTAG.)
sysfs_node#value() method opens and reads the fpga_boot_page file.
It handles and raises IOError.
It does not handle OSError from -EINVAL.
opae-sdk/python/opae.admin/opae/admin/sysfs.py
Lines 151 to 171 in 5b22807
| @property | |
| def value(self): | |
| """value Read the value of a sysfs attribute | |
| Returns: The string returned (trimmed of whitespace) from reading the | |
| attribute. | |
| Raises: | |
| IOError: If an IOError is caught while attempting to open the path | |
| object represented by this node. | |
| Note: | |
| Attempting to get a value from a sysfs path that is a directory | |
| will result in an IOError being raised. | |
| """ | |
| try: | |
| with self._open('r') as fd: | |
| return fd.read().strip() | |
| except IOError as err: | |
| self.log.exception('error opening: %s - %s', self.sysfs_path, err) | |
| raise |
fpgasupdate calls sysfs_node#value() without handling OSError or IOError, so it crashes if the FPGA is configured from JTAG.
| LOG.debug ("Boot page value: %s\n", boot_page.value) |
To fix this, some error handling needs to be implemented, either in sysfs_node class or fpgasupdate.py.