Skip to content

Commit e2348af

Browse files
superm1rafaeljw
authored andcommitted
platform/x86/intel/pmc: core: Always capture counters on suspend
Currently counters are only captured during suspend when the warn_on_s0ix_failures module parameter is set. In order to relay this counter information to the kernel reporting infrastructure adjust it so that the counters are always captured. warn_on_s0ix_failures will be utilized solely for messaging by the driver instead. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 09f5df3 commit e2348af

2 files changed

Lines changed: 5 additions & 10 deletions

File tree

drivers/platform/x86/intel/pmc/core.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,6 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
11791179
{
11801180
struct pmc_dev *pmcdev = dev_get_drvdata(dev);
11811181

1182-
pmcdev->check_counters = false;
1183-
1184-
/* No warnings on S0ix failures */
1185-
if (!warn_on_s0ix_failures)
1186-
return 0;
1187-
11881182
/* Check if the syspend will actually use S0ix */
11891183
if (pm_suspend_via_firmware())
11901184
return 0;
@@ -1197,7 +1191,6 @@ static __maybe_unused int pmc_core_suspend(struct device *dev)
11971191
if (pmc_core_dev_state_get(pmcdev, &pmcdev->s0ix_counter))
11981192
return -EIO;
11991193

1200-
pmcdev->check_counters = true;
12011194
return 0;
12021195
}
12031196

@@ -1233,12 +1226,16 @@ static __maybe_unused int pmc_core_resume(struct device *dev)
12331226
const struct pmc_bit_map **maps = pmcdev->map->lpm_sts;
12341227
int offset = pmcdev->map->lpm_status_offset;
12351228

1236-
if (!pmcdev->check_counters)
1229+
/* Check if the syspend used S0ix */
1230+
if (pm_suspend_via_firmware())
12371231
return 0;
12381232

12391233
if (!pmc_core_is_s0ix_failed(pmcdev))
12401234
return 0;
12411235

1236+
if (!warn_on_s0ix_failures)
1237+
return 0;
1238+
12421239
if (pmc_core_is_pc10_failed(pmcdev)) {
12431240
/* S0ix failed because of PC10 entry failure */
12441241
dev_info(dev, "CPU did not enter PC10!!! (PC10 cnt=0x%llx)\n",

drivers/platform/x86/intel/pmc/core.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ struct pmc_reg_map {
319319
* @pmc_xram_read_bit: flag to indicate whether PMC XRAM shadow registers
320320
* used to read MPHY PG and PLL status are available
321321
* @mutex_lock: mutex to complete one transcation
322-
* @check_counters: On resume, check if counters are getting incremented
323322
* @pc10_counter: PC10 residency counter
324323
* @s0ix_counter: S0ix residency (step adjusted)
325324
* @num_lpm_modes: Count of enabled modes
@@ -338,7 +337,6 @@ struct pmc_dev {
338337
int pmc_xram_read_bit;
339338
struct mutex lock; /* generic mutex lock for PMC Core */
340339

341-
bool check_counters; /* Check for counter increments on resume */
342340
u64 pc10_counter;
343341
u64 s0ix_counter;
344342
int num_lpm_modes;

0 commit comments

Comments
 (0)