Skip to content

Commit 09f5df3

Browse files
superm1rafaeljw
authored andcommitted
platform/x86/amd: pmc: Report duration of time in hw sleep state
amd_pmc displays a warning when a suspend didn't get to the deepest state and a dynamic debugging message with the duration if it did. Rather than logging to dynamic debugging the duration spent in the deepest 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> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent b52124a commit 09f5df3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • drivers/platform/x86/amd

drivers/platform/x86/amd/pmc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev)
393393

394394
if (!table.s0i3_last_entry_status)
395395
dev_warn(pdev->dev, "Last suspend didn't reach deepest state\n");
396-
else
397-
dev_dbg(pdev->dev, "Last suspend in deepest state for %lluus\n",
398-
table.timein_s0i3_lastcapture);
396+
pm_report_hw_sleep_time(table.s0i3_last_entry_status ?
397+
table.timein_s0i3_lastcapture : 0);
399398
}
400399

401400
static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
@@ -1015,6 +1014,7 @@ static int amd_pmc_probe(struct platform_device *pdev)
10151014
}
10161015

10171016
amd_pmc_dbgfs_register(dev);
1017+
pm_report_max_hw_sleep(U64_MAX);
10181018
return 0;
10191019

10201020
err_pci_dev_put:

0 commit comments

Comments
 (0)