Message ID | 20190628110848.28180-1-anju@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
Series | powerpc/imc: Dont create debugfs files for cpu-less nodes | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch next (c7d64b560ce80d8c44f082eee8352f0778a73195) |
snowpatch_ozlabs/build-ppc64le | success | Build succeeded |
snowpatch_ozlabs/build-ppc64be | success | Build succeeded |
snowpatch_ozlabs/build-ppc64e | success | Build succeeded |
snowpatch_ozlabs/build-pmac32 | success | Build succeeded |
snowpatch_ozlabs/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 28 lines checked |
diff --git a/arch/powerpc/platforms/powernv/opal-imc.c b/arch/powerpc/platforms/powernv/opal-imc.c index 186109bdd41b..12c8964a2f9c 100644 --- a/arch/powerpc/platforms/powernv/opal-imc.c +++ b/arch/powerpc/platforms/powernv/opal-imc.c @@ -13,6 +13,7 @@ #include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/crash_dump.h> +#include <linux/cpumask.h> #include <asm/opal.h> #include <asm/io.h> #include <asm/imc-pmu.h> @@ -56,6 +57,7 @@ static void export_imc_mode_and_cmd(struct device_node *node, int chip = 0, nid; char mode[16], cmd[16]; u32 cb_offset; + const struct cpumask *l_cpumask; imc_debugfs_parent = debugfs_create_dir("imc", powerpc_debugfs_root); @@ -70,6 +72,14 @@ static void export_imc_mode_and_cmd(struct device_node *node, cb_offset = IMC_CNTL_BLK_OFFSET; for_each_node(nid) { + /* + * Since these are related to nest pmu, + * create only if the node has any cpu in it. + */ + l_cpumask = cpumask_of_node(nid); + if (cpumask_empty(l_cpumask)) + continue; + loc = (u64)(pmu_ptr->mem_info[chip].vbase) + cb_offset; imc_mode_addr = (u64 *)(loc + IMC_CNTL_BLK_MODE_OFFSET); sprintf(mode, "imc_mode_%d", nid);