Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp486982imu; Thu, 8 Nov 2018 11:06:00 -0800 (PST) X-Google-Smtp-Source: AJdET5dUR9E92CUHCraKLuu8k2XD+wVEp3IxaN6XE25Ngz5orXsJQfnu/XPlj9nrmTlnr59sPXC5 X-Received: by 2002:a63:df50:: with SMTP id h16mr4797777pgj.421.1541703960141; Thu, 08 Nov 2018 11:06:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541703960; cv=none; d=google.com; s=arc-20160816; b=GSCVPVOR6H4O9Pcdp/BueH7rg/d2x3BhwK2jnm4WJyqAGys43b1kOaAnT7VGFYoVNl pxIe5aJVvKWgcxInYZJTE00Sc8+BHv+DLbY2li4q9nhsA4x7a9fG+Mrq3z/D77OBI7p+ Na+ex2D4sfURU0RwEsf8GuOJ0YBzYeB6ZqtGN0CxGhlnmCRM2ilY/Qft63WEj6LK3bWn K7CPfumJpM/MWpJZVifrR7XPiiwS2HAw0EmnuWur1LsJI4CXpjMrDau2C0hlrwnZL9rY Uyv1LYeL7b6SM8oxkrrnyAXcJF5DLrCe3udf0JakxusM+n4CRU6qrW33bx/1gumNJqqt sX+w== 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=2EeGNtQYWbP238OlqTlbAJyyiS90wHSzw1AhxDQOpxw=; b=aEPEGSuU00Zb56QbDQS4KigGSXT+ckCQZY25E7Si+I8VJP1THR9LQQMK2XH02YuLP1 0OJs2kuUSMjwTilGcKXl6qaAeoVFlfChK2mN6X9a6k7ULI2RdQLzy7FTlpxT2povqdm4 mmb2ZYUSErxcj4BXVioZrwiAUbD4QefpY8qn0xglOFxTdmrEJg9t+fQk5cutd34xoPZl EsA6BX4BYbJl05c+ZA1PZ4dV0/U19RqNfoB17eX/60BLTjSd1IN6EC+iKf5aAm37haqP Dp9+UkxpVVu9jDzPIAo65AMjapmKzaBSK6B57sA5XgAaR2L4avVC/w3/gGvstFMBeaUx rrXQ== 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 28-v6si2518588pfm.51.2018.11.08.11.05.42; Thu, 08 Nov 2018 11:06:00 -0800 (PST) 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 S1727295AbeKIEl7 (ORCPT + 99 others); Thu, 8 Nov 2018 23:41:59 -0500 Received: from mga03.intel.com ([134.134.136.65]:31921 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726801AbeKIEl6 (ORCPT ); Thu, 8 Nov 2018 23:41:58 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Nov 2018 11:05:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,480,1534834800"; d="scan'208";a="278248081" Received: from rajneesh-desk.iind.intel.com ([10.223.86.34]) by fmsmga005.fm.intel.com with ESMTP; 08 Nov 2018 11:05:05 -0800 From: Rajneesh Bhardwaj To: platform-driver-x86@vger.kernel.org Cc: dvhart@infradead.org, andy@infradead.org, linux-kernel@vger.kernel.org, srinivas.pandruvada@linux.intel.com, Rajneesh Bhardwaj Subject: [Patch v4 2/3] platform/x86: intel_pmc_core: Fix LTR IGNORE Max offset Date: Fri, 9 Nov 2018 00:32:43 +0530 Message-Id: <20181108190244.19204-2-rajneesh.bhardwaj@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181108190244.19204-1-rajneesh.bhardwaj@linux.intel.com> References: <20181108190244.19204-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 54080c0e52fb..0c18f328cd0d 100644 --- a/drivers/platform/x86/intel_pmc_core.c +++ b/drivers/platform/x86/intel_pmc_core.c @@ -137,6 +137,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 */ @@ -307,6 +308,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) @@ -553,7 +555,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 fcb13ca1f2bd..e57b26cdb442 100644 --- a/drivers/platform/x86/intel_pmc_core.h +++ b/drivers/platform/x86/intel_pmc_core.h @@ -35,7 +35,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 @@ -146,6 +146,7 @@ enum ppfear_regs { #define CNP_PMC_MMIO_REG_LEN 0x2000 #define CNP_PPFEAR_NUM_ENTRIES 8 #define CNP_PMC_READ_DISABLE_BIT 22 +#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 @@ -208,6 +209,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