linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "tip-bot for David E. Box" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org,
	david.e.box@linux.intel.com, tglx@linutronix.de
Subject: [tip:x86/platform] x86/platform/intel/iosf: Add debugfs config option for IOSF
Date: Fri, 19 Sep 2014 04:49:54 -0700	[thread overview]
Message-ID: <tip-ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7@git.kernel.org> (raw)
In-Reply-To: <1411017231-20807-4-git-send-email-david.e.box@linux.intel.com>

Commit-ID:  ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7
Gitweb:     http://git.kernel.org/tip/ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7
Author:     David E. Box <david.e.box@linux.intel.com>
AuthorDate: Wed, 17 Sep 2014 22:13:51 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 19 Sep 2014 13:08:43 +0200

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>
---
 arch/x86/Kconfig           | 13 +++++++++++++
 arch/x86/kernel/iosf_mbi.c | 23 +++++++++++++++++++----
 2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index d6334f4..6354964 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -496,6 +496,19 @@ config IOSF_MBI
 
 	  You should say Y if you are running a kernel on one of these SoC's.
 
+config IOSF_MBI_DEBUG
+	bool "Enable IOSF sideband access through debugfs"
+	depends on IOSF_MBI && DEBUG_FS
+	---help---
+	  Select this option to expose the IOSF sideband access registers (MCR,
+	  MDR, MCRX) through debugfs to write and read register information from
+	  different units on the SoC. This is most useful for obtaining device
+	  state information for debug and analysis. As this is a general access
+	  mechanism, users of this option would have specific knowledge of the
+	  device they want to access.
+
+	  If you don't require the option or are in doubt, say N.
+
 config X86_RDC321X
 	bool "RDC R-321x SoC"
 	depends on X86_32
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) {

  reply	other threads:[~2014-09-19 11:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27 21:40 [PATCH 0/2] x86: iosf: change Kconfig selection and add debugfs David E. Box
2014-08-27 21:40 ` [PATCH 1/2] x86: iosf: Add Kconfig prompt for IOSF_MBI selection David E. Box
2014-09-02 21:07   ` [tip:x86/platform] x86/iosf: " tip-bot for David E. Box
2014-08-27 21:40 ` [PATCH 2/2] x86: iosf: Add debugfs support David E. Box
2014-08-27 22:20   ` H. Peter Anvin
2014-09-02 21:07   ` [tip:x86/platform] x86/iosf: " tip-bot for David E. Box
2014-09-17  3:26 ` [PATCH 0/3] x86: iosf: Additions to iosf patch set David E. Box
2014-09-18  5:13   ` [PATCH V2 " David E. Box
2014-09-18  5:13   ` [PATCH V2 1/3] x86: iosf: Add Braswell PCI ID David E. Box
2014-09-19 11:49     ` [tip:x86/platform] x86/platform/intel/iosf: " tip-bot for David E. Box
2014-09-18  5:13   ` [PATCH V2 2/3] x86: iosf: Add better description of IOSF driver in config David E. Box
2014-09-19 11:49     ` [tip:x86/platform] x86/platform/intel/iosf: " tip-bot for David E. Box
2014-09-18  5:13   ` [PATCH V2 3/3] x86: iosf: Add debugfs config option for iosf David E. Box
2014-09-19 11:49     ` tip-bot for David E. Box [this message]
2014-09-17  3:26 ` [PATCH 1/3] x86: iosf: Add Braswell PCI ID David E. Box
2014-09-17  3:26 ` [PATCH 2/3] x86: iosf: Move Kconfig to proper submenu David E. Box
2014-09-17 12:31   ` Ingo Molnar
2014-09-17  3:26 ` [PATCH 3/3] x86: iosf: Make debugfs addition a separate config option David E. Box
2014-09-17 12:26   ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-ed2226bd4d4a53bcc3b2ea0b1b28e955ebc15da7@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=david.e.box@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).