linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prarit Bhargava <prarit@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Prarit Bhargava <prarit@redhat.com>, Len Brown <lenb@kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-pm@vger.kernel.org
Subject: [PATCH] x86/ACPI/cstate: Output AMD on APCI C1 FFH MWAIT AMD systems
Date: Wed,  8 Aug 2018 13:47:35 -0400	[thread overview]
Message-ID: <20180808174735.3114-1-prarit@redhat.com> (raw)

commit 5209654a46ee ("x86/ACPI/cstate: Allow ACPI C1 FFH MWAIT use on AMD
systems") allows use of FFH for ACPI C1 but tools like cpupower and turbostat
display INTEL for the cstate description.

Output "AMD" for AMD systems with FFH for ACPI C1.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: x86@kernel.org
Cc: linux-pm@vger.kernel.org
---
 arch/x86/kernel/acpi/cstate.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index dde437f5d14f..f10d3c673519 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -76,6 +76,7 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
 	unsigned int edx_part;
 	unsigned int cstate_type; /* C-state type and not ACPI C-state type */
 	unsigned int num_cstate_subtype;
+	struct cpuinfo_x86 *c = &boot_cpu_data;
 
 	cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
 
@@ -107,9 +108,14 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
 			"Monitor-Mwait will be used to enter C-%d state\n",
 			cx->type);
 	}
-	snprintf(cx->desc,
-			ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x",
-			cx->address);
+	if (c->x86_vendor == X86_VENDOR_INTEL)
+		snprintf(cx->desc,
+			 ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x",
+			 cx->address);
+	else
+		snprintf(cx->desc,
+			 ACPI_CX_DESC_LEN, "ACPI FFH AMD MWAIT 0x%x",
+			 cx->address);
 out:
 	return retval;
 }
-- 
2.14.4


             reply	other threads:[~2018-08-08 17:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-08 17:47 Prarit Bhargava [this message]
2018-08-08 19:58 ` [PATCH] x86/ACPI/cstate: Output AMD on APCI C1 FFH MWAIT AMD systems Pavel Machek
2018-08-08 20:01   ` Len Brown
2018-08-08 21:06     ` Pavel Machek
2018-08-09 11:43   ` Prarit Bhargava
2018-08-09 16:25     ` Len Brown

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=20180808174735.3114-1-prarit@redhat.com \
    --to=prarit@redhat.com \
    --cc=hpa@zytor.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).