]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
powerpc/xive: Do not expose a debugfs file when XIVE is disabled
authorCédric Le Goater <clg@kaod.org>
Wed, 29 Apr 2020 07:51:22 +0000 (09:51 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 28 May 2020 13:24:32 +0000 (23:24 +1000)
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: 930914b7d528 ("powerpc/xive: Add a debugfs file to dump internal XIVE state")
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200429075122.1216388-4-clg@kaod.org
arch/powerpc/sysdev/xive/common.c

index 3dbc94cb43808f04ea482b8b688bebb2e5dbe375..f591be9f01f4efb77043719e8a97e2ce2fbb39d0 100644 (file)
@@ -1664,7 +1664,8 @@ DEFINE_SHOW_ATTRIBUTE(xive_core_debug);
 
 int xive_core_debug_init(void)
 {
-       debugfs_create_file("xive", 0400, powerpc_debugfs_root,
-                           NULL, &xive_core_debug_fops);
+       if (xive_enabled())
+               debugfs_create_file("xive", 0400, powerpc_debugfs_root,
+                                   NULL, &xive_core_debug_fops);
        return 0;
 }