From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 458A6C76196 for ; Fri, 31 Mar 2023 18:06:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232375AbjCaSGD convert rfc822-to-8bit (ORCPT ); Fri, 31 Mar 2023 14:06:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232724AbjCaSGC (ORCPT ); Fri, 31 Mar 2023 14:06:02 -0400 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E014C1D2D5; Fri, 31 Mar 2023 11:05:54 -0700 (PDT) Received: by mail-ed1-f45.google.com with SMTP id t10so92754653edd.12; Fri, 31 Mar 2023 11:05:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680285953; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/reCKtYhi3HG+0JUopGdSMZyzF44Qp/rswO5vBUAHPA=; b=3FBObQSu/1DcSMT6oWK1+iOf/VHMNvkKZXn76CjqfKE7GYf4mdv9nQfjRdU1CEP2ZM /iSmSdf/WeDX/XOkv4BaXx9AlDLbM/qKP6+zBJ2jHGbEXAXbq0Ewtfia7AvDXwbzkt9m ekub+3j0yHK1KkWvL64/2qf6MzCmSxkArQCS7HrFWjmF4NwXHM0ZU9x0s5MFjIo7a/K/ P4k9ZS+vKWUFjsSpDlSSRtX2eNzcuU103WXarmlR9TciMSPTJ/T/lJSSclwYbzcLARsL 6LhglL3vGRJZlqGIsTpBnIbJxzD60Yjg9nOE8b+/wae93/T8I28gqy9mF1Jvq0CYHOKz oJPg== X-Gm-Message-State: AAQBX9eOXwXX2J0+TE/pcr96Lze7f4IUpJyrlmxzW24v7Oz1cnbZDd2Z 2OTuzrVxLTbjosTdQTUfJpwtaRn9OQeJNmZ0XNk= X-Google-Smtp-Source: AKy350aRu1rC5LHQTl5XlwzkbXuwNMcWF1StwcS3fIRDb/ZqG7tJPnQq2X51SHdvF0hXEbVt4l+Wy9EFKcBK9RAgh4g= X-Received: by 2002:a50:d49e:0:b0:502:148d:9e1e with SMTP id s30-20020a50d49e000000b00502148d9e1emr13809961edi.3.1680285953431; Fri, 31 Mar 2023 11:05:53 -0700 (PDT) MIME-Version: 1.0 References: <20230330194439.14361-1-mario.limonciello@amd.com> <20230330194439.14361-5-mario.limonciello@amd.com> In-Reply-To: <20230330194439.14361-5-mario.limonciello@amd.com> From: "Rafael J. Wysocki" Date: Fri, 31 Mar 2023 20:05:42 +0200 Message-ID: Subject: Re: [PATCH v5 4/4] platform/x86/intel/pmc: core: Report duration of time in HW sleep state To: Mario Limonciello Cc: Sven van Ashbrook , John Stultz , Rajneesh Bhardwaj , David E Box , Raul Rangel , Rajat Jain , S-k Shyam-sundar , "Rafael J . Wysocki" , Hans de Goede , linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-pm@vger.kernel.org, Mark Gross Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org On Thu, Mar 30, 2023 at 9:45 PM Mario Limonciello wrote: > > intel_pmc_core displays a warning when the module parameter > `warn_on_s0ix_failures` is set and a suspend didn't get to a HW sleep > 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 > --- > v4->v5: > * Reword commit message > --- > drivers/platform/x86/intel/pmc/core.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c > index e2f171fac094..980af32dd48a 100644 > --- a/drivers/platform/x86/intel/pmc/core.c > +++ b/drivers/platform/x86/intel/pmc/core.c > @@ -1203,6 +1203,8 @@ static inline bool pmc_core_is_s0ix_failed(struct pmc_dev *pmcdev) > if (pmc_core_dev_state_get(pmcdev, &s0ix_counter)) > return false; > > + pm_set_hw_sleep_time(s0ix_counter - pmcdev->s0ix_counter); > + Maybe check if this is really accumulating? In case of a counter overflow, for instance? > if (s0ix_counter == pmcdev->s0ix_counter) > return true; > > --