From patchwork Mon Feb 10 14:11:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacob Pan X-Patchwork-Id: 3623941 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 582419F2D6 for ; Mon, 10 Feb 2014 22:11:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D954201E9 for ; Mon, 10 Feb 2014 22:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1D30201CD for ; Mon, 10 Feb 2014 22:11:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbaBJWLY (ORCPT ); Mon, 10 Feb 2014 17:11:24 -0500 Received: from mga09.intel.com ([134.134.136.24]:37364 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752085AbaBJWLX (ORCPT ); Mon, 10 Feb 2014 17:11:23 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 10 Feb 2014 14:06:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,820,1384329600"; d="scan'208";a="481203188" Received: from jacob-desktop.jf.intel.com ([10.7.198.71]) by orsmga002.jf.intel.com with ESMTP; 10 Feb 2014 14:11:03 -0800 From: Jacob Pan To: Linux PM , Rafael Wysocki , Srinivas Pandruvada Cc: vince@deater.net, Jacob Pan Subject: [PATCH 1/2] powercap/intel_rapl: relax sanity check on energy counters Date: Mon, 10 Feb 2014 06:11:51 -0800 Message-Id: <1392041512-15769-1-git-send-email-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DATE_IN_PAST_06_12, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some RAPL domains may not be active at the time driver is being loaded. Checking energy counter increment may be too strict and time consuming. So relax the sanity check on energy counters of these domains. Otherwise, they may be ignored and become unavailable to the powercap framework. Signed-off-by: Jacob Pan --- drivers/powercap/intel_rapl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c index 3c67683..0e37fe1 100644 --- a/drivers/powercap/intel_rapl.c +++ b/drivers/powercap/intel_rapl.c @@ -1147,6 +1147,11 @@ static int rapl_check_domain(int cpu, int domain) if (rdmsrl_safe_on_cpu(cpu, msr, &val1)) return -ENODEV; + /* PP1/uncore/graphics domain may not be active at the time of + * driver loading. So skip further checks. + */ + if (domain == RAPL_DOMAIN_PP1) + return 0; /* energy counters roll slowly on some domains */ while (++retry < 10) { usleep_range(10000, 15000);