Commit 412877df authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Michael Ellerman

powerpc/xive: Introduce xive_core_debugfs_create()

and fix some compile issues when !CONFIG_DEBUG_FS.
Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
[mpe: Add empty stub to fix !CONFIG_DEBUG_FS build]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211105102636.1016378-5-clg@kaod.org
parent 756c52c6
...@@ -227,6 +227,7 @@ static void xive_esb_write(struct xive_irq_data *xd, u32 offset, u64 data) ...@@ -227,6 +227,7 @@ static void xive_esb_write(struct xive_irq_data *xd, u32 offset, u64 data)
out_be64(xd->eoi_mmio + offset, data); out_be64(xd->eoi_mmio + offset, data);
} }
#if defined(CONFIG_XMON) || defined(CONFIG_DEBUG_FS)
static void xive_irq_data_dump(struct xive_irq_data *xd, char *buffer, size_t size) static void xive_irq_data_dump(struct xive_irq_data *xd, char *buffer, size_t size)
{ {
u64 val = xive_esb_read(xd, XIVE_ESB_GET); u64 val = xive_esb_read(xd, XIVE_ESB_GET);
...@@ -239,6 +240,7 @@ static void xive_irq_data_dump(struct xive_irq_data *xd, char *buffer, size_t si ...@@ -239,6 +240,7 @@ static void xive_irq_data_dump(struct xive_irq_data *xd, char *buffer, size_t si
val & XIVE_ESB_VAL_Q ? 'Q' : '-', val & XIVE_ESB_VAL_Q ? 'Q' : '-',
xd->trig_page, xd->eoi_page); xd->trig_page, xd->eoi_page);
} }
#endif
#ifdef CONFIG_XMON #ifdef CONFIG_XMON
static notrace void xive_dump_eq(const char *name, struct xive_q *q) static notrace void xive_dump_eq(const char *name, struct xive_q *q)
...@@ -1700,6 +1702,7 @@ static int __init xive_off(char *arg) ...@@ -1700,6 +1702,7 @@ static int __init xive_off(char *arg)
} }
__setup("xive=off", xive_off); __setup("xive=off", xive_off);
#ifdef CONFIG_DEBUG_FS
static void xive_debug_show_cpu(struct seq_file *m, int cpu) static void xive_debug_show_cpu(struct seq_file *m, int cpu)
{ {
struct xive_cpu *xc = per_cpu(xive_cpu, cpu); struct xive_cpu *xc = per_cpu(xive_cpu, cpu);
...@@ -1778,10 +1781,19 @@ static int xive_core_debug_show(struct seq_file *m, void *private) ...@@ -1778,10 +1781,19 @@ static int xive_core_debug_show(struct seq_file *m, void *private)
} }
DEFINE_SHOW_ATTRIBUTE(xive_core_debug); DEFINE_SHOW_ATTRIBUTE(xive_core_debug);
static void xive_core_debugfs_create(void)
{
debugfs_create_file("xive", 0400, arch_debugfs_dir,
NULL, &xive_core_debug_fops);
}
#else
static inline void xive_core_debugfs_create(void) { }
#endif /* CONFIG_DEBUG_FS */
int xive_core_debug_init(void) int xive_core_debug_init(void)
{ {
if (xive_enabled()) if (xive_enabled() && IS_ENABLED(CONFIG_DEBUG_FS))
debugfs_create_file("xive", 0400, arch_debugfs_dir, xive_core_debugfs_create();
NULL, &xive_core_debug_fops);
return 0; return 0;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment