summaryrefslogtreecommitdiffstats
path: root/core/i2c.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2016-06-24 13:59:10 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-06-24 15:50:13 +1000
commite5b3277fdaae21234195a7dea6e1e2ecf028d0c3 (patch)
tree0fee493ace235247e06257fdb81bc78dad50185e /core/i2c.c
parent577703889991dbbcc875b6a64e8dd0f9a579e3e1 (diff)
downloadtalos-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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/i2c.c b/core/i2c.c
index e0af9b2a..cf9dd675 100644
--- a/core/i2c.c
+++ b/core/i2c.c
@@ -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;
}
OpenPOWER on IntegriCloud