linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Linux PM Mailing List <linux-pm@vger.kernel.org>
Subject: Re: [RFC PATCH 1/1] x86: msr: add new 'msr_pkg_cst_config_control.h' header
Date: Mon, 17 Mar 2025 14:40:29 +0200	[thread overview]
Message-ID: <07e9d58cb7c6c1ee9696e251953cfd847ad30205.camel@gmail.com> (raw)
In-Reply-To: <CAJZ5v0gd+Xazbz-ZHqnXS2_geK+f60xZzb4CGbXEWbwiKp81NA@mail.gmail.com>

Hi Rafael,

sorry for so long delay.

On Thu, 2025-02-27 at 21:01 +0100, Rafael J. Wysocki wrote:
> static inline unsigned long long
> msr_pkg_cst_config_c1_auto_demote(bool set, unsigned long long
> other_bits)
> {
>         unsigned long long val, newval;
> 
>         rdmsrl(MSR_PKG_CST_CONFIG_CONTROL, val);
> 
>         if (set)
>                 newval |= NHM_C1_AUTO_DEMOTE | other_bits;
>         else
>                 newval &= ~(NHM_C1_AUTO_DEMOTE | other_bits);
> 
>         wrmsrl(MSR_PKG_CST_CONFIG_CONTROL, newval);
> 
>         return val;
> }

Sure I can do this, sure, thanks. 

One reason why I am still not sure it is worth it is because the 
"lincroft" platform the C1 demotion bit is

#define ATM_LNC_C6_AUTO_DEMOTE		(1UL << 25)

so this function does not seem to be universal enough to cover this code in
intel_idle.c:

static void auto_demotion_disable(void)
{
	unsigned long long msr_bits;

	wrmsrl_pkg_cst_config_control(false, auto_demotion_disable_flags);
	msr_bits = rdmsrl_pkg_cst_config_control();
	msr_bits &= ~auto_demotion_disable_flags;
	wrmsrl_pkg_cst_config_control(msr_bits);
}

Artem.

      reply	other threads:[~2025-03-17 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20 15:43 [RFC PATCH 0/1] x86: msr: add new 'msr_pkg_cst_config_control.h' header Artem Bityutskiy
2025-02-20 15:43 ` [RFC PATCH 1/1] " Artem Bityutskiy
2025-02-27 20:01   ` Rafael J. Wysocki
2025-03-17 12:40     ` Artem Bityutskiy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07e9d58cb7c6c1ee9696e251953cfd847ad30205.camel@gmail.com \
    --to=dedekind1@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).