linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>
Cc: "open list:X86 PLATFORM DRIVERS" 
	<platform-driver-x86@vger.kernel.org>,
	<linux-acpi@vger.kernel.org>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>,
	Goswami Sanket <Sanket.Goswami@amd.com>,
	Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH v5 3/4] platform/x86: amd-pmc: Output error codes in messages
Date: Thu, 17 Mar 2022 09:14:44 -0500	[thread overview]
Message-ID: <20220317141445.6498-3-mario.limonciello@amd.com> (raw)
In-Reply-To: <20220317141445.6498-1-mario.limonciello@amd.com>

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 <mario.limonciello@amd.com>
---
changes from v4->v5:
 * split from previous patch

 drivers/platform/x86/amd-pmc.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/platform/x86/amd-pmc.c b/drivers/platform/x86/amd-pmc.c
index 2736ab587f2a..f36cf125b284 100644
--- a/drivers/platform/x86/amd-pmc.c
+++ b/drivers/platform/x86/amd-pmc.c
@@ -653,8 +653,10 @@ static void amd_pmc_s2idle_prepare(void)
 	/* Activate CZN specific RTC functionality */
 	if (pdev->cpu_id == AMD_CPU_ID_CZN) {
 		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;
+		}
 	}
 
 	/* Dump the IdleMask before we send hint to SMU */
@@ -662,14 +664,14 @@ static void amd_pmc_s2idle_prepare(void)
 	msg = amd_pmc_get_os_hint(pdev);
 	rc = amd_pmc_send_cmd(pdev, arg, NULL, msg, 0);
 	if (rc) {
-		dev_err(pdev->dev, "suspend failed\n");
+		dev_err(pdev->dev, "suspend failed: %d\n", rc);
 		goto fail;
 	}
 
 	if (enable_stb)
 		rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF);
 	if (rc) {
-		dev_err(pdev->dev, "error writing to STB\n");
+		dev_err(pdev->dev, "error writing to STB: %d\n", rc);
 		goto fail;
 	}
 	return;
@@ -688,7 +690,7 @@ static void amd_pmc_s2idle_restore(void)
 	msg = amd_pmc_get_os_hint(pdev);
 	rc = amd_pmc_send_cmd(pdev, 0, NULL, msg, 0);
 	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 */
 	amd_pmc_send_cmd(pdev, 0, NULL, SMU_MSG_LOG_DUMP_DATA, 0);
@@ -700,7 +702,7 @@ static void amd_pmc_s2idle_restore(void)
 	if (enable_stb)
 		rc = amd_pmc_write_stb(pdev, AMD_PMC_STB_PREDEF + 1);
 	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 */
 	if (pdev->cpu_id == AMD_CPU_ID_CZN)
-- 
2.34.1


  parent reply	other threads:[~2022-03-17 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 14:14 [PATCH v5 1/4] ACPI / x86: Add support for LPS0 callback handler Mario Limonciello
2022-03-17 14:14 ` [PATCH v5 2/4] platform/x86: amd-pmc: Move to later in the suspend process Mario Limonciello
2022-03-17 14:14 ` Mario Limonciello [this message]
2022-03-17 14:14 ` [PATCH v5 4/4] platform/x86: amd-pmc: Drop CPU QoS workaround Mario Limonciello
2022-03-17 18:54   ` Hans de Goede
2022-03-17 16:45 ` [PATCH v5 1/4] ACPI / x86: Add support for LPS0 callback handler Rafael J. Wysocki
2022-03-17 16:49   ` Limonciello, Mario
2022-03-17 16:55     ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220317141445.6498-3-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Sanket.Goswami@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).