Skip to contentSkip to conversation

xen/device-tree: Print the DT path on error in dt_for_each_range

PATCH In review Julien Grall 2 participants 2 messages Oct 19, 2015 – Oct 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/device-tree: Print the DT path on error in dt_for_each_range

With the current log is not possible for the user to understand properly the error:

(XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000 (XEN) DT: no ranges; cannot enumerate
(XEN) Device tree generation failed (-22).
(XEN)
(XEN) **************************************** (XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) **************************************** (XEN)

The other error message within the function already print the DT path. Do the same here.

---

This patch is a good candidate to backport in Xen 4.6. It helps the user to directly know which DT node may be invalid rather than having to add debug in Xen.

---
 xen/common/device_tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
xen/common/device_tree.c +2 -1
index 87c3f71..0ed86a7 100644
@@ -880,7 +880,8 @@ int dt_for_each_range(const struct dt_device_node *dev,
     ranges = dt_get_property(dev, "ranges", &rlen);
     if ( ranges == NULL )
     {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate\n");
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
         return -EINVAL;
     }
     if ( rlen == 0 ) /* Nothing to do */
Signature · 1 line
2.1.4
#1 lore raw
Quoted 13 lines · Julien Grall

With the current log is not possible for the user to understand properly the error:

(XEN) Grant table range: 0x0000007fc00000-0x0000007fc72000 (XEN) DT: no ranges; cannot enumerate
(XEN) Device tree generation failed (-22).
(XEN)
(XEN) **************************************** (XEN) Panic on CPU 0:
(XEN) Could not set up DOM0 guest OS
(XEN) **************************************** (XEN)

Quoted 4 lines

The other error message within the function already print the DT path. Do the same here.

Acked + applied.

Quoted 6 lines

---

This patch is a good candidate to backport in Xen 4.6. It helps the user to directly know which DT node may be invalid rather than having to add debug in Xen.

Queued.