@@ -64,7 +64,7 @@ struct xive_ops {
bool xive_core_init(const struct xive_ops *ops, void __iomem *area, u32 offset,
u8 max_prio);
__be32 *xive_queue_page_alloc(unsigned int cpu, u32 queue_shift);
-int xive_core_debug_init(void);
+struct dentry *xive_core_debugfs_create(void);
static inline u32 xive_alloc_order(u32 queue_shift)
{
@@ -1681,11 +1681,3 @@ struct dentry *xive_core_debugfs_create(void)
return xive_debug_dir;
}
-
-int xive_core_debug_init(void)
-{
- if (xive_enabled())
- xive_core_debugfs_create();
-
- return 0;
-}
@@ -548,6 +548,8 @@ EXPORT_SYMBOL_GPL(xive_native_default_eq_shift);
unsigned long xive_tima_os;
EXPORT_SYMBOL_GPL(xive_tima_os);
+static struct device_node *xive_native_node;
+
bool __init xive_native_init(void)
{
struct device_node *np;
@@ -628,6 +630,8 @@ bool __init xive_native_init(void)
return false;
}
pr_info("Using %dkB queues\n", 1 << (xive_queue_shift - 10));
+
+ xive_native_node = np;
return true;
}
@@ -854,4 +858,21 @@ int xive_native_get_vp_state(u32 vp_id, u64 *out_state)
}
EXPORT_SYMBOL_GPL(xive_native_get_vp_state);
-machine_arch_initcall(powernv, xive_core_debug_init);
+static int xive_native_debug_init(void)
+{
+ if (xive_enabled() && IS_ENABLED(CONFIG_DEBUG_FS)) {
+ struct device_node *child;
+ struct dentry *xive_dir;
+ struct dentry *xive_debug_dir;
+
+ xive_dir = xive_core_debugfs_create();
+ xive_debug_dir = debugfs_create_dir("debug", xive_dir);
+
+ for_each_child_of_node(xive_native_node, child)
+ if (of_device_is_compatible(child, "ibm,opal-debug"))
+ opal_debug_create(child, xive_debug_dir);
+ }
+ return 0;
+}
+
+machine_arch_initcall(powernv, xive_native_debug_init);
@@ -864,4 +864,11 @@ bool __init xive_spapr_init(void)
return true;
}
-machine_arch_initcall(pseries, xive_core_debug_init);
+static int xive_spapr_debug_init(void)
+{
+ if (xive_enabled() && IS_ENABLED(CONFIG_DEBUG_FS))
+ xive_core_debugfs_create();
+ return 0;
+}
+
+machine_arch_initcall(pseries, xive_spapr_debug_init);
Signed-off-by: Cédric Le Goater <clg@kaod.org> --- arch/powerpc/sysdev/xive/xive-internal.h | 2 +- arch/powerpc/sysdev/xive/common.c | 8 -------- arch/powerpc/sysdev/xive/native.c | 23 ++++++++++++++++++++++- arch/powerpc/sysdev/xive/spapr.c | 9 ++++++++- 4 files changed, 31 insertions(+), 11 deletions(-)