From: Julien Grall Subject: [PATCH] xen/device-tree: Print the DT path on error in dt_for_each_range Date: Mon, 19 Oct 2015 13:58:00 +0100 Message-ID: <1445259480-16221-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZoA2B-0000bQ-34 for xen-devel@lists.xenproject.org; Mon, 19 Oct 2015 12:59:27 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Julien Grall , ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Julien Grall --- 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(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 87c3f71..0ed86a7 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -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 */ -- 2.1.4