Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1451948rwl; Fri, 31 Mar 2023 11:17:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aV6B9YKmN2sqow8J03TMoZt7s+MzfjT+TQkzUsqb60jVxa+Wd8RyqE+Kjs5xzkQ7l8bOgf X-Received: by 2002:a17:903:264b:b0:196:8d96:dc6b with SMTP id je11-20020a170903264b00b001968d96dc6bmr7336772plb.2.1680286659311; Fri, 31 Mar 2023 11:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680286659; cv=none; d=google.com; s=arc-20160816; b=rbnztHcxUo8tVWs1VRyZ6PjQX62FUEy4lA4czeTVe8lPkaMJU1uLfcNt5gXYvfwAKn 5vhlOvDyQEKzN1DDVe02MhuVzosgodEkjm8r2bXzDp7lObp7NqoRaKjf6wAxkctW5cmM 20uHFV1eobClwwh46Wz75t1pJD7yadq0GGw3QY1rjqdaCdtybzN00R2ScAkMijVMHov6 nG6Jkmmeri8awBsulGI6M0RoJzcK9DLF+PyPfkfJXm9mj+v8rCgkkd1zmBJpLnRUw36D uuJaA1Rf41XFfohTbufY00jDTgjazYjEbSDWRR7rf/i1DSUQtQgjT6F4rLRJGxFl+p/Q YjyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=EJGmdaE1CPHHe6vd0iuEqGU1OV5K0uxvrD0Tz39v9iQ=; b=Zol7UkNsgR0KFN19q0SMpea9hr7zTZeHYy1gHzEvjuoLG3D5eIW6CyyzxUsjpJqAj6 KOetOxPDWH8Y+nV6TZBQsQawxXBQqUfF07SeD1i4pWabcqtWZ/QgOe3P8P4H4NdVe0t/ jU2m0x9UX6Mgzb9G+B09TF4n54YntGvBO72L976+r8jWQ8oX51bLc89UpLI/1uiyX4WR rPHDMtqys2bEqXGsZBPzAzjbUbXfmyFM63NOezTQy5SEjKUpcFnLCP65znih5MMpy4pB nLu6mn6Iug5aGbt37AuC8t0OVM4kfszKlMWjJIJBLnkIZwPbPTnTODvZEuWe0EqWJo1U zTjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v3-20020a170902b7c300b001a1defc30cbsi2483744plz.479.2023.03.31.11.17.28; Fri, 31 Mar 2023 11:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbjCaSGD convert rfc822-to-8bit (ORCPT + 99 others); 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-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 X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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; > > --