Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp795575imm; Wed, 26 Sep 2018 06:59:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV63xvg22oXlpaAlc3KAhaxJJ/Fj+DaYlbk/z515XSGbWfn89aDYN+zzHtm2wCEMpN2kvgmIO X-Received: by 2002:a63:4c16:: with SMTP id z22-v6mr6051870pga.312.1537970367419; Wed, 26 Sep 2018 06:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537970367; cv=none; d=google.com; s=arc-20160816; b=cKg6+hIPYUKRRW2y+V+1gJBNWCVz7jID4cTzODAIwtdVMnl+FscAtIA8eGMnAQVzLq BrRrf5SDFw0iYjuoNnWr35Tp1ewuVp3PGSvGNWH58HA/6qpdLS64rqsrQ5Li64TtT82K IXhVTqM6X5pAcaFwbBQ++Fxer9wa76L5cIjJcBtylEkkbwaCRL49wBB8UVS4TpwVtE4q dsCzc2z+Izkwvr3QEvbZVduQ/lRkNbCQo+v2aYXp4CbYEyUzirSLbOIrfv9o9De92Fjy c/0ZHSquZg34dCjMjIUTvnTBZQfdVkgAjZPPOB26KWCTcmj+Pecd+rafFXX6n5d+4nyM /Fsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Q3VmB7Ot6GmKtuvhY4iOwR40nBrw3cZ9AokfNRmhSuA=; b=HWrMhNK540H4XAm5VGbNKb4xkGyJYJ/BXtNIcIlAXgJPVmlWbIw8KXxHy2OHCjc8BF CbkP9e8jbK85kLIbuwdPuxj9F8dwIX+V8eMwMRW8n0fuxc3SHORla2g8ZX9LHvkCnIFw Q9B6srF916PPO27SJouYbj/Vq9kskj6v4xBydl3iTZNFKFQ1L4ppVJdzWQMFBYzQ7ts0 4XBsBzdwwnrhEL2VUaf6xNF2v/W1wCFj2Kgmg6x640lztBboc32aHjpfFw2FDQKflFHy IE0egvCdLOHnlmJYXyHvvVLB8ds/i0YhzFE5O/el+JEGArUcyKqPeWFQHrql9w5sC3+2 +U6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vfX9mYL4; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20-v6si3727474pgm.192.2018.09.26.06.59.11; Wed, 26 Sep 2018 06:59:27 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vfX9mYL4; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727493AbeIZUKk (ORCPT + 99 others); Wed, 26 Sep 2018 16:10:40 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:38565 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726880AbeIZUKk (ORCPT ); Wed, 26 Sep 2018 16:10:40 -0400 Received: by mail-qk1-f193.google.com with SMTP id s129-v6so12917116qke.5; Wed, 26 Sep 2018 06:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Q3VmB7Ot6GmKtuvhY4iOwR40nBrw3cZ9AokfNRmhSuA=; b=vfX9mYL4yBOAvv0gyFScuiVDFzxAGwLcQFxop/kdxUDruXNRkzIQJAiGqwa8oMMjoo aiBf8LfZZ2H0Dt64vygxnBUP94JdesaVkF19OgUq72/WBQTvhtJzfe61S+3Q7khHfdS1 fC84xZbK+4mY4vt3Kxku9EpNOMxwlcbvL2TKH51rXiJZB4QFMINb47xGX65JIGKPY/eo OlrpjZfBB7HUPEeJOTrFIpdI3bg6Y5A4qCgKut2BA7STsD+FK7Wp42gIQCbi0WnmxMtp PqaeFe9tmXdKHOB5YpeNSg0K8NPVSA3BHXs5fThbpcvDjijCwpToVm3tHBpILhxQPeqZ zw6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Q3VmB7Ot6GmKtuvhY4iOwR40nBrw3cZ9AokfNRmhSuA=; b=FVo0ej69FcL2vdwGQDP2UstGhmNAwXpP13Z/YN9rDi2OMH7vK2IxN0ABiaP9DVfAUP tRTEwG9iEslQqDm0tUazGQ5WCaeimSfZmONJtldbr0fCRwEeom701LMjJmgYjHYyNpBg P5SE4hIXf4KMplsF6mBVkg5mVtRG7n/ScJwTaW9eQPnE2FBAuZvEZUCDrD21Jtfjbfyj tniRrCABkQuAd3vqoCPQjrDL4MnA3qpSE3W4B47r8C8UiQyAwgC8kpSKMm7FkOVPa4w3 gegnoGCW1JSce82H3QByW8pM6GAffd4XM186PWhSaa+8sC2LwsSbx0DiA+ZiFClrUe/J N05g== X-Gm-Message-State: ABuFfoh22wLjC9M8H7irl8bYyyxi79VZPi+qXL2Il5uu7w9/SdWxFVre QVOimWsRxeuBOa/vep+ajOVhpot4skawDPev3D0= X-Received: by 2002:ae9:e50d:: with SMTP id w13-v6mr4357157qkf.137.1537970254832; Wed, 26 Sep 2018 06:57:34 -0700 (PDT) MIME-Version: 1.0 References: <20180903180415.31575-1-rajneesh.bhardwaj@linux.intel.com> <20180903180415.31575-2-rajneesh.bhardwaj@linux.intel.com> In-Reply-To: <20180903180415.31575-2-rajneesh.bhardwaj@linux.intel.com> From: Andy Shevchenko Date: Wed, 26 Sep 2018 16:57:23 +0300 Message-ID: Subject: Re: [PATCH 2/4] platform/x86: intel_pmc_core: Fix LTR IGNORE Max offset To: rajneesh.bhardwaj@linux.intel.com Cc: Platform Driver , Darren Hart , Andy Shevchenko , Linux Kernel Mailing List , Rajneesh Bhardwaj , Souvik Kumar Chakravarty Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > -- With Best Regards, Andy Shevchenko