From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753236AbdKXCvQ (ORCPT ); Thu, 23 Nov 2017 21:51:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:30577 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751749AbdKXCvP (ORCPT ); Thu, 23 Nov 2017 21:51:15 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,444,1505804400"; d="scan'208";a="8852289" From: "Chakravarty, Souvik K" To: Andy Shevchenko CC: Platform Driver , "dvhart@infradead.org" , Andy Shevchenko , "linux-kernel@vger.kernel.org" , "Bhardwaj, Rajneesh" Subject: RE: [PATCH v2 2/4] platform/x86: intel_telemetry: Fix suspend stats Thread-Topic: [PATCH v2 2/4] platform/x86: intel_telemetry: Fix suspend stats Thread-Index: AQHTYpJFGXxp2IevNUyXTZ1Uw4lOD6MiIc0AgAC1ksA= Date: Fri, 24 Nov 2017 02:51:08 +0000 Message-ID: <5F7315E704FA0841B5DFCE90329B2BB46629311B@BGSMSX102.gar.corp.intel.com> References: <1511274984-6165-1-git-send-email-souvik.k.chakravarty@intel.com> <1511274984-6165-3-git-send-email-souvik.k.chakravarty@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDY1Y2NiN2QtZGMyOS00YTc4LTk4ZjgtYzZjZDMzNzkzNDMyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJmTTNxZkkyc0E5emdLUkVnbVFiNWJYNVo5NFwvNHcxZkVYcFordm9XVituMnNjbXBIYlBmZDNYSXd1aElldEZZaCJ9 dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.223.10.10] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vAO2pLEW019849 On Fri, November 24, 2017 at 2:55 AM, Andy Shevchenko wrote: > On Tue, Nov 21, 2017 at 4:36 PM, Souvik Kumar Chakravarty > wrote: > > Suspend stats are not reported consistently due to a limitation in the > > PMC firmware. This limitation causes a delay in updating the s0ix > > counters and residencies in the telemetry log upon s0ix exit. As a > > consequence, reading these counters from the suspend-exit notifier may result > in zero read. > > > > This patch fixes this issue by cross-verifying the s0ix residencies > > from the GCR TELEM registers in case the counters are not incremented > > in the telemetry log after suspend. > > > > This fixes https://bugzilla.kernel.org/show_bug.cgi?id=197833 > > > > We also remove unnecessary 'static' qualifiers from local variables. > > > > Reported-and-tested-by: Rajneesh Bhardwaj > > > > Signed-off-by: Souvik Kumar Chakravarty > > > > > - static u32 suspend_shlw_ctr_exit, suspend_deep_ctr_exit; > > - static u64 suspend_shlw_res_exit, suspend_deep_res_exit; > > struct telemetry_debugfs_conf *conf = debugfs_conf; > > + u32 suspend_shlw_ctr_exit, suspend_deep_ctr_exit; > > + u64 suspend_shlw_res_exit, suspend_deep_res_exit; > > int ret, index; > > > + if (suspend_shlw_ctr_exit == suspend_shlw_ctr_temp && > > + suspend_deep_ctr_exit == suspend_deep_ctr_temp) { > > kbuildbot is absolutely right. How this code is supposed to work? It's flaky. suspend_shlw_ctr_exit & suspend_deep_ctr_exit have already been initialized before this comparison (comparing the counters before and after sleep). I will explicitly initialize them so that kbuildbot does not complain. > > Please, redesign this approach. > > -- > With Best Regards, > Andy Shevchenko