public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Kurt Garloff <kurt@garloff.de>
To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Cc: stable@vger.kernel.org, lenb@kernel.org
Subject: [PATCH 3/3]: Consider SRAT rev on ia64
Date: Sun, 15 Jan 2012 22:37:59 +0100	[thread overview]
Message-ID: <20120115213759.GW12380@tpkurt2.garloff.de> (raw)
In-Reply-To: <20120115213005.GT12380@tpkurt2.garloff.de>


[-- Attachment #1.1: Type: text/plain, Size: 283 bytes --]

Hi,

ia64 did handle the PXM fields almost consistently, but depending on 
sgi's sn2 platform. This patch leaves the sn2 logic in, but does also
use 16/32 bits for PXM if the SRAT has rev 2 or higher.

This is patch 3/3.
-- 
Kurt Garloff <kurt@garloff.de>  [Koeln/Greven]


[-- Attachment #1.2: acpi_srat-pxm-rev-ia64.patch --]
[-- Type: text/x-patch, Size: 2177 bytes --]

From: Kurt Garloff <kurt@garloff.de>
Subject: Use SRAT table rev to use 8bit or 16/32bit PXM fields (ia64)
References: bnc#503038

In SRAT v1, we had 8bit proximity domain (PXM) fields; SRAT v2 provides
32bits for these. The new fields were reserved before.
According to the ACPI spec, the OS must disregrard reserved fields.

ia64 did handle the PXM fields almost consistently, but depending on 
sgi's sn2 platform. This patch leaves the sn2 logic in, but does also
use 16/32 bits for PXM if the SRAT has rev 2 or higher.

The patch also adds __init to the two pxm accessor functions, as they
access __initdata now and are called from an __init function only anyway.

Note that the code only uses 16 bits for the PXM field in the processor
proximity field; the patch does not address this as 16 bits are more than
enough.

This is patch 3/3.

Signed-off-by: Kurt Garloff <kurt@garloff.de>

---
 arch/ia64/kernel/acpi.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6.git/arch/ia64/kernel/acpi.c
===================================================================
--- linux-2.6.git.orig/arch/ia64/kernel/acpi.c
+++ linux-2.6.git/arch/ia64/kernel/acpi.c
@@ -428,24 +428,26 @@ static u32 __devinitdata pxm_flag[PXM_FL
 #define pxm_bit_test(bit)	(test_bit(bit,(void *)pxm_flag))
 static struct acpi_table_slit __initdata *slit_table;
 cpumask_t early_cpu_possible_map = CPU_MASK_NONE;
 
-static int get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa)
+static int __init
+get_processor_proximity_domain(struct acpi_srat_cpu_affinity *pa)
 {
 	int pxm;
 
 	pxm = pa->proximity_domain_lo;
-	if (ia64_platform_is("sn2"))
+	if (ia64_platform_is("sn2") || acpi_srat_revision >= 2)
 		pxm += pa->proximity_domain_hi[0] << 8;
 	return pxm;
 }
 
-static int get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma)
+static int __init
+get_memory_proximity_domain(struct acpi_srat_mem_affinity *ma)
 {
 	int pxm;
 
 	pxm = ma->proximity_domain;
-	if (!ia64_platform_is("sn2"))
+	if (!ia64_platform_is("sn2") && acpi_srat_revision <= 1)
 		pxm &= 0xff;
 
 	return pxm;
 }

[-- Attachment #2: Type: application/pgp-signature, Size: 190 bytes --]

      parent reply	other threads:[~2012-01-15 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-15 21:30 [PATCH 0/3] ACPI SRAT: Disregard reserved PXM bits Kurt Garloff
2012-01-15 21:34 ` [PATCH 1/3]: Store SRAT revision Kurt Garloff
2012-01-15 21:52   ` Greg KH
2012-01-17  9:24   ` Len Brown
2012-01-17 13:20     ` Kurt Garloff
2012-01-15 21:36 ` [PATCH 2/3]: x86-64: Handle SRAT v1 and v2 consistently Kurt Garloff
2012-01-15 21:37 ` Kurt Garloff [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=20120115213759.GW12380@tpkurt2.garloff.de \
    --to=kurt@garloff.de \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.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