summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorDavid E. Box <david.e.box@linux.intel.com>2014-09-17 22:13:51 -0700
committerIngo Molnar <mingo@kernel.org>2014-09-19 13:08:43 +0200
commited2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7 (patch)
tree8b5892beccf4c7985a914bf7c96742aebf3dbf22 /arch/x86/kernel
parentced3ce760b8df08e8bafba44f6b40407df2d0402 (diff)
downloadop-kernel-dev-ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7.zip
op-kernel-dev-ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7.tar.gz
x86/platform/intel/iosf: Add debugfs config option for IOSF
Makes the IOSF sideband available through debugfs. Allows developers to experiment with using the sideband to provide debug and analytical tools for units on the SoC. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Link: http://lkml.kernel.org/r/1411017231-20807-4-git-send-email-david.e.box@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/iosf_mbi.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/kernel/iosf_mbi.c b/arch/x86/kernel/iosf_mbi.c
index e01f741..82f8d02 100644
--- a/arch/x86/kernel/iosf_mbi.c
+++ b/arch/x86/kernel/iosf_mbi.c
@@ -190,7 +190,7 @@ bool iosf_mbi_available(void)
}
EXPORT_SYMBOL(iosf_mbi_available);
-/********************** debugfs begin ****************************/
+#ifdef CONFIG_IOSF_MBI_DEBUG
static u32 dbg_mdr;
static u32 dbg_mcr;
static u32 dbg_mcrx;
@@ -229,6 +229,7 @@ static int mcr_set(void *data, u64 val)
DEFINE_SIMPLE_ATTRIBUTE(iosf_mcr_fops, mcr_get, mcr_set , "%llx\n");
static struct dentry *iosf_dbg;
+
static void iosf_sideband_debug_init(void)
{
struct dentry *d;
@@ -257,7 +258,20 @@ static void iosf_sideband_debug_init(void)
cleanup:
debugfs_remove_recursive(d);
}
-/********************** debugfs end ****************************/
+
+static void iosf_debugfs_init(void)
+{
+ iosf_sideband_debug_init();
+}
+
+static void iosf_debugfs_remove(void)
+{
+ debugfs_remove_recursive(iosf_dbg);
+}
+#else
+static inline void iosf_debugfs_init(void) { }
+static inline void iosf_debugfs_remove(void) { }
+#endif /* CONFIG_IOSF_MBI_DEBUG */
static int iosf_mbi_probe(struct pci_dev *pdev,
const struct pci_device_id *unused)
@@ -290,13 +304,14 @@ static struct pci_driver iosf_mbi_pci_driver = {
static int __init iosf_mbi_init(void)
{
- iosf_sideband_debug_init();
+ iosf_debugfs_init();
+
return pci_register_driver(&iosf_mbi_pci_driver);
}
static void __exit iosf_mbi_exit(void)
{
- debugfs_remove_recursive(iosf_dbg);
+ iosf_debugfs_remove();
pci_unregister_driver(&iosf_mbi_pci_driver);
if (mbi_pdev) {
OpenPOWER on IntegriCloud