Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1289762imm; Fri, 5 Oct 2018 23:54:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV63GZCBCyu0AsO8TEzVEUrSiTkR3E/sDUpnLjv2A8ElKOppzqfwVWUAWnIO6Hj/IpDMvtQQs X-Received: by 2002:a62:1a16:: with SMTP id a22-v6mr15287865pfa.237.1538808861236; Fri, 05 Oct 2018 23:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538808861; cv=none; d=google.com; s=arc-20160816; b=TbSpB7Hect7qVRQ4sXvgiVb7fiFVugwgHgceJYrV+oHsfsj97urI7cOdw5I5Ypa3wz 6kcvla8vuSn79FGt8HzB0c9TnFdLKDsv9bNhsVHfK2pnSeQzY5b0rc6rPQPUjqHyeScB GeIMN6diwTmhlEF693lpUL70VKNx4VrJNoTRAw5sf72xq5s0umJekAx11cBwJqvBWdE6 nXFR83kOUIqYWUMyBOSeFCSUgVsjVJ2cGnVKuAN+vQlyaaLIHW1WosmoABwhljgUcteD 7dZbJ2+WiaJT8mSfLWrMwIaDRjNQZZleQfSZPbGBoQlk4sCF+UjN9RklYkOpx5xORVaF cacw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=17xTWblUS/a+IElT9lGVBTm8Fwt8ufsRVNzGo/E/bx0=; b=u7YMIVn+0yF91moOnL0bRmlMif9G4xcF2p0CbYEo/SnBrs0VFYFjDfw8iKYODbg+5Y 4FYfrzFY/ApH6s8UWrKpQCWy09P4X/gN7beRhdtpYfJAp+zw82vhi+cVGwqy8uRc8urz F8k46RG70Dd5h3oJFFS3UaeYEEkPoHEHt9TK10irk20kmzrSi7fN1XdMTVVjyOLwXodt QPlazpGZ6tdkQlmmBeUtSiT5GfpbPxhYs3z0hGviN5iLmehHPkzSrwL7yrQV/sVCknQP hbnprTUukEAdDLtOVKR/ie7Eej+qqzOZeRPtxNl7XjtnxOR56zGk04+KY1iBFvYINCqr nj9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si10922423plh.206.2018.10.05.23.54.05; Fri, 05 Oct 2018 23:54:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727784AbeJFN4K (ORCPT + 99 others); Sat, 6 Oct 2018 09:56:10 -0400 Received: from mga03.intel.com ([134.134.136.65]:23257 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbeJFN4J (ORCPT ); Sat, 6 Oct 2018 09:56:09 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2018 23:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,347,1534834800"; d="scan'208";a="79200385" Received: from rajneesh-desk.iind.intel.com ([10.223.86.34]) by orsmga008.jf.intel.com with ESMTP; 05 Oct 2018 23:52:43 -0700 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, rajneesh.bhardwaj@intel.com, Rajneesh Bhardwaj Subject: [PATCH v2 2/4] platform/x86: intel_pmc_core: Fix LTR IGNORE Max offset Date: Sat, 6 Oct 2018 12:21:11 +0530 Message-Id: <20181006065113.669-2-rajneesh.bhardwaj@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006065113.669-1-rajneesh.bhardwaj@linux.intel.com> References: <20181006065113.669-1-rajneesh.bhardwaj@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Cannonlake PCH allows us to ignore LTR from more IPs than Sunrisepoint PCH so make the LTR ignore platform specific. Signed-off-by: Rajneesh Bhardwaj --- drivers/platform/x86/intel_pmc_core.c | 4 +++- drivers/platform/x86/intel_pmc_core.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel_pmc_core.c b/drivers/platform/x86/intel_pmc_core.c index 217a822a8da1..c616cfedf2be 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -148,6 +148,7 @@ static const struct pmc_reg_map spt_reg_map = { .ppfear_buckets = SPT_PPFEAR_NUM_ENTRIES, .pm_cfg_offset = SPT_PMC_PM_CFG_OFFSET, .pm_read_disable_bit = SPT_PMC_READ_DISABLE_BIT, + .ltr_ignore_max = SPT_NUM_IP_IGN_ALLOWED, }; /* Cannonlake: PGD PFET Enable Ack Status Register(s) bitmap */ @@ -319,6 +320,7 @@ static const struct pmc_reg_map cnp_reg_map = { .ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES, .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET, .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT, + .ltr_ignore_max = CNP_NUM_IP_IGN_ALLOWED, }; static inline u8 pmc_core_reg_read_byte(struct pmc_dev *pmcdev, int offset) @@ -565,7 +567,7 @@ static ssize_t pmc_core_ltr_ignore_write(struct file *file, const char __user goto out_unlock; } - if (val > NUM_IP_IGN_ALLOWED) { + if (val > map->ltr_ignore_max) { err = -EINVAL; goto out_unlock; } diff --git a/drivers/platform/x86/intel_pmc_core.h b/drivers/platform/x86/intel_pmc_core.h index 7a00436e337d..7f8181057ec8 100644 --- a/drivers/platform/x86/intel_pmc_core.h +++ b/drivers/platform/x86/intel_pmc_core.h @@ -44,7 +44,7 @@ #define SPT_PMC_READ_DISABLE_BIT 0x16 #define SPT_PMC_MSG_FULL_STS_BIT 0x18 #define NUM_RETRIES 100 -#define NUM_IP_IGN_ALLOWED 17 +#define SPT_NUM_IP_IGN_ALLOWED 17 #define SPT_PMC_LTR_CUR_PLT 0x350 #define SPT_PMC_LTR_CUR_ASLT 0x354 @@ -154,6 +154,7 @@ enum ppfear_regs { #define CNP_PPFEAR_NUM_ENTRIES 8 #define CNP_PMC_READ_DISABLE_BIT 22 #define CNP_PMC_LATCH_SLPS0_EVENTS BIT(31) +#define CNP_NUM_IP_IGN_ALLOWED 19 #define CNP_PMC_LTR_CUR_PLT 0x1B50 #define CNP_PMC_LTR_CUR_ASLT 0x1B54 #define CNP_PMC_LTR_SPA 0x1B60 @@ -216,6 +217,7 @@ struct pmc_reg_map { const u32 pm_cfg_offset; const int pm_read_disable_bit; const u32 slps0_dbg_offset; + const u32 ltr_ignore_max; }; /** -- 2.17.1