From: Anju T Sudhakar <anju@linux.vnet.ibm.com>
To: mpe@ellerman.id.au
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
maddy@linux.vnet.ibm.com, hemant@linux.vnet.ibm.com,
anju@linux.vnet.ibm.com
Subject: [PATCH] powerpc/powernv: Add kernel cmdline parameter to disable imc
Date: Mon, 9 Oct 2017 12:16:37 +0530 [thread overview]
Message-ID: <1507531597-25947-1-git-send-email-anju@linux.vnet.ibm.com> (raw)
Add a kernel command line parameter option to disable In-Memory Collection
(IMC) counters and add documentation. This helps in debug.
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Reviewed-By: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
Documentation/admin-guide/kernel-parameters.txt | 7 +++++
arch/powerpc/platforms/powernv/opal-imc.c | 35 +++++++++++++++++++++++++
2 files changed, 42 insertions(+)
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0549662..06a8da1 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -820,6 +820,13 @@
disable_ipv6= [IPV6]
See Documentation/networking/ipv6.txt.
+ disable_imc= [PPC]
+ Format {nest | core | all}
+ Disable imc counters during boot.
+ nest----- Disable nest-imc counters.
+ core----- Disable core and thread imc counters.
+ all------ Disable nest, core and thread imc counters.
+
disable_mtrr_cleanup [X86]
The kernel tries to adjust MTRR layout from continuous
to discrete, to make X server driver able to add WB
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c
index 21f6531..e929f33 100644
--- a/arch/powerpc/platforms/powernv/opal-imc.c
+++ b/arch/powerpc/platforms/powernv/opal-imc.c
@@ -22,6 +22,28 @@
#include <asm/imc-pmu.h>
#include <asm/cputhreads.h>
+static bool disable_nest_imc;
+static bool disable_core_imc;
+
+/*
+ * diasble_imc=nest: skip the registration of nest pmus.
+ * disable_imc=core: skip the registration of core and thread pmus.
+ * disable_imc=all : disables nest, core and thread.
+ */
+static int __init disable_imc_counters(char *p)
+{
+ if (strncmp(p, "nest", 4) == 0)
+ disable_nest_imc = true;
+ else if (strncmp(p, "core", 4) == 0)
+ disable_core_imc = true;
+ else if (strncmp(p, "all", 3) == 0) {
+ disable_nest_imc = true;
+ disable_core_imc = true;
+ }
+ return 0;
+}
+early_param("disable_imc", disable_imc_counters);
+
/*
* imc_get_mem_addr_nest: Function to get nest counter memory region
* for each chip
@@ -169,6 +191,10 @@ static int opal_imc_counters_probe(struct platform_device *pdev)
return -ENODEV;
}
+ /* If kernel is booted with disable_imc parameters, then return */
+ if (disable_nest_imc && disable_core_imc)
+ return -ENODEV;
+
for_each_compatible_node(imc_dev, NULL, IMC_DTB_UNIT_COMPAT) {
if (of_property_read_u32(imc_dev, "type", &type)) {
pr_warn("IMC Device without type property\n");
@@ -177,12 +203,21 @@ static int opal_imc_counters_probe(struct platform_device *pdev)
switch (type) {
case IMC_TYPE_CHIP:
+ if (disable_nest_imc)
+ continue;
+
domain = IMC_DOMAIN_NEST;
break;
case IMC_TYPE_CORE:
+ if (disable_core_imc)
+ continue;
+
domain =IMC_DOMAIN_CORE;
break;
case IMC_TYPE_THREAD:
+ if (disable_core_imc)
+ continue;
+
domain = IMC_DOMAIN_THREAD;
break;
default:
--
2.7.4
next reply other threads:[~2017-10-09 6:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-09 6:46 Anju T Sudhakar [this message]
2017-10-10 9:02 ` [PATCH] powerpc/powernv: Add kernel cmdline parameter to disable imc Michael Ellerman
2017-10-10 20:25 ` Stewart Smith
2017-10-11 8:56 ` Anju T Sudhakar
2017-10-12 7:51 ` Stewart Smith
2017-10-12 8:05 ` Madhavan Srinivasan
2017-10-12 12:05 ` Michael Ellerman
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=1507531597-25947-1-git-send-email-anju@linux.vnet.ibm.com \
--to=anju@linux.vnet.ibm.com \
--cc=hemant@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.vnet.ibm.com \
--cc=mpe@ellerman.id.au \
/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).