Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp829021imm; Wed, 26 Sep 2018 07:25:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV63XefnOEd3Cfe3fUWNdScdzTSMvfS+5Qjs3KAKftN2Fg3o+p8pW4lK4HxWvWbecpCS49Y4Q X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr6411072plp.33.1537971958870; Wed, 26 Sep 2018 07:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537971958; cv=none; d=google.com; s=arc-20160816; b=l0Fi566QNwGMP9ALbuRUu4KUsW8Z4lsrEg4bH5+2614eFa9prChGNbrT6LcLDS+t3d JmTNKoKXw4mWHxYRelDJX23ptyyWCvCjEzYjqQmoMHaTKfYLYvcDl+Fq7lDoZ4PbatPa XDbktTerK4O3CA8xtrida6ctZLNTPqIo/9NAkWriley2AMsFils4YuWD1zl06JkG+0VZ 1W8y65pUJ9hwc7kT/6KgyBHEF7DNcsrVqy/c/jgbBHu+fa9W0NR9goXut2spz+Exhdi3 fN8Qx0jo0b2g19QBal8EkEDPMat021oppF/DVtATXiiVypws/deKcejoPmW+QS1XgD7/ g0+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=zeTSATIYiaGpYtRxBCziR3Wy2Bhm2Qsh/B6tvj9Fffo=; b=rFE3Zy46rnHIlzo3Ad/jU2Kqhxo2zrcOYZNdGCBs+aCT1jTCpg+BOIE4hUOUk4fIbU WrJx0zYeMRVIR9W6TWUAvRTqrjVB4ARc0AtWCndMljOkarhxOKpIoWK779GqE5+pWz29 v2aI3sV/S2WgFJnQV0UtWxGdCGz+MX6pzbFxjqDXvVuc/t/NaDO0h/Wmu8vRsVQR4tOC EN9SdofkCgqp3g3Yfrk4X1nrz/YXsM7k9Zpy8ZYLavC7oWHWY0sGg+zDrvpbSKspq4uY tx7oZbMtTpnCcQCj7Wm3OdHNKNako+aJsWqo4syhodefQsjbgR1l5mup8C7DrIChUO7e s25Q== 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 u69-v6si476624pgd.353.2018.09.26.07.25.40; Wed, 26 Sep 2018 07:25:58 -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 S1727609AbeIZUiC (ORCPT + 99 others); Wed, 26 Sep 2018 16:38:02 -0400 Received: from mga18.intel.com ([134.134.136.126]:11086 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726841AbeIZUiC (ORCPT ); Wed, 26 Sep 2018 16:38:02 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2018 07:24:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,306,1534834800"; d="scan'208";a="266870072" Received: from rbhardw1-mobl.gar.corp.intel.com (HELO [10.252.74.64]) ([10.252.74.64]) by fmsmga006.fm.intel.com with ESMTP; 26 Sep 2018 07:24:45 -0700 Subject: Re: [PATCH 2/4] platform/x86: intel_pmc_core: Fix LTR IGNORE Max offset To: Andy Shevchenko Cc: Platform Driver , Darren Hart , Andy Shevchenko , Linux Kernel Mailing List , Rajneesh Bhardwaj , Souvik Kumar Chakravarty References: <20180903180415.31575-1-rajneesh.bhardwaj@linux.intel.com> <20180903180415.31575-2-rajneesh.bhardwaj@linux.intel.com> From: "Bhardwaj, Rajneesh" Message-ID: <92d451b5-e6b7-74a2-dc71-19e30654c2f3@linux.intel.com> Date: Wed, 26 Sep 2018 19:54:44 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thank you. On 26-Sep-18 7:27 PM, Andy Shevchenko wrote: > On Mon, Sep 3, 2018 at 9:05 PM Rajneesh Bhardwaj > wrote: >> Cannonlake PCH allows us to ignore LTR from more IPs than Sunrisepoint >> PCH so make the LTR ignore platform specific. >> > This looks fine to me. > >> 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 >> >