Skip to content

Commit 23f5f70

Browse files
superm1jwrdegoede
authored andcommitted
platform/x86: amd-pmc: Output error codes in messages
The return type for the s2idle callbacks is 'void', so any errors that occur will no longer be displayed. Output these error codes in the messages in case of any failures. Signed-off-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent b1f6603 commit 23f5f70

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/platform/x86/amd-pmc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,23 +653,25 @@ static void amd_pmc_s2idle_prepare(void)
653653
/* Activate CZN specific RTC functionality */
654654
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
655655
rc = amd_pmc_verify_czn_rtc(pdev, &arg);
656-
if (rc)
656+
if (rc) {
657+
dev_err(pdev->dev, "failed to set RTC: %d\n", rc);
657658
goto fail;
659+
}
658660
}
659661

660662
/* Dump the IdleMask before we send hint to SMU */
661663
amd_pmc_idlemask_read(pdev, pdev->dev, NULL);
662664
msg = amd_pmc_get_os_hint(pdev);
663665
rc = amd_pmc_send_cmd(pdev, arg, NULL, msg, 0);
664666
if (rc) {
665-
dev_err(pdev->dev, "suspend failed\n");
667+
dev_err(pdev->dev, "suspend failed: %d\n", rc);
666668
goto fail;
667669
}
668670

669671
if (enable_stb)
670672
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF);
671673
if (rc) {
672-
dev_err(pdev->dev, "error writing to STB\n");
674+
dev_err(pdev->dev, "error writing to STB: %d\n", rc);
673675
goto fail;
674676
}
675677
return;
@@ -688,7 +690,7 @@ static void amd_pmc_s2idle_restore(void)
688690
msg = amd_pmc_get_os_hint(pdev);
689691
rc = amd_pmc_send_cmd(pdev, 0, NULL, msg, 0);
690692
if (rc)
691-
dev_err(pdev->dev, "resume failed\n");
693+
dev_err(pdev->dev, "resume failed: %d\n", rc);
692694

693695
/* Let SMU know that we are looking for stats */
694696
amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0);
@@ -700,7 +702,7 @@ static void amd_pmc_s2idle_restore(void)
700702
if (enable_stb)
701703
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF + 1);
702704
if (rc)
703-
dev_err(pdev->dev, "error writing to STB\n");
705+
dev_err(pdev->dev, "error writing to STB: %d\n", rc);
704706

705707
/* Restore the QoS request back to defaults if it was set */
706708
if (pdev->cpu_id == AMD_CPU_ID_CZN)

0 commit comments

Comments
 (0)