diff mbox

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

Message ID 1479789528-15876-1-git-send-email-ppaidipe@linux.vnet.ibm.com
State Accepted
Headers show

Commit Message

ppaidipe Nov. 22, 2016, 4:38 a.m. UTC
Reference bug: https://github.com/open-power/op-build/issues/751

Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@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(-)

Comments

Stewart Smith Dec. 21, 2016, 5:55 a.m. UTC | #1
Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> writes:
> Reference bug: https://github.com/open-power/op-build/issues/751
>
> Signed-off-by: Pridhiviraj Paidipeddi <ppaidipe@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(-)
>

Thanks! merged to master (with slight tweak) as of 77be333
diff mbox

Patch

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;