Skip to contentSkip to conversation

platform/x86: intel_pmc_core: Add bug fixes or code

PATCH Superseded Gayatri Kammela 3 participants 15 messages Mar 1, 2020 – Mar 20, 2020 x86 platform drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover platform/x86: intel_pmc_core: Add bug fixes or code

Hi,

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

Patch 1: Relocate both pmc_core_slps0_display() and pmc_core_lpm_display() Patch 2: Remove the duplicate if() condition to create debugfs entry Patch 3: Add back slp_s0_offset attribute back to tgl_reg_map Patch 4: Make pmc_core_substate_res_show() generic
Patch 5: Make pmc_core_lpm_display() generic

Changes since v1:
1) Changed the order of the patches i.e., patch 2 in v1 is made first in the order for v2.
2) Fixed the warnings reported by kbuild test robot.

Changes since v2:
1) Add "Make pmc_core_substate_res_show() generic" patch to v3.
2) Fixed the memory leak issue in pmc_core_lpm_display().
3) Moved patch 2 in v2 to the last in the series in v3.

Gayatri Kammela (5):
platform/x86: intel_pmc_core: fix: Relocate pmc_core_slps0_display()
and pmc_core_lpm_display() to outside of CONFIG_DEBUG_FS
platform/x86: intel_pmc_core: fix: Remove the duplicate if() to create
debugfs entry for substate_live_status_registers
platform/x86: intel_pmc_core: fix: Add slp_s0_offset attribute back to
tgl_reg_map
platform/x86: intel_pmc_core: Make pmc_core_substate_res_show()
generic
platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic
for platforms that support sub-states

 drivers/platform/x86/intel_pmc_core.c | 148 +++++++++++++++-----------
 drivers/platform/x86/intel_pmc_core.h |   3 +-
 2 files changed, 85 insertions(+), 66 deletions(-)

base-commit: 7adb1e8aeeb5d4d88012568b2049599c1a247cf2

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David Box <[email protected]>
Signature · 1 line
2.17.1
#1 lore raw

PATCH v3 1/5 platform/x86: intel_pmc_core: fix: Relocate pmc_core_slps0_display() and pmc_core_lpm_display() to outside of CONFIG_DEBUG_FS

Since pmc_core_slps0_display() and pmc_core_lpm_display() is responsible for dumping as well as displaying debug registers, there is no need for these two functions to be defined under CONFIG_DEBUG_FS.

Hence, relocate these functions from under CONFIG_DEBUG_FS to above the block.

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David E. Box <[email protected]>
---
 drivers/platform/x86/intel_pmc_core.c | 122 +++++++++++++-------------
 1 file changed, 61 insertions(+), 61 deletions(-)
drivers/platform/x86/intel_pmc_core.c +61 -61
index f4a36fbabf4c..20b2f49726cf 100644
@@ -612,6 +612,67 @@ static int pmc_core_check_read_lock_bit(void)
 	return value & BIT(pmcdev->map->pm_read_disable_bit);
 }
 
+static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,
+				   struct seq_file *s)
+{
+	const struct pmc_bit_map **maps = pmcdev->map->slps0_dbg_maps;
+	const struct pmc_bit_map *map;
+	int offset = pmcdev->map->slps0_dbg_offset;
+	u32 data;
+
+	while (*maps) {
+		map = *maps;
+		data = pmc_core_reg_read(pmcdev, offset);
+		offset += 4;
+		while (map->name) {
+			if (dev)
+				dev_dbg(dev, "SLP_S0_DBG: %-32s\tState: %s\n",
+					map->name,
+					data & map->bit_mask ? "Yes" : "No");
+			if (s)
+				seq_printf(s, "SLP_S0_DBG: %-32s\tState: %s\n",
+					   map->name,
+					   data & map->bit_mask ? "Yes" : "No");
+			++map;
+		}
+		++maps;
+	}
+}
+
+static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
+				 struct seq_file *s, u32 offset,
+				 const char *str,
+				 const struct pmc_bit_map **maps)
+{
+	u32 lpm_regs[ARRAY_SIZE(tgl_lpm_maps)-1];
+	int index, idx, len = 32, bit_mask;
+
+	for (index = 0; tgl_lpm_maps[index]; index++) {
+		lpm_regs[index] = pmc_core_reg_read(pmcdev, offset);
+		offset += 4;
+	}
+
+	for (idx = 0; maps[idx]; idx++) {
+		if (dev)
+			dev_dbg(dev, "\nLPM_%s_%d:\t0x%x\n", str, idx,
+				lpm_regs[idx]);
+		if (s)
+			seq_printf(s, "\nLPM_%s_%d:\t0x%x\n", str, idx,
+				   lpm_regs[idx]);
+		for (index = 0; maps[idx][index].name && index < len; index++) {
+			bit_mask = maps[idx][index].bit_mask;
+			if (dev)
+				dev_dbg(dev, "%-30s %-30d\n",
+					maps[idx][index].name,
+					lpm_regs[idx] & bit_mask ? 1 : 0);
+			if (s)
+				seq_printf(s, "%-30s %-30d\n",
+					   maps[idx][index].name,
+					   lpm_regs[idx] & bit_mask ? 1 : 0);
+		}
+	}
+}
+
 #if IS_ENABLED(CONFIG_DEBUG_FS)
 static bool slps0_dbg_latch;
 
@@ -844,33 +905,6 @@ static void pmc_core_slps0_dbg_latch(struct pmc_dev *pmcdev, bool reset)
 	mutex_unlock(&pmcdev->lock);
 }
 
-static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,
-				   struct seq_file *s)
-{
-	const struct pmc_bit_map **maps = pmcdev->map->slps0_dbg_maps;
-	const struct pmc_bit_map *map;
-	int offset = pmcdev->map->slps0_dbg_offset;
-	u32 data;
-
-	while (*maps) {
-		map = *maps;
-		data = pmc_core_reg_read(pmcdev, offset);
-		offset += 4;
-		while (map->name) {
-			if (dev)
-				dev_dbg(dev, "SLP_S0_DBG: %-32s\tState: %s\n",
-					map->name,
-					data & map->bit_mask ? "Yes" : "No");
-			if (s)
-				seq_printf(s, "SLP_S0_DBG: %-32s\tState: %s\n",
-					   map->name,
-					   data & map->bit_mask ? "Yes" : "No");
-			++map;
-		}
-		++maps;
-	}
-}
-
 static int pmc_core_slps0_dbg_show(struct seq_file *s, void *unused)
 {
 	struct pmc_dev *pmcdev = s->private;
@@ -974,40 +1008,6 @@ static int pmc_core_substate_res_show(struct seq_file *s, void *unused)
 }
 DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_res);
 
-static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
-				 struct seq_file *s, u32 offset,
-				 const char *str,
-				 const struct pmc_bit_map **maps)
-{
-	u32 lpm_regs[ARRAY_SIZE(tgl_lpm_maps)-1];
-	int index, idx, len = 32, bit_mask;
-
-	for (index = 0; tgl_lpm_maps[index]; index++) {
-		lpm_regs[index] = pmc_core_reg_read(pmcdev, offset);
-		offset += 4;
-	}
-
-	for (idx = 0; maps[idx]; idx++) {
-		if (dev)
-			dev_dbg(dev, "\nLPM_%s_%d:\t0x%x\n", str, idx,
-				lpm_regs[idx]);
-		if (s)
-			seq_printf(s, "\nLPM_%s_%d:\t0x%x\n", str, idx,
-				   lpm_regs[idx]);
-		for (index = 0; maps[idx][index].name && index < len; index++) {
-			bit_mask = maps[idx][index].bit_mask;
-			if (dev)
-				dev_dbg(dev, "%-30s %-30d\n",
-					maps[idx][index].name,
-					lpm_regs[idx] & bit_mask ? 1 : 0);
-			if (s)
-				seq_printf(s, "%-30s %-30d\n",
-					   maps[idx][index].name,
-					   lpm_regs[idx] & bit_mask ? 1 : 0);
-		}
-	}
-}
-
 static int pmc_core_substate_sts_regs_show(struct seq_file *s, void *unused)
 {
 	struct pmc_dev *pmcdev = s->private;
Signature · 1 line
2.17.1
#2 lore raw

PATCH v3 2/5 platform/x86: intel_pmc_core: fix: Remove the duplicate if() to create debugfs entry for substate_live_status_registers

In reply to Gayatri Kammela

A debugfs entry for substate_live_status_registers is created only if the platform has sub-states, which requires the same condition to create substate_status_registers debugfs entry. Hence remove the redundant condition and re-use the exisiting one.

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David E. Box <[email protected]>
---
 drivers/platform/x86/intel_pmc_core.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/platform/x86/intel_pmc_core.c +0 -3
index 20b2f49726cf..a36051c2a18c 100644
@@ -1108,9 +1108,6 @@ static void pmc_core_dbgfs_register(struct pmc_dev *pmcdev)
 		debugfs_create_file("substate_status_registers", 0444,
 				    pmcdev->dbgfs_dir, pmcdev,
 				    &pmc_core_substate_sts_regs_fops);
-	}
-
-	if (pmcdev->map->lpm_status_offset) {
 		debugfs_create_file("substate_live_status_registers", 0444,
 				    pmcdev->dbgfs_dir, pmcdev,
 				    &pmc_core_substate_l_sts_regs_fops);
Signature · 1 line
2.17.1
#3 lore raw

PATCH v3 3/5 platform/x86: intel_pmc_core: fix: Add slp_s0_offset attribute back to tgl_reg_map

In reply to Gayatri Kammela

If platforms such as Tiger Lake has sub-states of S0ix, then attributes such as slps0_dbg_offset become invalid. But slp_s0_offset is still valid as it is used to get the pmcdev_base_addr.

Hence, add back slp_s0_offset and remove slps0_dbg_offset attributes.

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David E. Box <[email protected]>
---
 drivers/platform/x86/intel_pmc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel_pmc_core.c +1 -1
index a36051c2a18c..986fe677d6fe 100644
@@ -556,9 +556,9 @@ static const struct pmc_bit_map *tgl_lpm_maps[] = {
 
 static const struct pmc_reg_map tgl_reg_map = {
 	.pfear_sts = ext_tgl_pfear_map,
+	.slp_s0_offset = CNP_PMC_SLP_S0_RES_COUNTER_OFFSET,
 	.ltr_show_sts = cnp_ltr_show_map,
 	.msr_sts = msr_map,
-	.slps0_dbg_offset = CNP_PMC_SLPS0_DBG_OFFSET,
 	.ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET,
 	.regmap_length = CNP_PMC_MMIO_REG_LEN,
 	.ppfear0_offset = CNP_PMC_HOST_PPFEAR0A,
Signature · 1 line
2.17.1
#4 lore raw

PATCH v3 4/5 platform/x86: intel_pmc_core: Make pmc_core_substate_res_show() generic

In reply to Gayatri Kammela

Currently pmc_core_substate_res_show() uses array of char pointers i.e., lpm_modes for Tiger Lake directly to iterate through and to get the number of low power modes which is hardcoded and cannot be re-used for future platforms that support sub-states. To maintain readability, make pmc_core_substate_res_show() generic, so that it can re-used for future platforms.

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David E. Box <[email protected]>
---
 drivers/platform/x86/intel_pmc_core.c | 2 ++
 drivers/platform/x86/intel_pmc_core.h | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/platform/x86/intel_pmc_core.c +2 -0
index 986fe677d6fe..04ac058b9871 100644
@@ -566,6 +566,7 @@ static const struct pmc_reg_map tgl_reg_map = {
 	.pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET,
 	.pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT,
 	.ltr_ignore_max = TGL_NUM_IP_IGN_ALLOWED,
+	.lpm_modes = tgl_lpm_modes,
 	.lpm_en_offset = TGL_LPM_EN_OFFSET,
 	.lpm_residency_offset = TGL_LPM_RESIDENCY_OFFSET,
 	.lpm_sts = tgl_lpm_maps,
@@ -991,6 +992,7 @@ DEFINE_SHOW_ATTRIBUTE(pmc_core_ltr);
 static int pmc_core_substate_res_show(struct seq_file *s, void *unused)
 {
 	struct pmc_dev *pmcdev = s->private;
+	const char **lpm_modes = pmcdev->map->lpm_modes;
 	u32 offset = pmcdev->map->lpm_residency_offset;
 	u32 lpm_en;
 	int index;
drivers/platform/x86/intel_pmc_core.h +2 -1
index 1bbdffe80bde..0d50b2402abe 100644
@@ -198,7 +198,7 @@ enum ppfear_regs {
 #define TGL_LPM_STATUS_OFFSET			0x1C3C
 #define TGL_LPM_LIVE_STATUS_OFFSET		0x1C5C
 
-const char *lpm_modes[] = {
+const char *tgl_lpm_modes[] = {
 	"S0i2.0",
 	"S0i2.1",
 	"S0i2.2",
@@ -255,6 +255,7 @@ struct pmc_reg_map {
 	const u32 ltr_ignore_max;
 	const u32 pm_vric1_offset;
 	/* Low Power Mode registers */
+	const char **lpm_modes;
 	const u32 lpm_en_offset;
 	const u32 lpm_residency_offset;
 	const u32 lpm_status_offset;
Signature · 1 line
2.17.1
#5 lore raw

PATCH v3 5/5 platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic for platforms that support sub-states

In reply to Gayatri Kammela

Currently pmc_core_lpm_display() uses array of struct pointers i.e., tgl_lpm_maps for Tiger Lake directly to iterate through and to get the number of status/live status registers which is hardcoded and cannot be re-used for future platforms that support sub-states. To maintain readability, make pmc_core_lpm_display() generic, so that it can re-used for future platforms.

---
 drivers/platform/x86/intel_pmc_core.c | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)
drivers/platform/x86/intel_pmc_core.c +22 -3
index 04ac058b9871..cf3aaace21d5 100644
@@ -20,6 +20,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
+#include <linux/slab.h>
 #include <linux/suspend.h>
 #include <linux/uaccess.h>
 
@@ -640,15 +641,30 @@ static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,
 	}
 }
 
+static int pmc_core_lpm_get_arr_size(const struct pmc_bit_map **maps)
+{
+	int idx, arr_size = 0;
+
+	for (idx = 0; maps[idx]; idx++)
+		arr_size++;
+
+	return arr_size;
+}
+
 static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
 				 struct seq_file *s, u32 offset,
 				 const char *str,
 				 const struct pmc_bit_map **maps)
 {
-	u32 lpm_regs[ARRAY_SIZE(tgl_lpm_maps)-1];
-	int index, idx, len = 32, bit_mask;
+	int arr_size = pmc_core_lpm_get_arr_size(maps);
+	int index, idx, bit_mask, len = 32;
+	u32 *lpm_regs;
+
+	lpm_regs = kmalloc_array(arr_size, sizeof(*lpm_regs), GFP_KERNEL);
+	if(!lpm_regs)
+		goto err;
 
-	for (index = 0; tgl_lpm_maps[index]; index++) {
+	for (index = 0; maps[index]; index++) {
 		lpm_regs[index] = pmc_core_reg_read(pmcdev, offset);
 		offset += 4;
 	}
@@ -672,6 +688,9 @@ static void pmc_core_lpm_display(struct pmc_dev *pmcdev, struct device *dev,
 					   lpm_regs[idx] & bit_mask ? 1 : 0);
 		}
 	}
+
+err:
+	kfree(lpm_regs);
 }
 
 #if IS_ENABLED(CONFIG_DEBUG_FS)
Signature · 1 line
2.17.1
#6 lore raw

Re: [PATCH v3 5/5] platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic for platforms that support sub-states

Quoted 6 lines · Gayatri Kammela

Currently pmc_core_lpm_display() uses array of struct pointers i.e., tgl_lpm_maps for Tiger Lake directly to iterate through and to get the number of status/live status registers which is hardcoded and cannot be re-used for future platforms that support sub-states. To maintain readability, make pmc_core_lpm_display() generic, so that it can re-used for future platforms.

My comments below.

...

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 646

Quoted 3 lines
drivers/platform/x86/intel_pmc_core.c +3 -0
+static int pmc_core_lpm_get_arr_size(const struct pmc_bit_map **maps)
+{
+	int idx, arr_size = 0;

And why do you need arr_size variable at all?

Quoted 6 lines
drivers/platform/x86/intel_pmc_core.c +6 -0
+
+	for (idx = 0; maps[idx]; idx++)
+		arr_size++;
+
+	return arr_size;
+}

...

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 660

Quoted 2 lines
drivers/platform/x86/intel_pmc_core.c +1 -1
-	int index, idx, len = 32, bit_mask;
+	int index, idx, bit_mask, len = 32;

What's the point of shuffling this?

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 659

Quoted 1 line
drivers/platform/x86/intel_pmc_core.c +1 -0
+	int arr_size = pmc_core_lpm_get_arr_size(maps);

This would be better in a split manner, i.e.

	int arr_size;

	...

	arr_size = ...;

...

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,

Quoted 4 lines
drivers/platform/x86/intel_pmc_core.c +3 -0
+	lpm_regs = kmalloc_array(arr_size, sizeof(*lpm_regs), GFP_KERNEL);
+	if(!lpm_regs)
 
+		goto err;

There is no point to have the label. Simple return will work.

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 667

Quoted 2 lines
drivers/platform/x86/intel_pmc_core.c +1 -1
-	for (index = 0; tgl_lpm_maps[index]; index++) {
+	for (index = 0; maps[index]; index++) {

Why not to reuse arr_size here?

Quoted 3 lines
drivers/platform/x86/intel_pmc_core.c +0 -0
 		lpm_regs[index] = pmc_core_reg_read(pmcdev, offset);
 		offset += 4;
 	}
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

RE: [PATCH v3 5/5] platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic for platforms that support sub-states

Quoted 14 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Monday, March 2, 2020 4:54 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: Re: [PATCH v3 5/5] platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic for platforms that support sub-states

On Sun, Mar 01, 2020 at 12:44:26PM -0800, Gayatri Kammela wrote:

Quoted 8 lines
Quoted 6 lines

Currently pmc_core_lpm_display() uses array of struct pointers i.e., tgl_lpm_maps for Tiger Lake directly to iterate through and to get the number of status/live status registers which is hardcoded and cannot be re-used for future platforms that support sub-states. To maintain readability, make pmc_core_lpm_display() generic, so that it can re-used for future platforms.

My comments below.

Thanks Andy! for the comments.

Quoted 8 lines

...

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 646

Quoted 3 lines
drivers/platform/x86/intel_pmc_core.c +3 -0
+static int pmc_core_lpm_get_arr_size(const struct pmc_bit_map **maps)
+{
+	int idx, arr_size = 0;

And why do you need arr_size variable at all?

I could just return idx value at the end of the for loop. I will remove the arr_size variable.

Quoted 10 lines
Quoted 7 lines
drivers/platform/x86/intel_pmc_core.c +6 -0
+
+	for (idx = 0; maps[idx]; idx++)
+		arr_size++;
+
+	return arr_size;
+}

...

Quoted 4 lines

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 660

Quoted 2 lines
drivers/platform/x86/intel_pmc_core.c +1 -1
-	int index, idx, len = 32, bit_mask;
+	int index, idx, bit_mask, len = 32;

What's the point of shuffling this?

Just wanted to have all uninitialized variables declared before initialized ones. I will just leave this out in v4.

Quoted 10 lines

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 659

Quoted 2 lines
drivers/platform/x86/intel_pmc_core.c +1 -0
+	int arr_size = pmc_core_lpm_get_arr_size(maps);

This would be better in a split manner, i.e.

	int arr_size;

	...

	arr_size = ...;

Sure, I will make this change in v4

Quoted 9 lines

...

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev,

Quoted 4 lines
drivers/platform/x86/intel_pmc_core.c +3 -0
+	lpm_regs = kmalloc_array(arr_size, sizeof(*lpm_regs), GFP_KERNEL);
+	if(!lpm_regs)
 
+		goto err;

There is no point to have the label. Simple return will work.

Thought adding a label will help not to have multiple kfree() in the same function (one here at the check and one at the end of the for loop) I will add a return.

Quoted 5 lines

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 667

Quoted 3 lines
drivers/platform/x86/intel_pmc_core.c +1 -1
-	for (index = 0; tgl_lpm_maps[index]; index++) {
+	for (index = 0; maps[index]; index++) {

Why not to reuse arr_size here?

Good point! I missed it. I will use the arr_size here to iterate.

Quoted 9 lines

drivers/platform/x86/intel_pmc_core.c static void pmc_core_slps0_display(struct pmc_dev *pmcdev, struct device *dev, · line 670

Quoted 4 lines
drivers/platform/x86/intel_pmc_core.c +0 -0
 		lpm_regs[index] = pmc_core_reg_read(pmcdev, offset);
 		offset += 4;
 	}

--
With Best Regards,
Andy Shevchenko

#8 lore raw
In reply to Gayatri Kammela
Quoted 5 lines · Gayatri Kammela

Hi,

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

I had applied first four, the fifth requires additional work. When send a new version, do it only for last one.

Quoted 40 lines

Patch 1: Relocate both pmc_core_slps0_display() and pmc_core_lpm_display() Patch 2: Remove the duplicate if() condition to create debugfs entry Patch 3: Add back slp_s0_offset attribute back to tgl_reg_map Patch 4: Make pmc_core_substate_res_show() generic
Patch 5: Make pmc_core_lpm_display() generic

Changes since v1:
1) Changed the order of the patches i.e., patch 2 in v1 is made first in the order for v2.
2) Fixed the warnings reported by kbuild test robot.

Changes since v2:
1) Add "Make pmc_core_substate_res_show() generic" patch to v3.
2) Fixed the memory leak issue in pmc_core_lpm_display().
3) Moved patch 2 in v2 to the last in the series in v3.

Gayatri Kammela (5):
platform/x86: intel_pmc_core: fix: Relocate pmc_core_slps0_display()
and pmc_core_lpm_display() to outside of CONFIG_DEBUG_FS
platform/x86: intel_pmc_core: fix: Remove the duplicate if() to create
debugfs entry for substate_live_status_registers
platform/x86: intel_pmc_core: fix: Add slp_s0_offset attribute back to
tgl_reg_map
platform/x86: intel_pmc_core: Make pmc_core_substate_res_show()
generic
platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic
for platforms that support sub-states

 drivers/platform/x86/intel_pmc_core.c | 148 +++++++++++++++-----------
 drivers/platform/x86/intel_pmc_core.h |   3 +-
 2 files changed, 85 insertions(+), 66 deletions(-)

base-commit: 7adb1e8aeeb5d4d88012568b2049599c1a247cf2

Cc Chen Zhou <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc David Box <[email protected]>
Signature · 1 line
2.17.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#9 lore raw
Quoted 14 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Monday, March 2, 2020 4:54 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

On Sun, Mar 01, 2020 at 12:44:21PM -0800, Gayatri Kammela wrote:

Quoted 8 lines
Quoted 5 lines

Hi,

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

I had applied first four, the fifth requires additional work. When send a new version, do it only for last one.

Thanks Andy! I will send the 5th patch alone in new version.

Quoted 46 lines
Quoted 33 lines

Patch 1: Relocate both pmc_core_slps0_display() and pmc_core_lpm_display() Patch 2: Remove the duplicate if() condition to create debugfs entry Patch 3: Add back slp_s0_offset attribute back to tgl_reg_map Patch 4: Make pmc_core_substate_res_show() generic Patch 5: Make pmc_core_lpm_display() generic

Changes since v1:
1) Changed the order of the patches i.e., patch 2 in v1 is made first in the order for v2.
2) Fixed the warnings reported by kbuild test robot.

Changes since v2:
1) Add "Make pmc_core_substate_res_show() generic" patch to v3.
2) Fixed the memory leak issue in pmc_core_lpm_display().
3) Moved patch 2 in v2 to the last in the series in v3.

Gayatri Kammela (5):
platform/x86: intel_pmc_core: fix: Relocate pmc_core_slps0_display()
and pmc_core_lpm_display() to outside of CONFIG_DEBUG_FS
platform/x86: intel_pmc_core: fix: Remove the duplicate if() to create
debugfs entry for substate_live_status_registers
platform/x86: intel_pmc_core: fix: Add slp_s0_offset attribute back to
tgl_reg_map
platform/x86: intel_pmc_core: Make pmc_core_substate_res_show()
generic
platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display() generic
for platforms that support sub-states

 drivers/platform/x86/intel_pmc_core.c | 148 +++++++++++++++-----------
 drivers/platform/x86/intel_pmc_core.h |   3 +-
 2 files changed, 85 insertions(+), 66 deletions(-)
Quoted 8 lines

base-commit: 7adb1e8aeeb5d4d88012568b2049599c1a247cf2

Cc: Chen Zhou <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: David Box <[email protected]>
--
2.17.1

--
With Best Regards,
Andy Shevchenko

#10 lore raw
Quoted 30 lines

-----Original Message-----
From: Kammela, Gayatri
Sent: Monday, March 2, 2020 10:29 AM
To: Andy Shevchenko <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: RE: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 9 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Monday, March 2, 2020 4:54 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou

<[email protected]>;

Quoted 7 lines

Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 2 lines · Gayatri Kammela

Hi,

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

I had applied first four, the fifth requires additional work. When send a new version, do it only for last one.

Thanks Andy! I will send the 5th patch alone in new version.

Hi Andy! I see first 3 patches are merged in for-next branch on 2/28 but not 4th patch. Can you please check? http://git.infradead.org/linux-platform-drivers-x86.git/shortlog/refs/heads/for-next

Quoted 48 lines
Quoted 18 lines
Quoted 18 lines

Patch 1: Relocate both pmc_core_slps0_display() and pmc_core_lpm_display() Patch 2: Remove the duplicate if() condition to create debugfs entry Patch 3: Add back slp_s0_offset attribute back to tgl_reg_map Patch 4: Make pmc_core_substate_res_show() generic Patch
5: Make pmc_core_lpm_display() generic

Changes since v1:
1) Changed the order of the patches i.e., patch 2 in v1 is made first in the order for v2.
2) Fixed the warnings reported by kbuild test robot.

Changes since v2:
1) Add "Make pmc_core_substate_res_show() generic" patch to v3.
2) Fixed the memory leak issue in pmc_core_lpm_display().
3) Moved patch 2 in v2 to the last in the series in v3.

Quoted 10 lines
Quoted 10 lines

Gayatri Kammela (5):
platform/x86: intel_pmc_core: fix: Relocate pmc_core_slps0_display()
and pmc_core_lpm_display() to outside of CONFIG_DEBUG_FS
platform/x86: intel_pmc_core: fix: Remove the duplicate if() to create
debugfs entry for substate_live_status_registers
platform/x86: intel_pmc_core: fix: Add slp_s0_offset attribute back to
tgl_reg_map
platform/x86: intel_pmc_core: Make pmc_core_substate_res_show()
generic
platform/x86: intel_pmc_core: fix: Make pmc_core_lpm_display()

generic

Quoted 19 lines
Quoted 6 lines

for platforms that support sub-states

 drivers/platform/x86/intel_pmc_core.c | 148 +++++++++++++++-----------
 drivers/platform/x86/intel_pmc_core.h |   3 +-
 2 files changed, 85 insertions(+), 66 deletions(-)
Quoted 8 lines

base-commit: 7adb1e8aeeb5d4d88012568b2049599c1a247cf2

Cc: Chen Zhou <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: David Box <[email protected]>
--
2.17.1

--
With Best Regards,
Andy Shevchenko

#11 lore raw
Quoted 34 lines · Gayatri
Quoted 34 lines

-----Original Message-----
From: Kammela, Gayatri
Sent: Monday, March 2, 2020 10:29 AM
To: Andy Shevchenko <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: RE: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 9 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Monday, March 2, 2020 4:54 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou

<[email protected]>;

Quoted 11 lines

Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 5 lines · Gayatri Kammela

Hi,

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I had applied first four, the fifth requires additional work. When send a new version, do it only for last one.

Thanks Andy! I will send the 5th patch alone in new version.

Hi Andy! I see first 3 patches are merged in for-next branch on 2/28 but not 4th patch. Can you please check? http://git.infradead.org/linux-platform-drivers-x86.git/shortlog/refs/heads/for-next

Is it in my review and testing queue?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#12 lore raw
Quoted 55 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Thursday, March 19, 2020 11:06 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 13 lines · Gayatri
Quoted 13 lines

-----Original Message-----
From: Kammela, Gayatri
Sent: Monday, March 2, 2020 10:29 AM
To: Andy Shevchenko <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: RE: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Monday, March 2, 2020 4:54 AM
To: Kammela, Gayatri <[email protected]>
Cc: [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected];

Westerberg,

Quoted 20 lines
Quoted 19 lines
Quoted 2 lines

Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou

<[email protected]>;

Quoted 5 lines

Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

On Sun, Mar 01, 2020 at 12:44:21PM -0800, Gayatri Kammela wrote:

Quoted 8 lines
Quoted 5 lines

Hi,

This patch series consists of bug fixes and code optimization for the series https://patchwork.kernel.org/patch/11365325/

I had applied first four, the fifth requires additional work. When send a new version, do it only for last one.

Thanks Andy! I will send the 5th patch alone in new version.

Quoted 7 lines
Quoted 4 lines

Hi Andy! I see first 3 patches are merged in for-next branch on 2/28 but not 4th patch. Can you please check?
http://git.infradead.org/linux-platform-drivers-x86.git/shortlog/refs/
heads/for-next

Is it in my review and testing queue?

I think it is archived and superseded https://patchwork.kernel.org/patch/11414379/

Quoted 5 lines

--
With Best Regards,
Andy Shevchenko

#14 lore raw
Quoted 16 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Friday, March 20, 2020 6:50 AM
To: Kammela, Gayatri <[email protected]>
Cc: Andy Shevchenko <[email protected]>; platform- [email protected]; [email protected]; Somayaji, Vishwanath <[email protected]>; [email protected]; Westerberg, Mika <[email protected]>; [email protected]; Prestopine, Charles D <[email protected]>; Chen Zhou <[email protected]>; Box, David E <[email protected]>
Subject: Re: [PATCH v3 0/5] platform/x86: intel_pmc_core: Add bug fixes or code

Quoted 1 line · Gayatri
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Is it in my review and testing queue?

I think it is archived and superseded
https://patchwork.kernel.org/patch/11414379/

Now everything in for-next, check if something is missed and resend.

Thanks Andy! I just noticed 5th patch in this version is accepted but 4th is still showing superseded. To avoid confusion, I will resend the 4th patch alone.

Quoted 4 lines

--
With Best Regards,
Andy Shevchenko