diff mbox

[2/2] core/flash: Add fwts olog annotations

Message ID 1461756483-12111-3-git-send-email-jk@ozlabs.org
State Accepted
Headers show

Commit Message

Jeremy Kerr April 27, 2016, 11:28 a.m. UTC
This change adds a few fwts patterns to the flash code, mostly as an
example of the annotations we have.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
---
 core/flash.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox

Patch

diff --git a/core/flash.c b/core/flash.c
index 746db6f..734e0fa 100644
--- a/core/flash.c
+++ b/core/flash.c
@@ -161,6 +161,13 @@  static int flash_nvram_probe(struct flash *flash, struct ffs_handle *ffs)
 	rc = ffs_part_info(ffs, part, NULL,
 			   &start, &size, NULL, NULL);
 	if (rc) {
+		/**
+		 * @fwts-label NVRAMNoPartition
+		 * @fwts-advice OPAL could not find an NVRAM partition
+		 *     on the system flash. Check that the system flash
+		 *     has a valid partition table, and that the firmware
+		 *     build process has added a NVRAM partition.
+		 */
 		prlog(PR_ERR, "FLASH: Can't parse ffs info for NVRAM\n");
 		return OPAL_HARDWARE;
 	}
@@ -202,12 +209,25 @@  static void setup_system_flash(struct flash *flash, struct dt_node *node,
 	char *path;
 
 	if (system_flash) {
+		/**
+		 * @fwts-label SystemFlashDuplicate
+		 * @fwts-advice More than one flash device was registered
+		 *  as the system flash device. Check for duplicate calls
+		 *  to flash_register(..., true).
+		 */
 		prlog(PR_WARNING, "FLASH: attempted to register a second "
 				"system flash device %s\n", name);
 		return;
 	}
 
 	if (!ffs) {
+		/**
+		 * @fwts-label SystemFlashNoPartitionTable
+		 * @fwts-advice OPAL Could not read a partition table on
+		 *    system flash. Since we've still booted the machine (which
+		 *    requires flash), check that we're registering the proper
+		 *    system flash device.
+		 */
 		prlog(PR_WARNING, "FLASH: attempted to register system flash "
 				"%s, wwhich has no partition info\n", name);
 		return;