Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3100707imm; Fri, 19 Oct 2018 05:14:19 -0700 (PDT) X-Google-Smtp-Source: ACcGV60xjR1T0oYzOKgfWuHMjwVYG7OtGdY7x9PTpdNiMffIJtfdjCuIkzyQgx82NX2otZwTkKc9 X-Received: by 2002:a17:902:a606:: with SMTP id u6-v6mr32565820plq.69.1539951259063; Fri, 19 Oct 2018 05:14:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539951259; cv=none; d=google.com; s=arc-20160816; b=jDXmf/sX+mAMLKFAAimAanTc5MyUU0iPY4JSUuNm5MUuRNsoy6C6oo+D/C293zefqA DTggKuyI7z/mIsJbYWfXT3SA0tXWInL8f1ppyCNtT8aMF563lK2lAforxB8mXB5Qp6PO c6eyuHnxYI7reMdgLUORD0FGOwD7s2WmJL3+BaTWvrS7uYPPOiPntbKauTGaCOlxZhIl 6v4ohykdbMMjMaxOuAPYx3WWPeLUsmcWPr7yXTQPiZrje7dCU1fTByU8AKo2u8Un5zlZ gy2ITRLbhu7N1AZaOV8Uii+Wq+uAEjAt0bYNQTTujmcU/T9qxyApU+71U0Cwsx83NdYk cbkQ== 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=FJwP2bgS/FoVh1EYwS4zKqQD+3FXQyLnh+jfAK9WhLg=; b=C5OzRlPbCc8Y2ZRsWAqxtV794SyAYFQx32oovKA3ISdUnxB8yNg/2KlWJ0FcMRfC7X bV1uNaMZoFV1leyEhotjppQ8Dlm1rznLlZ0omHYHlA8LHeW4wg12akI0OOn4NzC1ntyJ IFCdWahQEa5YMoBAsyKYCmsDjE5ubsrmyIsXyQZRFyyG5vQVwx3aIYMQQNxhRQOaUEyI VqSroAhRMf5b6uDda/De98Y4uF/h9eqqdcIG+qoNpBEXphCpVj13WT9OBXJ7pOztsn0l VR1xccGJLihJ0CeN4FsTQSo2pJkwyeDGH6nHJZ3wVHj4aFQ7+5X87vcLZzdIbPEUdzPd pCMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R6l60hmA; 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 u10-v6si22553478pgr.403.2018.10.19.05.14.03; Fri, 19 Oct 2018 05:14:19 -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=R6l60hmA; 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 S1727574AbeJSUTb (ORCPT + 99 others); Fri, 19 Oct 2018 16:19:31 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46522 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727182AbeJSUTa (ORCPT ); Fri, 19 Oct 2018 16:19:30 -0400 Received: by mail-qt1-f193.google.com with SMTP id d8-v6so37938706qtk.13; Fri, 19 Oct 2018 05:13:40 -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=FJwP2bgS/FoVh1EYwS4zKqQD+3FXQyLnh+jfAK9WhLg=; b=R6l60hmAg9bA2Vo4rlThJil3PGzfmIb2vDpFyhxhHMxqfuak/JAtJE8qglcir0i/pJ /yM5z8nDyaATZJacSBrwEyNjdTGgtr+Fq0HsUDnraDwvR6BdaU+9ls4rRWOM5btiYoy/ kwHUQj2tuahDQ1JTGYngWPGoUqEkctLUdfY245vIN5Hwyd8USH3f3tEmis4SGRZ8v2T1 5SX3USot4t+Nz/AR+73FKMJmBg5IHPzIMg6QzgtwgZmHeDIQGxAiuPIuIKiwvW1/Z2CZ YYZ5RtEdLLXlgL60xthJq9r+gh4FuY1gScDJYev4Q7uH2u7nkSkY0gk+dnjc7gyTiaZO sIyQ== 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=FJwP2bgS/FoVh1EYwS4zKqQD+3FXQyLnh+jfAK9WhLg=; b=OUgW30NWhmjoIFwVrfTLJg0s9y/oOEmpW9Rk+Qt7HrtysA+oGswDv2qMTJqa+J2W5C 8ketD/y4W4d8exdqOawJ1UHzKpBo4iRgi8tF1Gp/rRXr/V3UOdq8rB6A8S2pxtbAFyoA LFxoOdmXmxlRu5yr3uTLYvGf0JzBSgiHHhkLbfTPXKIONmw/Gba4AnojUOPP50Up3HEP Il0M5qCVuo3zWoaU7LhFwJFnmnbs0I03Dp1LdM6cqeX38rhc/3Sl6kpeUb5yDhOm1Cv9 tAOes3DsuAZhPLAJFb0ubdPTMW/GyJqL20YcdAZoakIXpd9ItBm7jv0XnGHCCMVDIKgj CSIw== X-Gm-Message-State: ABuFfohnN+7lYoaAc7vqaRifjBpX5Y4EicBnJM2s/doQN0bIWHKL/CK4 UQYLluIt0CaPXlhswNEKT5Ym0MDhrq0PHIjHdl8= X-Received: by 2002:aed:2de3:: with SMTP id i90-v6mr14268810qtd.229.1539951220173; Fri, 19 Oct 2018 05:13:40 -0700 (PDT) MIME-Version: 1.0 References: <20181006065113.669-1-rajneesh.bhardwaj@linux.intel.com> <20181006065113.669-2-rajneesh.bhardwaj@linux.intel.com> In-Reply-To: <20181006065113.669-2-rajneesh.bhardwaj@linux.intel.com> From: Andy Shevchenko Date: Fri, 19 Oct 2018 15:13:29 +0300 Message-ID: Subject: Re: [PATCH v2 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 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 Sat, Oct 6, 2018 at 9:54 AM Rajneesh Bhardwaj wrote: > > Cannonlake PCH allows us to ignore LTR from more IPs than Sunrisepoint > PCH so make the LTR ignore platform specific. > Pushed to my reviewing and testing queue, thanks! > 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 > -- With Best Regards, Andy Shevchenko