Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3198016rwl; Thu, 13 Apr 2023 17:45:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Zgu5/Pvqtp466Z3M3OrSDNV8wRT0r0wguOUpzV6RF3YKnYBpc+AAyCF0pyI2ljgMCXhZTC X-Received: by 2002:a05:6a20:4694:b0:dc:925f:62f1 with SMTP id el20-20020a056a20469400b000dc925f62f1mr3331916pzb.6.1681433140263; Thu, 13 Apr 2023 17:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681433140; cv=none; d=google.com; s=arc-20160816; b=zcjX+1JHR4qnGSDAsMWrylAeQ4is/v69LNGzH0/n4wL1XJfEOSChJ8umY68z8B9f4K feGsez8GmwYFSwOqR4W8qSQBGg9UxtiDUaENmKSOtjySeQogm938pcvDyRIFaVH+ielG x4FMq2t3TxOXsWmJ2cW3rv5rgrURedNYwKJhPQJAWkSfUq9A0CrbgpllGhnL2J+DuZUA In9unybsRUVmebL4QAUrIaJCKt3rqvt0RFxP3f7Pl6VdK8xZ1RjW/wilJpsYA+w7RSBf XB6+aqZjdWuYEInSYTpYoCb9m77EOdnQMylgpp0bZNaUnTkXlriQgaQxd6cCrNQQ8uzK mjOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:organization:references:in-reply-to:date :cc:to:reply-to:from:subject:message-id:dkim-signature; bh=gJXUKvtAKIhFjJW0OMUbj/X+85vaYXQK0dClWr5sQks=; b=ZuPMab1RVN8bOqdjenDcCINpi3mRVcuS7D54au1wqCIjo3aYDhfF4OoDQS8TkhjQ3o mnpUhuliWetUcUcXZwtZL8Oq5m7QSqSbdqZLLcim5yHr8Sn7FrpQXHY13K1OK1h4QA3R 94FbksUgC4BMPDo1v3m9oSzVgzl14sCyEFXkOX0WRBTYmgpLVXM5/8naD91tcYv4ZSkt Lipruy3Sb9n633tcqZLRXwtK4QOlsLPKbKAxMVp8mEnJvuCMI37AoJdD29ZDZJ8/NfyK Ugs3um61kzV9shSaKYY4gba8b6U3PzYYrbzM4XC/KHDOtrql1VAEkIXeYhFMX5tLh8ei Bryw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RTNx1zAm; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w69-20020a638248000000b004fbd23110d4si3224996pgd.773.2023.04.13.17.45.25; Thu, 13 Apr 2023 17:45:40 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=RTNx1zAm; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229618AbjDNAfy (ORCPT + 99 others); Thu, 13 Apr 2023 20:35:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjDNAfx (ORCPT ); Thu, 13 Apr 2023 20:35:53 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 646ECBE; Thu, 13 Apr 2023 17:35:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681432552; x=1712968552; h=message-id:subject:from:reply-to:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=gJXUKvtAKIhFjJW0OMUbj/X+85vaYXQK0dClWr5sQks=; b=RTNx1zAmY8Kway3NdxJl1YqtPfFk+ssgMyU3kjmvXT8yKXNTLXUND+JS 27ymq6x8t8p9GfWlgQL8PNxd+IRFmqy+hU593OTKWTfzOoWFuButSFiRe 5bMww/uNFh4N9lKRUikdPs40zlt4a/dx6eQ+pAsM19WsXA5zAElaCNlzD AkoUmYhW4wscaPPb6OnNDol4JxsbJ4SlHtakp5XsZheHonnTVj+lmVeXG oq3aifODxaDCAG0IdQxl1KO9oKyRFoXSvWYiEzg3KxY10/6mf4XgkyDvQ Kq8M2VtZ//er98TcVGxDbHD8IQx8ub/h1xc9J2IAqpiNVRPfFSSEuriM3 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="346170058" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="346170058" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 17:35:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10679"; a="722269709" X-IronPort-AV: E=Sophos;i="5.99,195,1677571200"; d="scan'208";a="722269709" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP; 13 Apr 2023 17:35:51 -0700 Received: from [10.54.75.144] (debox1-desk1.jf.intel.com [10.54.75.144]) by linux.intel.com (Postfix) with ESMTP id 1E4DA580BEE; Thu, 13 Apr 2023 17:35:51 -0700 (PDT) Message-ID: Subject: Re: [PATCH v8 4/4] platform/x86/intel/pmc: core: Report duration of time in HW sleep state From: "David E. Box" Reply-To: david.e.box@linux.intel.com To: "Limonciello, Mario" , Ilpo =?ISO-8859-1?Q?J=E4rvinen?= , Box David E Cc: "jstultz@google.com" , "pavel@ucw.cz" , "svenva@chromium.org" , Rajneesh Bhardwaj , "S-k, Shyam-sundar" , "rrangel@chromium.org" , Jain Rajat , "hdegoede@redhat.com" , Mark Gross , "platform-driver-x86@vger.kernel.org" , LKML Date: Thu, 13 Apr 2023 17:35:51 -0700 In-Reply-To: References: <20230412194917.7164-1-mario.limonciello@amd.com> <20230412194917.7164-5-mario.limonciello@amd.com> <5d904d5a-d25e-7d6d-57e4-ca451bcead57@linux.intel.com> Organization: David E. Box Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE autolearn=ham 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, 2023-04-13 at 22:40 +0000, Limonciello, Mario wrote: > [Public] >=20 >=20 >=20 > > -----Original Message----- > > From: Ilpo J=C3=A4rvinen > > Sent: Thursday, April 13, 2023 04:24 > > To: Limonciello, Mario > > Cc: Box David E ; jstultz@google.com; > > pavel@ucw.cz; svenva@chromium.org; Rajneesh Bhardwaj > > ; S-k, Shyam-sundar > k@amd.com>; rrangel@chromium.org; Jain Rajat ; > > hdegoede@redhat.com; Mark Gross ; platform- > > driver-x86@vger.kernel.org; LKML > > Subject: Re: [PATCH v8 4/4] platform/x86/intel/pmc: core: Report durati= on of > > time in HW sleep state > >=20 > > On Wed, 12 Apr 2023, Mario Limonciello wrote: > >=20 > > > 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. > > >=20 > > > Report this to the standard kernel reporting infrastructure so that > > > userspace software can query after the suspend cycle is done. > > >=20 > > > Signed-off-by: Mario Limonciello > > > --- > > > v7->v8: > > > =C2=A0* Report max sleep as well > > > --- > > > =C2=A0drivers/platform/x86/intel/pmc/core.c | 3 +++ > > > =C2=A01 file changed, 3 insertions(+) > > >=20 > > > diff --git a/drivers/platform/x86/intel/pmc/core.c > > b/drivers/platform/x86/intel/pmc/core.c > > > index 925c5d676a43..f9677104353d 100644 > > > --- a/drivers/platform/x86/intel/pmc/core.c > > > +++ b/drivers/platform/x86/intel/pmc/core.c > > > @@ -1153,6 +1153,7 @@ static int pmc_core_probe(struct platform_devic= e > > *pdev) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pmc_core_do_dmi_quirk= s(pmcdev); > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pmc_core_dbgfs_regist= er(pmcdev); > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pm_report_max_hw_sleep(((1= UL << 32) - 1) * > > pmc_core_adjust_slp_s0_step(pmcdev, 1)); > >=20 > > Technically this is FIELD_MAX(SLP_S0_RES_COUNTER_MASK) * > > pmc_core_adjust...? > > Where the define is: > > #define SLP_S0_RES_COUNTER_MASK=C2=A0GENMASK(31, 0) >=20 > That's fine by me to switch it over, it certainly makes it a lot more > readable. > I took the value from @Box David E to use suggested in v7, so what are yo= ur > thoughts? Ilpo's suggestion is preferable. The warning comes from using 1UL, long bei= ng 4 bytes on i386. >=20 > The current version has an overflow error reported by the robot for i386,= so > it > definitely needs some sort of change. Resolved by using the macro. With Ilpo's suggestion you can add my reviewed= by. Thanks. David >=20 > >=20 > > >=20 > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0device_initialized = =3D true; > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0dev_info(&pdev->dev, = " initialized\n"); > > > @@ -1214,6 +1215,8 @@ static inline bool pmc_core_is_s0ix_failed(stru= ct > > pmc_dev *pmcdev) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (pmc_core_dev_stat= e_get(pmcdev, &s0ix_counter)) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return false; > > >=20 > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0pm_report_hw_sleep_time((u= 32)(s0ix_counter - pmcdev- > > > s0ix_counter)); > > > + > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (s0ix_counter =3D= =3D pmcdev->s0ix_counter) > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0return true; > > >=20 > > >=20 > >=20 > > -- > > =C2=A0i.