diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-06-24 13:59:10 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2016-06-24 15:50:13 +1000 |
commit | e5b3277fdaae21234195a7dea6e1e2ecf028d0c3 (patch) | |
tree | 0fee493ace235247e06257fdb81bc78dad50185e /core/i2c.c | |
parent | 577703889991dbbcc875b6a64e8dd0f9a579e3e1 (diff) | |
download | talos-skiboot-e5b3277fdaae21234195a7dea6e1e2ecf028d0c3.tar.gz talos-skiboot-e5b3277fdaae21234195a7dea6e1e2ecf028d0c3.zip |
i2c: Add FWTS annotations for I2c Errors
Two possible error states: kernel asks us for something incorrect,
OPAL runs out of memory... both of which require investigation.
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/i2c.c')
-rw-r--r-- | core/i2c.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -64,12 +64,25 @@ static int opal_i2c_request(uint64_t async_token, uint32_t bus_id, bus = i2c_find_bus_by_id(bus_id); if (!bus) { + /** + * @fwts-label I2CInvalidBusID + * @fwts-advice opal_i2c_request was passed an invalid bus + * ID. This has likely come from the OS rather than OPAL + * and thus could indicate an OS bug rather than an OPAL + * bug. + */ prlog(PR_ERR, "I2C: Invalid 'bus_id' passed to the OPAL\n"); return OPAL_PARAMETER; } req = i2c_alloc_req(bus); if (!req) { + /** + * @fwts-label I2CFailedAllocation + * @fwts-advice OPAL failed to allocate memory for an + * i2c_request. This points to an OPAL bug as OPAL ran + * out of memory and this should never happen. + */ prlog(PR_ERR, "I2C: Failed to allocate 'i2c_request'\n"); return OPAL_NO_MEM; } |