Skip to content

Commit ddd66d6

Browse files
superm1rafaeljw
authored andcommitted
platform/x86/intel/pmc: core: Report duration of time in HW sleep state
intel_pmc_core displays a warning when the module parameter `warn_on_s0ix_failures` is set and a suspend didn't get to a HW sleep state. Report this to the standard kernel reporting infrastructure so that userspace software can query after the suspend cycle is done. Reviewed-by: Hans de Goede <hdegoede@redhat.com> Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.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 e2348af commit ddd66d6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,8 @@ static int pmc_core_probe(struct platform_device *pdev)
11531153
pmc_core_do_dmi_quirks(pmcdev);
11541154

11551155
pmc_core_dbgfs_register(pmcdev);
1156+
pm_report_max_hw_sleep(FIELD_MAX(SLP_S0_RES_COUNTER_MASK) *
1157+
pmc_core_adjust_slp_s0_step(pmcdev, 1));
11561158

11571159
device_initialized = true;
11581160
dev_info(&pdev->dev, " initialized\n");
@@ -1214,6 +1216,8 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev)
12141216
if (pmc_core_dev_state_get(pmcdev, &s0ix_counter))
12151217
return false;
12161218

1219+
pm_report_hw_sleep_time((u32)(s0ix_counter - pmcdev->s0ix_counter));
1220+
12171221
if (s0ix_counter == pmcdev->s0ix_counter)
12181222
return true;
12191223

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <linux/bits.h>
1717
#include <linux/platform_device.h>
1818

19+
#define SLP_S0_RES_COUNTER_MASK GENMASK(31, 0)
20+
1921
#define PMC_BASE_ADDR_DEFAULT 0xFE000000
2022

2123
/* Sunrise Point Power Management Controller PCI Device ID */

0 commit comments

Comments
 (0)