All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario.limonciello@amd.com>
To: Sven van Ashbrook <svenva@chromium.org>,
	John Stultz <jstultz@google.com>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Raul Rangel <rrangel@chromium.org>,
	David E Box <david.e.box@intel.com>,
	Rajat Jain <rajatja@google.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Hans de Goede <hdegoede@redhat.com>,
	<linux-kernel@vger.kernel.org>,
	<platform-driver-x86@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	Mark Gross <markgross@kernel.org>
Subject: [PATCH v5 2/4] platform/x86/amd: pmc: Report duration of time in hw sleep state
Date: Thu, 30 Mar 2023 14:44:36 -0500	[thread overview]
Message-ID: <20230330194439.14361-3-mario.limonciello@amd.com> (raw)
In-Reply-To: <20230330194439.14361-1-mario.limonciello@amd.com>

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.

Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 drivers/platform/x86/amd/pmc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/amd/pmc.c b/drivers/platform/x86/amd/pmc.c
index 2edaae04a691..2c1ea9c14819 100644
--- a/drivers/platform/x86/amd/pmc.c
+++ b/drivers/platform/x86/amd/pmc.c
@@ -393,9 +393,8 @@ static void amd_pmc_validate_deepest(struct amd_pmc_dev *pdev)
 
 	if (!table.s0i3_last_entry_status)
 		dev_warn(pdev->dev, "Last suspend didn't reach deepest state\n");
-	else
-		dev_dbg(pdev->dev, "Last suspend in deepest state for %lluus\n",
-			 table.timein_s0i3_lastcapture);
+	pm_set_hw_sleep_time(table.s0i3_last_entry_status ?
+			     table.timein_s0i3_lastcapture : 0);
 }
 
 static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)
-- 
2.34.1


  parent reply	other threads:[~2023-03-30 19:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 19:44 [PATCH v5 0/4] Add vendor agnostic mechanism to report hardware sleep Mario Limonciello
2023-03-30 19:44 ` [PATCH v5 1/4] PM: Add a sysfs file to represent time spent in hardware sleep state Mario Limonciello
2023-03-31 18:01   ` Rafael J. Wysocki
2023-03-31 18:05     ` Limonciello, Mario
2023-03-31 18:07       ` Rafael J. Wysocki
2023-03-31 18:13         ` Limonciello, Mario
2023-03-31 18:25           ` Rafael J. Wysocki
2023-03-30 19:44 ` Mario Limonciello [this message]
2023-03-30 19:44 ` [PATCH v5 3/4] platform/x86/intel/pmc: core: Always capture counters on suspend Mario Limonciello
2023-04-03 16:58   ` Box, David E
2023-03-30 19:44 ` [PATCH v5 4/4] platform/x86/intel/pmc: core: Report duration of time in HW sleep state Mario Limonciello
2023-03-31  3:02   ` kernel test robot
2023-03-31 18:05   ` Rafael J. Wysocki
2023-04-03 18:00     ` Box, David E
2023-04-03 18:07       ` Limonciello, Mario
2023-04-03 18:32         ` Rafael J. Wysocki

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=20230330194439.14361-3-mario.limonciello@amd.com \
    --to=mario.limonciello@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=david.e.box@intel.com \
    --cc=hdegoede@redhat.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rajatja@google.com \
    --cc=rrangel@chromium.org \
    --cc=svenva@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.