From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H . Peter Anvin" <hpa@zytor.com>
Cc: Vipul Kumar <vipulk0511@gmail.com>,
Vipul Kumar <vipul_kumar@mentor.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>,
Cedric Hombourger <Cedric_Hombourger@mentor.com>,
Len Brown <len.brown@intel.com>,
Rahul Tanwar <rahul.tanwar@linux.intel.com>,
Tony Luck <tony.luck@intel.com>,
Gayatri Kammela <gayatri.kammela@intel.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v4 1/3] x86/tsc_msr: Use named struct initializers
Date: Wed, 11 Mar 2020 19:18:31 +0100 [thread overview]
Message-ID: <9705677f-f52e-938f-a84a-8db8afc9fc8f@redhat.com> (raw)
In-Reply-To: <20200223140610.59612-1-hdegoede@redhat.com>
Hi,
On 2/23/20 3:06 PM, Hans de Goede wrote:
> Use named struct initializers for the freq_desc struct-s initialization
> and change the "u8 msr_plat" to a "bool use_msr_plat" to make its meaning
> more clear instead of relying on a comment to explain it.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
I believe that this series is ready for merging now? Can we
please get this merged?
Regards,
Hans
> ---
> arch/x86/kernel/tsc_msr.c | 28 ++++++++++++++++++----------
> 1 file changed, 18 insertions(+), 10 deletions(-)
>
> diff --git a/arch/x86/kernel/tsc_msr.c b/arch/x86/kernel/tsc_msr.c
> index e0cbe4f2af49..5fa41ac3feb1 100644
> --- a/arch/x86/kernel/tsc_msr.c
> +++ b/arch/x86/kernel/tsc_msr.c
> @@ -22,10 +22,10 @@
> * read in MSR_PLATFORM_ID[12:8], otherwise in MSR_PERF_STAT[44:40].
> * Unfortunately some Intel Atom SoCs aren't quite compliant to this,
> * so we need manually differentiate SoC families. This is what the
> - * field msr_plat does.
> + * field use_msr_plat does.
> */
> struct freq_desc {
> - u8 msr_plat; /* 1: use MSR_PLATFORM_INFO, 0: MSR_IA32_PERF_STATUS */
> + bool use_msr_plat;
> u32 freqs[MAX_NUM_FREQS];
> };
>
> @@ -35,31 +35,39 @@ struct freq_desc {
> * by MSR based on SDM.
> */
> static const struct freq_desc freq_desc_pnw = {
> - 0, { 0, 0, 0, 0, 0, 99840, 0, 83200 }
> + .use_msr_plat = false,
> + .freqs = { 0, 0, 0, 0, 0, 99840, 0, 83200 },
> };
>
> static const struct freq_desc freq_desc_clv = {
> - 0, { 0, 133200, 0, 0, 0, 99840, 0, 83200 }
> + .use_msr_plat = false,
> + .freqs = { 0, 133200, 0, 0, 0, 99840, 0, 83200 },
> };
>
> static const struct freq_desc freq_desc_byt = {
> - 1, { 83300, 100000, 133300, 116700, 80000, 0, 0, 0 }
> + .use_msr_plat = true,
> + .freqs = { 83300, 100000, 133300, 116700, 80000, 0, 0, 0 },
> };
>
> static const struct freq_desc freq_desc_cht = {
> - 1, { 83300, 100000, 133300, 116700, 80000, 93300, 90000, 88900, 87500 }
> + .use_msr_plat = true,
> + .freqs = { 83300, 100000, 133300, 116700, 80000, 93300, 90000,
> + 88900, 87500 },
> };
>
> static const struct freq_desc freq_desc_tng = {
> - 1, { 0, 100000, 133300, 0, 0, 0, 0, 0 }
> + .use_msr_plat = true,
> + .freqs = { 0, 100000, 133300, 0, 0, 0, 0, 0 },
> };
>
> static const struct freq_desc freq_desc_ann = {
> - 1, { 83300, 100000, 133300, 100000, 0, 0, 0, 0 }
> + .use_msr_plat = true,
> + .freqs = { 83300, 100000, 133300, 100000, 0, 0, 0, 0 },
> };
>
> static const struct freq_desc freq_desc_lgm = {
> - 1, { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 }
> + .use_msr_plat = true,
> + .freqs = { 78000, 78000, 78000, 78000, 78000, 78000, 78000, 78000 },
> };
>
> static const struct x86_cpu_id tsc_msr_cpu_ids[] = {
> @@ -91,7 +99,7 @@ unsigned long cpu_khz_from_msr(void)
> return 0;
>
> freq_desc = (struct freq_desc *)id->driver_data;
> - if (freq_desc->msr_plat) {
> + if (freq_desc->use_msr_plat) {
> rdmsr(MSR_PLATFORM_INFO, lo, hi);
> ratio = (lo >> 8) & 0xff;
> } else {
>
next prev parent reply other threads:[~2020-03-11 18:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-23 14:06 Hans de Goede
2020-02-23 14:06 ` [PATCH v4 2/3] x86/tsc_msr: Fix MSR_FSB_FREQ mask for Cherry Trail devices Hans de Goede
2020-03-11 22:05 ` [tip: x86/timers] " tip-bot2 for Hans de Goede
2020-02-23 14:06 ` [PATCH v4 3/3] x86/tsc_msr: Make MSR derived TSC frequency more accurate Hans de Goede
2020-03-11 22:05 ` [tip: x86/timers] " tip-bot2 for Hans de Goede
2020-03-11 18:18 ` Hans de Goede [this message]
2020-03-11 21:34 ` [PATCH v4 1/3] x86/tsc_msr: Use named struct initializers Thomas Gleixner
2020-03-11 22:05 ` [tip: x86/timers] " tip-bot2 for Hans de Goede
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=9705677f-f52e-938f-a84a-8db8afc9fc8f@redhat.com \
--to=hdegoede@redhat.com \
--cc=Cedric_Hombourger@mentor.com \
--cc=Srikanth_Krishnakar@mentor.com \
--cc=andy@infradead.org \
--cc=bp@alien8.de \
--cc=daniel.lezcano@linaro.org \
--cc=gayatri.kammela@intel.com \
--cc=hpa@zytor.com \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rahul.tanwar@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=vipul_kumar@mentor.com \
--cc=vipulk0511@gmail.com \
--cc=x86@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
all inboxes | Powered by JetHome®