@@ -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);