Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2444359imd; Fri, 2 Nov 2018 11:29:46 -0700 (PDT) X-Google-Smtp-Source: AJdET5eRHsMO8qlX+oLHLvnS8M7c1Utx4bw5BYMncG5fnVnE01gb41ARqwskkflnZPYyEHLhVpsr X-Received: by 2002:a63:7d0f:: with SMTP id y15-v6mr2209842pgc.171.1541183386437; Fri, 02 Nov 2018 11:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541183386; cv=none; d=google.com; s=arc-20160816; b=aQVpJ47bk8GodlZlNN4kf0I7gsrq6UTeRmpv3Gqi8o27lsc3I4zTbiTXQ+FTA2Ikda LcMO0cnsVMWvjU8MqkEugQsNAcqdxdvde+UEj4EYPrh26dpuoEkuWYyxS6j00AIdbjrU orEyTdQj7oPsIYn4JFdVGUQXuSNKvhAjsN+5miQLwnconATVlByA6uU76rBQ+NZdlgO/ j55+jy3tro/r5lY/OFBKqhRCZ8ytbZ2Y1hYDCKZbWEb0u2bmcU8ht9TZ4fHPmH+0JV5Q 5sAKidwuQBCkRNjsGPMhD4Js7gGAL7SYKpyfjYG24AHU2WnTwevfOUZXxWUBHhAQ7Nbo oZPQ== 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=R/95QvQYdgLcnWwVdJz8gKv25pRkUN+WGIMqBdOVIpk=; b=Nj4NorqqN0QAsbFsu62VjKPvLtAKkSRBp6/+DK5u46aEUhpITNy9XHS0TvExOMSDoF 4uz3elqGRxBlDOBUJoVdU0UnTOgqAzjxwliPd3/lLjzRcvRkzgom14v87xQ+SrdLywNc XjWXV50DXD1S3HpiNoJE24UX7L/mUOUQ3hqRL7hBANYpsebtDJDxLgOOhcTREbJ2iWzp c2eh+49DgA4EnyyndExG41g/S141/fybDDWZ2syZUAGStwmCqeha1weTYklO2bUqCVBd blBB/Qx9WfSci7/N4u4x49qheUn3PBPZpPNBpZ3gO0I2qIDKl8ri4qqEZiLBJU/NppOt lzvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=V2EAcrjj; 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 v15-v6si1448518pfd.125.2018.11.02.11.29.31; Fri, 02 Nov 2018 11:29:46 -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=V2EAcrjj; 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 S1728116AbeKCDhM (ORCPT + 99 others); Fri, 2 Nov 2018 23:37:12 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36561 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726700AbeKCDhM (ORCPT ); Fri, 2 Nov 2018 23:37:12 -0400 Received: by mail-qk1-f194.google.com with SMTP id o125so4576497qkf.3; Fri, 02 Nov 2018 11:29:03 -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=R/95QvQYdgLcnWwVdJz8gKv25pRkUN+WGIMqBdOVIpk=; b=V2EAcrjjVdBPEtSp9cDL1qrxB2l8Rnrvo78I2PIxWxkjzt1vBLo/UmESmZj/3WT7Hw lAnK/lbianxjzdhyIGYbapStYGECA50HMNLHyBBCmNwb8H0d49UEcqHppFtSzkd3adNd OQxdI5/gJZNHFZLbShR9sfHB6dlRPDQ060S8mONru8VBsDZteYEzZMxjMQOxtwY05zHf AaiXUfZfKTM9rvdMzTMNsiIZQGjNGRRQ65JY2opZPTYtRig7xKxsQYFp8fxrjcNWdFFW lKWH5Wvc2RLC8ZMWL7oOiLfzmU6EMZAc196VlLmox92R0iiJnAsNxHPsZBVJsqshYFo1 jG8g== 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=R/95QvQYdgLcnWwVdJz8gKv25pRkUN+WGIMqBdOVIpk=; b=BUrv1xNRxO7yOB4JjaysIl6GYmuqk2/tT8UaUNh0f4qwA5XKVlKgylsVyyJ0qAPnFG c8PF/K6YEmqJfwcm/72V6Jiz6rNEKU8VnPHGJaigdOHgAZl3fYj09YUtyocOdgp8Bq95 nyRx0roaItMXycUO637P4DZba3td0BZ1g24wJXKQR4aCOjgePvfdMvwASolE8fJqyz3m /X3Gj49DsgSh/2lx7bkEzx+2O2X0UWyn2/XkkBPEkdSPBT5ToHOQonwGE9vXWVG/+laf 0C6IUu/WS1+ASCxKOrCD0fxGgE2C21jdPw/HkIUkbsJ7B8yewWqXCaK7rre7FTqnh6h5 v47g== X-Gm-Message-State: AGRZ1gKzFQavK2ghQYaG7F9fO4zob1t7Vtq5yuqw7xRM8oTi9uBGlnCV 2uhRJz/Ue7OQqy8T2xJxWBxoC4VDNLdc6iBegr0= X-Received: by 2002:a37:c3c3:: with SMTP id r64mr11606173qkl.70.1541183343185; Fri, 02 Nov 2018 11:29:03 -0700 (PDT) MIME-Version: 1.0 References: <20181102102703.21846-1-rajneesh.bhardwaj@linux.intel.com> <20181102102703.21846-2-rajneesh.bhardwaj@linux.intel.com> In-Reply-To: <20181102102703.21846-2-rajneesh.bhardwaj@linux.intel.com> From: Andy Shevchenko Date: Fri, 2 Nov 2018 20:28:52 +0200 Message-ID: Subject: Re: [PATCH v3 2/3] 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 , Srinivas Pandruvada 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 Fri, Nov 2, 2018 at 12:29 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 one fine, 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 69270888558b..11e8ecde95f0 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