Commit 23f5f700 authored by Mario Limonciello's avatar Mario Limonciello Committed by Hans de Goede

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: default avatarMario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20220317141445.6498-3-mario.limonciello@amd.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent b1f66033
...@@ -653,8 +653,10 @@ static void amd_pmc_s2idle_prepare(void) ...@@ -653,8 +653,10 @@ static void amd_pmc_s2idle_prepare(void)
/* Activate CZN specific RTC functionality */ /* Activate CZN specific RTC functionality */
if (pdev->cpu_id == AMD_CPU_ID_CZN) { if (pdev->cpu_id == AMD_CPU_ID_CZN) {
rc = amd_pmc_verify_czn_rtc(pdev, &arg); rc = amd_pmc_verify_czn_rtc(pdev, &arg);
if (rc) if (rc) {
dev_err(pdev->dev, "failed to set RTC: %d\n", rc);
goto fail; goto fail;
}
} }
/* Dump the IdleMask before we send hint to SMU */ /* Dump the IdleMask before we send hint to SMU */
...@@ -662,14 +664,14 @@ static void amd_pmc_s2idle_prepare(void) ...@@ -662,14 +664,14 @@ static void amd_pmc_s2idle_prepare(void)
msg = amd_pmc_get_os_hint(pdev); msg = amd_pmc_get_os_hint(pdev);
rc = amd_pmc_send_cmd(pdev, arg, NULL, msg, 0); rc = amd_pmc_send_cmd(pdev, arg, NULL, msg, 0);
if (rc) { if (rc) {
dev_err(pdev->dev, "suspend failed\n"); dev_err(pdev->dev, "suspend failed: %d\n", rc);
goto fail; goto fail;
} }
if (enable_stb) if (enable_stb)
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF); rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF);
if (rc) { if (rc) {
dev_err(pdev->dev, "error writing to STB\n"); dev_err(pdev->dev, "error writing to STB: %d\n", rc);
goto fail; goto fail;
} }
return; return;
...@@ -688,7 +690,7 @@ static void amd_pmc_s2idle_restore(void) ...@@ -688,7 +690,7 @@ static void amd_pmc_s2idle_restore(void)
msg = amd_pmc_get_os_hint(pdev); msg = amd_pmc_get_os_hint(pdev);
rc = amd_pmc_send_cmd(pdev, 0, NULL, msg, 0); rc = amd_pmc_send_cmd(pdev, 0, NULL, msg, 0);
if (rc) if (rc)
dev_err(pdev->dev, "resume failed\n"); dev_err(pdev->dev, "resume failed: %d\n", rc);
/* Let SMU know that we are looking for stats */ /* Let SMU know that we are looking for stats */
amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0); amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0);
...@@ -700,7 +702,7 @@ static void amd_pmc_s2idle_restore(void) ...@@ -700,7 +702,7 @@ static void amd_pmc_s2idle_restore(void)
if (enable_stb) if (enable_stb)
rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF + 1); rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF + 1);
if (rc) if (rc)
dev_err(pdev->dev, "error writing to STB\n"); dev_err(pdev->dev, "error writing to STB: %d\n", rc);
/* Restore the QoS request back to defaults if it was set */ /* Restore the QoS request back to defaults if it was set */
if (pdev->cpu_id == AMD_CPU_ID_CZN) if (pdev->cpu_id == AMD_CPU_ID_CZN)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment