Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1167373pxf; Fri, 12 Mar 2021 03:39:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiSKGAdioEUobsrT/upOQHMp+WjHXIajBnESVnC95pHQGgKfgBLEDiLsddKOyAompty/xw X-Received: by 2002:a05:6402:704:: with SMTP id w4mr14189240edx.175.1615549176459; Fri, 12 Mar 2021 03:39:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615549176; cv=none; d=google.com; s=arc-20160816; b=FUVG3Yi37b8d8QxRSWqSh2jbrG/2oznC+VFjJj1OU66HRD8cD1orwg0vCWG/iXyzPv GZhe5D7iGIXUlp9RVca97bZJu0YzXl3YIz1mJz71PMGieBS6W5sSVRHV7cFx8Ef0aXQv o8FYqFAaSpbOJnv4ipqdVlpnq4spWKdodGMtyC2Yzpp3mCdipI/olODLdYF3yT/W/ubm RGPbPWOzTdkgjIZvwpiZylg3h5JelZn3JZ1LVmPnvsulIIyB+fmnxIs6Mei4tQ4IYQN7 RlJK3lsYgQ61TYVc/OdvYbTOwPQM12PfGqzUnXR1yXCu9U/f3E5MP8TaCSt7x/CWlVMc n5Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=X0qqxn9d92aoqYJoz6Fe423j5eYy1VZ6WOqrH+BLQFc=; b=0ex13HZmMMrKh64OBfODkYTjeFBrGyZZU9766EOQxeVyJJcI0mMuZ+GMUXLsK6tJtH xlvMGdEQ4WD8hTFWx3X0tpO4CuC5ky6QWhxBqMeM1Fom1pgK0FPfm2q+XFT9BRrtdOh7 hU64U4/n8yIZ4CUYxfLhJ5BbIjbfApX1hL8qQDWBhaEoM/C4yH5mJzUTogUHa02W6rgl UpvyOOoZ7nPajupFumNhOpugC/R9fkhcnze1q1HpLNYDxg1nzhhYgxyyS4/G/MGQVm1I hINlH6cfXg2r/dG6pIGwaJgjYICL/PIjDzpLeKdtLUHagvrHKKZVZElr8ThH/Rds/0tt vpHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=WTH1Ss5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si4097324ejt.685.2021.03.12.03.39.14; Fri, 12 Mar 2021 03:39:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@telus.net header.s=google header.b=WTH1Ss5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=telus.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231500AbhCLG0e (ORCPT + 99 others); Fri, 12 Mar 2021 01:26:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231640AbhCLG0O (ORCPT ); Fri, 12 Mar 2021 01:26:14 -0500 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 877A4C061574 for ; Thu, 11 Mar 2021 22:26:14 -0800 (PST) Received: by mail-il1-x129.google.com with SMTP id g9so1639148ilc.3 for ; Thu, 11 Mar 2021 22:26:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telus.net; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=X0qqxn9d92aoqYJoz6Fe423j5eYy1VZ6WOqrH+BLQFc=; b=WTH1Ss5QdJSCirAjYWLMEp+yc+UiudzJNNNJD/XYVANXtdKSg1/KqijdnMRh1EW4CQ NM7zlpykBtbl8Unb5uM/h+iwpngfHHuYgLsBUSZFcuuF2kVLotiQO4U0vuqpQIuiLW2h NwTtuJlREvXUAmcLfl1ODO905+dKyAZsRrlIC9bLpmZLndIpPjDURSZAD/GGvLwRi/2Q iejTVZwUDgGOBe7Ris9P2gWZWR/8ToDIM+y63XAFivjW/HHMeZFdF1zO6SIvT6yF+MXt dVzzfQQGWQSKCzmPInyxo/9fSLA6P+Ck3neNwEE0fXQFWMMIYfFDykthUcFWq4DqZpZN s9Ig== 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=X0qqxn9d92aoqYJoz6Fe423j5eYy1VZ6WOqrH+BLQFc=; b=DjBpIIHCzny+EQUMxu3Cy8xkk5Mb8Lgdq6vaW/ipzc3n/5NbzWrVA8crClaWD0mYgG Kr3MuOHat32/pQMeHknyKaoesxTvIfEVrJvE+iqsjsdCivSLsTsMCDyusjZ8KVrqfi95 E5EBTyvvDZSy+4ehlQlDx6NPj72mpbijhT9jU0FMDSgE1IICrZMJ+85DnzLQ2ttOsWjr B0+ObpBrJcqkm/6wDBQai4AnRIklaZpaGGcn/V8gkoSL5fdyAHd527FYinqnZsbzUM68 OvCPJMsrZAehfwB7pdKb5sLHNN0mo54pK6jcBAZHoZWAFrH44Ye2yDW1LBcagVYOvSU7 hsFQ== X-Gm-Message-State: AOAM533Vn/XT31/5nilD5JHujNlU8s4rWqTbm5RLIHrYHTNmK+QbPpZu WroJBN6Pr8Pbide+PlJXFY8KzAP6XgJG9vhLgXiFRg== X-Received: by 2002:a92:6511:: with SMTP id z17mr1715365ilb.232.1615530374036; Thu, 11 Mar 2021 22:26:14 -0800 (PST) MIME-Version: 1.0 References: <20210116170725.5245-1-dsmythies@telus.net> In-Reply-To: From: Doug Smythies Date: Thu, 11 Mar 2021 22:26:02 -0800 Message-ID: Subject: Re: [PATCH] tools/power/x86/turbostat: Fix TCC offset bit mask To: Len Brown Cc: Linux Kernel Mailing List , Linux PM list , dsmythies Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Len, thank you for your reply. On Thu, Mar 11, 2021 at 3:19 PM Len Brown wrote: > > Thanks for the close read, Doug. > > This field size actually varies from system to system, > but the reality is that the offset is never that big, and so the > smaller mask is sufficient. Disagree. I want to use an offset of 26. > Finally, this may all be moot, because there is discussion that using > the offset this way is simply erroneous. Disagree. It works great. As far as I know/recall I was the only person that responded to Rui's thread "thermal/intel: introduce tcc cooling driver" [1] And, I spent quite a bit of time doing so. However, I agree the response seems different between the two systems under test, Rui's and mine. [1] https://marc.info/?l=linux-pm&m=161070345329806&w=2 > stay tuned. O.K. ... Doug > > -Len > > > On Sat, Jan 16, 2021 at 12:07 PM Doug Smythies wrote: > > > > The TCC offset mask is incorrect, resulting in > > incorrect target temperature calculations, if > > the offset is big enough to exceed the mask size. > > > > Signed-off-by: Doug Smythies > > --- > > tools/power/x86/turbostat/turbostat.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c > > index 389ea5209a83..d7acdd4d16c4 100644 > > --- a/tools/power/x86/turbostat/turbostat.c > > +++ b/tools/power/x86/turbostat/turbostat.c > > @@ -4823,7 +4823,7 @@ int read_tcc_activation_temp() > > > > target_c = (msr >> 16) & 0xFF; > > > > - offset_c = (msr >> 24) & 0xF; > > + offset_c = (msr >> 24) & 0x3F; > > > > tcc = target_c - offset_c; > > > > -- > > 2.25.1 > > > > > -- > Len Brown, Intel Open Source Technology Center