Commit 0755e855 authored by Cédric Le Goater's avatar Cédric Le Goater Committed by Michael Ellerman

powerpc/xive: Do not expose a debugfs file when XIVE is disabled

The XIVE interrupt mode can be disabled with the "xive=off" kernel
parameter, in which case there is nothing to present to the user in the
associated /sys/kernel/debug/powerpc/xive file.

Fixes: 930914b7 ("powerpc/xive: Add a debugfs file to dump internal XIVE state")
Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200429075122.1216388-4-clg@kaod.org
parent a101950f
...@@ -1664,7 +1664,8 @@ DEFINE_SHOW_ATTRIBUTE(xive_core_debug); ...@@ -1664,7 +1664,8 @@ DEFINE_SHOW_ATTRIBUTE(xive_core_debug);
int xive_core_debug_init(void) int xive_core_debug_init(void)
{ {
debugfs_create_file("xive", 0400, powerpc_debugfs_root, if (xive_enabled())
NULL, &xive_core_debug_fops); debugfs_create_file("xive", 0400, powerpc_debugfs_root,
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