[Skiboot] [PATCH 06/14] i2c: Add FWTS annotations for I2c Errors

Stewart Smith stewart at linux.vnet.ibm.com
Mon Jun 27 15:32:04 AEST 2016


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 at linux.vnet.ibm.com>
---
 core/i2c.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/core/i2c.c b/core/i2c.c
index e0af9b2ae6e8..cf9dd6750db9 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;
 	}
-- 
2.1.4



More information about the Skiboot mailing list