From patchwork Wed May 25 20:13:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Darren Hart X-Patchwork-Id: 9136155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39A00607D7 for ; Wed, 25 May 2016 20:13:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 294D527BE4 for ; Wed, 25 May 2016 20:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0A428299; Wed, 25 May 2016 20:13:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 82AEC27BE4 for ; Wed, 25 May 2016 20:13:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbcEYUNx (ORCPT ); Wed, 25 May 2016 16:13:53 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:54029 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751042AbcEYUNx (ORCPT ); Wed, 25 May 2016 16:13:53 -0400 Received: from dvhart by bombadil.infradead.org with local (Exim 4.80.1 #2 (Red Hat Linux)) id 1b5fBf-0007Rl-Az; Wed, 25 May 2016 20:13:51 +0000 Date: Wed, 25 May 2016 13:13:53 -0700 From: Darren Hart To: Rajneesh Bhardwaj Cc: platform-driver-x86@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org, olof@lixom.net, tglx@linutronix.de, hpa@zytor.com, dbasehore@google.com, vishwanath.somayaji@intel.com Subject: Re: [PATCH v6] platform:x86: Add PMC Driver for Intel Core SoC Message-ID: <20160525201353.GA109010@f23x64.localdomain> References: <1464198292-32356-1-git-send-email-rajneesh.bhardwaj@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1464198292-32356-1-git-send-email-rajneesh.bhardwaj@intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: platform-driver-x86-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, May 25, 2016 at 11:14:52PM +0530, Rajneesh Bhardwaj wrote: > This patch adds the Power Management Controller driver as a PCI driver > for Intel Core SoC architecture. > > This driver can utilize debugging capabilities and supported features > as exposed by the Power Management Controller. > > Please refer to the below specification for more details on PMC features. > http://www.intel.in/content/www/in/en/chipsets/100-series-chipset-datasheet-vol-2.html > > The current version of this driver exposes SLP_S0_RESIDENCY counter. > This counter can be used for detecting fragile SLP_S0 signal related > failures and take corrective actions when PCH SLP_S0 signal is not > asserted after kernel freeze as part of suspend to idle flow > (echo freeze > /sys/power/state). > > Intel Platform Controller Hub (PCH) asserts SLP_S0 signal when it > detects favorable conditions to enter its low power mode. As a > pre-requisite the SoC should be in deepest possible Package C-State > and devices should be in low power mode. For example, on Skylake SoC > the deepest Package C-State is Package C10 or PC10. Suspend to idle > flow generally leads to PC10 state but PC10 state may not be sufficient > for realizing the platform wide power potential which SLP_S0 signal > assertion can provide. > > SLP_S0 signal is often connected to the Embedded Controller (EC) and the > Power Management IC (PMIC) for other platform power management related > optimizations. > > In general, SLP_S0 assertion == PC10 + PCH low power mode + ModPhy Lanes > power gated + PLL Idle. > > As part of this driver, a mechanism to read the SLP_S0_RESIDENCY is exposed > as an API and also debugfs features are added to indicate SLP_S0 signal > assertion residency in microseconds. > > echo freeze > /sys/power/state > wake the system > cat /sys/kernel/debug/pmc_core/slp_s0_residency_usec > > Signed-off-by: Rajneesh Bhardwaj > Signed-off-by: Vishwanath Somayaji Hi Rajneesh, Unfortunately during my build test, this introduced a new warning to the build: drivers/platform/x86/intel_pmc_core.c:201:19: warning: ‘intel_pmc_core_init’ defined but not used [-Wunused-function] static int __init intel_pmc_core_init(void) After the removal of the module stuff, the driver needed a device_initcall, or the macro equivalent, consider: $ git diff diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index c834281..f6a29b9 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -198,7 +198,4 @@ static struct pci_driver intel_pmc_core_driver = { .remove = NULL, /* not a hot-plug capable driver */ }; -static int __init intel_pmc_core_init(void) -{ - return pci_register_driver(&intel_pmc_core_driver); -} +builtin_pci_driver(intel_pmc_core_driver);