Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1852970imm; Mon, 3 Sep 2018 11:07:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaEk474pMGaJOMPeUDvYXkSqkHnJtTR+d3ECFRIGINKMIZXQR5hkSgGVMkSDOQqxnBoXTjk X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr27497587pgi.306.1535998074167; Mon, 03 Sep 2018 11:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535998074; cv=none; d=google.com; s=arc-20160816; b=vGSCmWEIvhesBCskgjO5rx61yAUs5to1aPFUhDsZgmPwTyfCcqg/NqE+gYQqtDHYuM RixrXs5fm73pZAxW/O7Ak8X//lGOMIy8u3J5ExymNewn3rUDm+clT7GW7T5DhwvUfxc3 74eCxRHNb1pC3AfnGLnhHgPc+7I6HRUJHITGndHG607hTkmFOYQV4RumWf2qto7wOj2U ob4SsCq60m5anF37pGhM7e0XT1NsDXlaF6Zl8JvDPYiB9ktpksZ9WMoFPvX4qiuArbcN +85tB2NFcPA8e6Q2aoNP/b8koKdmKotmnvJ6XchkB3iekb6DiR7XbApOKRPJ3jMXzkeA uiZg== 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:arc-authentication-results; bh=gDLxfRkHB9VEvDW9C+vx87kSIBtO9N2KT1HEL7eNZ68=; b=LRQXy4L+Ken+rPXKSfiNUxOp/JQk9v09OuG3A1JnwkKZU0524yGbBU1zrSzDJCHv31 Vwx4ltJoc7anODZov/C4mR7NC1x1wVLbnzd70Kmad9V+hS61SZhCtbxiTfa5v+WYJ6Me lErIoNTEUM5aQkMpoH3BoWK8J6DNA+7nBwDwtw1NmbrSyn9NXK/ncgEvvmAYfkAAoChp o4MPni+zPoOUMJXa/WpBdZFKLh0Fg9cSpCOIkK0eeAnlMRIDB2GSNmLKEOfF17xLLGBx TZw/jvFzAsSwY5sor7y7WDNUon1s3Z11DEdoMPm9qyZfKqZskhYtRnz+O9rSZ0x6xTkr 27Mg== 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 b1-v6si18425219pld.108.2018.09.03.11.07.39; Mon, 03 Sep 2018 11:07:54 -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 S1727601AbeICW0S (ORCPT + 99 others); Mon, 3 Sep 2018 18:26:18 -0400 Received: from mga05.intel.com ([192.55.52.43]:31017 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727389AbeICW0S (ORCPT ); Mon, 3 Sep 2018 18:26:18 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2018 11:04:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,326,1531810800"; d="scan'208";a="88629488" Received: from rajneesh-desk.iind.intel.com ([10.223.86.34]) by orsmga002.jf.intel.com with ESMTP; 03 Sep 2018 11:04:56 -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, souvik.k.chakravarty@intel.com, Rajneesh Bhardwaj Subject: [PATCH 2/4] platform/x86: intel_pmc_core: Fix LTR IGNORE Max offset Date: Mon, 3 Sep 2018 23:34:13 +0530 Message-Id: <20180903180415.31575-2-rajneesh.bhardwaj@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180903180415.31575-1-rajneesh.bhardwaj@linux.intel.com> References: <20180903180415.31575-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 972735bd4c75..c1330a03523d 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -149,6 +149,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 */ @@ -320,6 +321,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) @@ -566,7 +568,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 b24407048fa1..12663c58f122 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 #define SPT_PMC_LTR_SPA 0x360 @@ -153,6 +153,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 @@ -215,6 +216,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