[Skiboot] [PATCH V3] Add fwts annotation for duplicate DT node entries.

Pridhiviraj Paidipeddi ppaidipe at linux.vnet.ibm.com
Tue Nov 22 15:38:48 AEDT 2016


Reference bug: https://github.com/open-power/op-build/issues/751

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe at linux.vnet.ibm.com>
---
Changes from v2:
        - Moved the fwts annotation into the function dt_expand_node
          to make it clear that this is suitable for checking duplicate
          entries in FDT expansion path.

Changes from v1:
        - Replaced same node ID with duplicate node
        - Generalized fwts annotation description

 core/device.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/core/device.c b/core/device.c
index 63b5df8..a638543 100644
--- a/core/device.c
+++ b/core/device.c
@@ -799,7 +799,18 @@ int dt_expand_node(struct dt_node *node, const void *fdt, int fdt_node)
 			 * going for now, we may ultimately want to
 			 * assert
 			 */
-			(void)dt_attach_root(node, child);
+			if (!dt_attach_root(node, child))
+	                       /**
+	                         * @fwts-label DTHasDuplicateNodeID
+	                         * @fwts-advice OPAL will parse the Flatten Device Tree(FDT), which can generated
+	                         *     from different firmware sources. During expansion of FDT, OPAL observed
+	                         *     the duplicate node assigned multiple times. This means platform XML can
+	                         *     contain either duplicate node ID for same hardware device or for different
+	                         *     hardware devices. This is a bug in firmware component of platform xml,
+	                         *     due to which firmware/OPAL won't add the hardware device found with a
+	                         *     duplicate node ID into DT. And corresponding device is not functional.
+	                         */
+				prlog(PR_ERR, "DT: Found duplicate node: %s\n", child->name);
 			break;
 		case FDT_END:
 			return -1;
-- 
2.7.4



More information about the Skiboot mailing list