public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* fixing 2.6.10 UP builds
@ 2005-01-06 20:14 dann frazier
  2005-01-06 21:31 ` Luck, Tony
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: dann frazier @ 2005-01-06 20:14 UTC (permalink / raw)
  To: linux-ia64

Debian is putting together 2.6.10 packages, and we noticed that we still
need to forward port Jesse's patches.  Attached is the patch Ubuntu forward
ported, and Debian is including.  It would be great to get this merged upstream
so we don't need to port it for each release.

diff -Nru a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
--- a/arch/ia64/kernel/Makefile	2004-08-12 18:28:06 -07:00
+++ b/arch/ia64/kernel/Makefile	2004-08-12 18:28:06 -07:00
@@ -15,6 +15,7 @@
 obj-$(CONFIG_IOSAPIC)		+= iosapic.o
 obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o domain.o
+obj-$(CONFIG_NUMA)		+= numa.o
 obj-$(CONFIG_PERFMON)		+= perfmon_default_smpl.o
 obj-$(CONFIG_IA64_CYCLONE)	+= cyclone.o
 
diff -Nru a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/arch/ia64/kernel/numa.c	2004-08-12 18:28:06 -07:00
@@ -0,0 +1,46 @@
+#include <linux/config.h>
+#include <linux/topology.h>
+#include <linux/module.h>
+#include <asm/processor.h>
+#include <asm/smp.h>
+
+#ifdef CONFIG_NUMA
+
+/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
+u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+EXPORT_SYMBOL(cpu_to_node_map);
+/* which logical CPUs are on which nodes */
+cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
+
+/*
+ * Build cpu to node mapping and initialize the per node cpu masks.
+ */
+void __init
+build_cpu_to_node_map (void)
+{
+	int cpu, i, node;
+
+	for(node=0; node<MAX_NUMNODES; node++)
+		cpus_clear(node_to_cpu_mask[node]);
+	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
+		/*
+		 * All Itanium NUMA platforms I know use ACPI, so maybe we
+		 * can drop this ifdef completely.                    [EF]
+		 */
+#ifdef CONFIG_ACPI_NUMA
+		node = -1;
+		for (i = 0; i < NR_CPUS; ++i)
+			if (cpu_physical_id(cpu) = node_cpuid[i].phys_id) {
+				node = node_cpuid[i].nid;
+				break;
+			}
+#else
+#		error Fixme: Dunno how to build CPU-to-node map.
+#endif
+		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
+		if (node >= 0)
+			cpu_set(cpu, node_to_cpu_mask[node]);
+	}
+}
+
+#endif /* CONFIG_NUMA */
diff -Nru a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
--- a/arch/ia64/kernel/smpboot.c	2004-08-12 18:28:06 -07:00
+++ b/arch/ia64/kernel/smpboot.c	2004-08-12 18:28:06 -07:00
@@ -491,47 +491,6 @@
 	}
 }
 
-#ifdef CONFIG_NUMA
-
-/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
-u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-EXPORT_SYMBOL(cpu_to_node_map);
-/* which logical CPUs are on which nodes */
-cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
-
-/*
- * Build cpu to node mapping and initialize the per node cpu masks.
- */
-void __init
-build_cpu_to_node_map (void)
-{
-	int cpu, i, node;
-
-	for(node=0; node<MAX_NUMNODES; node++)
-		cpus_clear(node_to_cpu_mask[node]);
-	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
-		/*
-		 * All Itanium NUMA platforms I know use ACPI, so maybe we
-		 * can drop this ifdef completely.                    [EF]
-		 */
-#ifdef CONFIG_ACPI_NUMA
-		node = -1;
-		for (i = 0; i < NR_CPUS; ++i)
-			if (cpu_physical_id(cpu) = node_cpuid[i].phys_id) {
-				node = node_cpuid[i].nid;
-				break;
-			}
-#else
-#		error Fixme: Dunno how to build CPU-to-node map.
-#endif
-		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
-		if (node >= 0)
-			cpu_set(cpu, node_to_cpu_mask[node]);
-	}
-}
-
-#endif /* CONFIG_NUMA */
-
 /*
  * Cycle through the APs sending Wakeup IPIs to boot each.
  */
diff -Nru a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
--- a/arch/ia64/mm/discontig.c	2004-08-12 18:28:06 -07:00
+++ b/arch/ia64/mm/discontig.c	2004-08-12 18:28:06 -07:00
@@ -225,6 +225,33 @@
 }
 
 /**
+ * per_cpu_node_setup - setup per-cpu areas on each node
+ * @cpu_data: per-cpu area on this node
+ * @node: node to setup
+ *
+ * Copy the static per-cpu data into the region we just set aside and then
+ * setup __per_cpu_offset for each CPU on this node.  Return a pointer to
+ * the end of the area.
+ */
+static void *per_cpu_node_setup(void *cpu_data, int node)
+{
+#ifdef CONFIG_SMP
+	int cpu;
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		if (node = node_cpuid[cpu].nid) {
+			memcpy(__va(cpu_data), __phys_per_cpu_start,
+			       __per_cpu_end - __per_cpu_start);
+			__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
+				__per_cpu_start;
+			cpu_data += PERCPU_PAGE_SIZE;
+		}
+	}
+#endif
+	return cpu_data;
+}
+
+/**
  * find_pernode_space - allocate memory for memory map and per-node structures
  * @start: physical start of range
  * @len: length of range
@@ -255,7 +282,7 @@
 static int __init find_pernode_space(unsigned long start, unsigned long len,
 				     int node)
 {
-	unsigned long epfn, cpu, cpus;
+	unsigned long epfn, cpus;
 	unsigned long pernodesize = 0, pernode, pages, mapsize;
 	void *cpu_data;
 	struct bootmem_data *bdp = &mem_data[node].bootmem_data;
@@ -305,20 +332,7 @@
 		mem_data[node].pgdat->bdata = bdp;
 		pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
 
-		/*
-		 * Copy the static per-cpu data into the region we
-		 * just set aside and then setup __per_cpu_offset
-		 * for each CPU on this node.
-		 */
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			if (node = node_cpuid[cpu].nid) {
-				memcpy(__va(cpu_data), __phys_per_cpu_start,
-				       __per_cpu_end - __per_cpu_start);
-				__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
-					__per_cpu_start;
-				cpu_data += PERCPU_PAGE_SIZE;
-			}
-		}
+		cpu_data = per_cpu_node_setup(cpu_data, node);
 	}
 
 	return 0;
@@ -464,6 +478,7 @@
 	find_initrd();
 }
 
+#ifdef CONFIG_SMP
 /**
  * per_cpu_init - setup per-cpu variables
  *
@@ -483,6 +498,7 @@
 
 	return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
 }
+#endif /* CONFIG_SMP */
 
 /**
  * show_mem - give short summary of memory stats
@@ -80,12 +80,6 @@
  *
  */
 
-#ifndef CONFIG_SMP
-#define cpu_logical_id(cpu)			0
-#define cpu_physical_id(cpuid)			((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
-#endif
-
-
 #define get_node_number(addr)			(((unsigned long)(addr)>>38) & 0x7ff)
 
 /*
diff -Nru a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h
--- a/include/asm-ia64/smp.h	2004-08-12 18:28:06 -07:00
+++ b/include/asm-ia64/smp.h	2004-08-12 18:28:06 -07:00
@@ -126,6 +126,7 @@
 #else
 
 #define cpu_logical_id(cpuid)		0
+#define cpu_physical_id(i)	((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
 
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
diff -urN kernel-source-2.6.8.defconfig/arch/ia64/kernel/acpi.c kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/acpi.c
--- kernel-source-2.6.8.defconfig/arch/ia64/kernel/acpi.c	2004-08-13 23:36:58.000000000 -0600
+++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/acpi.c	2004-08-15 15:49:38.000000000 -0600
@@ -618,9 +618,11 @@
 			if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
 				node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
 	}
-	build_cpu_to_node_map();
 # endif
 #endif
+#ifdef CONFIG_ACPI_NUMA
+	build_cpu_to_node_map();
+#endif
 	/* Make boot-up look pretty */
 	printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
 	return 0;
diff -urN kernel-source-2.6.8.defconfig/arch/ia64/kernel/cyclone.c kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/cyclone.c
--- kernel-source-2.6.8.defconfig/arch/ia64/kernel/cyclone.c	2004-08-14 13:07:37.000000000 -0600
+++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/cyclone.c	2004-08-15 15:49:31.000000000 -0600
@@ -1,8 +1,6 @@
-#include <linux/module.h>
 #include <linux/smp.h>
 #include <linux/time.h>
 #include <linux/errno.h>
-#include <asm/io.h>
 
 /* IBM Summit (EXA) Cyclone counter code*/
 #define CYCLONE_CBAR_ADDR 0xFEB00CD0
diff -urN kernel-source-2.6.8.defconfig/arch/ia64/kernel/numa.c kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/numa.c
--- kernel-source-2.6.8.defconfig/arch/ia64/kernel/numa.c	2004-08-14 13:07:37.000000000 -0600
+++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/numa.c	2004-08-15 15:49:38.000000000 -0600
@@ -1,46 +1,57 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ia64 kernel NUMA specific stuff
+ *
+ * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
+ * Copyright (C) 2004 Silicon Graphics, Inc.
+ *   Jesse Barnes <jbarnes@sgi.com>
+ */
 #include <linux/config.h>
 #include <linux/topology.h>
 #include <linux/module.h>
 #include <asm/processor.h>
 #include <asm/smp.h>
 
-#ifdef CONFIG_NUMA
-
-/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
 u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
 EXPORT_SYMBOL(cpu_to_node_map);
-/* which logical CPUs are on which nodes */
+
 cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
 
-/*
- * Build cpu to node mapping and initialize the per node cpu masks.
+/**
+ * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
+ *
+ * Build cpu to node mapping and initialize the per node cpu masks using
+ * info from the node_cpuid array handed to us by ACPI.
  */
-void __init
-build_cpu_to_node_map (void)
+void __init build_cpu_to_node_map(void)
 {
 	int cpu, i, node;
 
-	for(node=0; node<MAX_NUMNODES; node++)
+	for(node=0; node < MAX_NUMNODES; node++)
 		cpus_clear(node_to_cpu_mask[node]);
+
 	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
-		/*
-		 * All Itanium NUMA platforms I know use ACPI, so maybe we
-		 * can drop this ifdef completely.                    [EF]
-		 */
-#ifdef CONFIG_ACPI_NUMA
 		node = -1;
 		for (i = 0; i < NR_CPUS; ++i)
 			if (cpu_physical_id(cpu) = node_cpuid[i].phys_id) {
 				node = node_cpuid[i].nid;
 				break;
 			}
-#else
-#		error Fixme: Dunno how to build CPU-to-node map.
-#endif
 		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
 		if (node >= 0)
 			cpu_set(cpu, node_to_cpu_mask[node]);
 	}
 }
-
-#endif /* CONFIG_NUMA */
diff -urN kernel-source-2.6.8.defconfig/arch/ia64/kernel/setup.c kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/setup.c
--- kernel-source-2.6.8.defconfig/arch/ia64/kernel/setup.c	2004-08-13 23:36:17.000000000 -0600
+++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/setup.c	2004-08-15 15:49:38.000000000 -0600
@@ -317,11 +317,9 @@
 	machvec_init(acpi_get_sysname());
 #endif
 
-#ifdef CONFIG_SMP
 	/* If we register an early console, allow CPU 0 to printk */
 	if (!early_console_setup())
 		cpu_set(smp_processor_id(), cpu_online_map);
-#endif
 
 #ifdef CONFIG_ACPI_BOOT
 	/* Initialize the ACPI boot-time table parser */
diff -urN kernel-source-2.6.8.defconfig/arch/ia64/mm/discontig.c kernel-source-2.6.8.newupfix.defconfig/arch/ia64/mm/discontig.c
--- kernel-source-2.6.8.defconfig/arch/ia64/mm/discontig.c	2004-08-14 13:07:37.000000000 -0600
+++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/mm/discontig.c	2004-08-15 15:49:38.000000000 -0600
@@ -398,8 +398,8 @@
  */
 static void __init initialize_pernode_data(void)
 {
-	int cpu, node;
 	pg_data_t *pgdat_list[NR_NODES];
+	int cpu, node;
 
 	for (node = 0; node < numnodes; node++)
 		pgdat_list[node] = mem_data[node].pgdat;
@@ -409,12 +409,22 @@
 		memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
 		       sizeof(pgdat_list));
 	}
-
+#ifdef CONFIG_SMP
 	/* Set the node_data pointer for each per-cpu struct */
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		node = node_cpuid[cpu].nid;
 		per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
 	}
+#else
+	{
+		struct cpuinfo_ia64 *cpu0_cpu_info;
+		cpu = 0;
+		node = node_cpuid[cpu].nid;
+		cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
+			((char *)&per_cpu__cpu_info - __per_cpu_start));
+		cpu0_cpu_info->node_data = mem_data[node].node_data;
+	}
+#endif /* CONFIG_SMP */
 }
 
 /**
@@ -489,12 +499,11 @@
 {
 	int cpu;
 
-	if (smp_processor_id() = 0) {
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			per_cpu(local_per_cpu_offset, cpu) -				__per_cpu_offset[cpu];
-		}
-	}
+	if (smp_processor_id() != 0)
+		return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
 
 	return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
 }

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
@ 2005-01-06 21:31 ` Luck, Tony
  2005-01-06 21:36 ` Christoph Hellwig
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Luck, Tony @ 2005-01-06 21:31 UTC (permalink / raw)
  To: linux-ia64

>Debian is putting together 2.6.10 packages, and we noticed 
>that we still need to forward port Jesse's patches.  Attached is the patch 
>Ubuntu forward ported, and Debian is including.  It would be great to get 
>this merged upstream so we don't need to port it for each release.

2.6.10 built as UP for me (I have it running on zx2000).

Can you provide some changelog information on what this is doing.  It
also looks like this might be better separated back into a couple (or
more) patches ... I see that arch/ia64/kernel/numa.c is being patched
twice by this patch.

A "Signed-off-by:" line (or lines) is needed too.

-Tony

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
  2005-01-06 21:31 ` Luck, Tony
@ 2005-01-06 21:36 ` Christoph Hellwig
  2005-01-06 21:54 ` Jesse Barnes
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2005-01-06 21:36 UTC (permalink / raw)
  To: linux-ia64

On Thu, Jan 06, 2005 at 01:14:27PM -0700, dann frazier wrote:
> Debian is putting together 2.6.10 packages, and we noticed that we still
> need to forward port Jesse's patches.  Attached is the patch Ubuntu forward
> ported, and Debian is including.  It would be great to get this merged upstream
> so we don't need to port it for each release.

should be mentioned it's original from Jesse Barnes (OTOH the numa.c
copyright message implies that already).

I'd like to second the request for inclusion, distributions like Debian
really need a generic UP kernel, and having to forward-port patches
everytime a new upstream release is out is extremly annoying.

> --- kernel-source-2.6.8.defconfig/arch/ia64/kernel/cyclone.c	2004-08-14 13:07:37.000000000 -0600
> +++ kernel-source-2.6.8.newupfix.defconfig/arch/ia64/kernel/cyclone.c	2004-08-15 15:49:31.000000000 -0600
> @@ -1,8 +1,6 @@
> -#include <linux/module.h>
>  #include <linux/smp.h>
>  #include <linux/time.h>
>  #include <linux/errno.h>
> -#include <asm/io.h>
>  
>  /* IBM Summit (EXA) Cyclone counter code*/
>  #define CYCLONE_CBAR_ADDR 0xFEB00CD0

this hunk looks bogus.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
  2005-01-06 21:31 ` Luck, Tony
  2005-01-06 21:36 ` Christoph Hellwig
@ 2005-01-06 21:54 ` Jesse Barnes
  2005-01-06 21:59 ` Luck, Tony
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jesse Barnes @ 2005-01-06 21:54 UTC (permalink / raw)
  To: linux-ia64

On Thursday, January 6, 2005 1:31 pm, Luck, Tony wrote:
> >Debian is putting together 2.6.10 packages, and we noticed
> >that we still need to forward port Jesse's patches.  Attached is the patch
> >Ubuntu forward ported, and Debian is including.  It would be great to get
> >this merged upstream so we don't need to port it for each release.
>
> 2.6.10 built as UP for me (I have it running on zx2000).

A zx1 specific kernel?  Most of these changes are NUMA and discontig specific, 
so they apply more to generic kernels than particular types.

Jesse

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (2 preceding siblings ...)
  2005-01-06 21:54 ` Jesse Barnes
@ 2005-01-06 21:59 ` Luck, Tony
  2005-01-08  3:02 ` dann frazier
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Luck, Tony @ 2005-01-06 21:59 UTC (permalink / raw)
  To: linux-ia64


>> 2.6.10 built as UP for me (I have it running on zx2000).
>
>A zx1 specific kernel?  Most of these changes are NUMA and 
>discontig specific, 
>so they apply more to generic kernels than particular types.

Ah yes ... I based my config on the zx1_config file ... a generic
UP build does have problems that need to be fixed.

-Tony

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (3 preceding siblings ...)
  2005-01-06 21:59 ` Luck, Tony
@ 2005-01-08  3:02 ` dann frazier
  2005-01-13  0:02 ` Luck, Tony
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dann frazier @ 2005-01-08  3:02 UTC (permalink / raw)
  To: linux-ia64

I've regenerated this patch, original developed by Jesse Barnes, against
2.6.10, which fixes UP builds.  I've also removed the bogus header removals
from the cyclone driver.

I won't pretend to be able to explain the details, hopefully Jesse recalls :)

Signed-off-by: dann frazier <dannf@hp.com>

diff -urN linux-2.6.10.orig/arch/ia64/kernel/Makefile linux-2.6.10/arch/ia64/kernel/Makefile
--- linux-2.6.10.orig/arch/ia64/kernel/Makefile	2004-12-24 14:35:40.000000000 -0700
+++ linux-2.6.10/arch/ia64/kernel/Makefile	2005-01-07 19:56:49.228518783 -0700
@@ -15,6 +15,7 @@
 obj-$(CONFIG_IOSAPIC)		+= iosapic.o
 obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o domain.o
+obj-$(CONFIG_NUMA)		+= numa.o
 obj-$(CONFIG_PERFMON)		+= perfmon_default_smpl.o
 obj-$(CONFIG_IA64_CYCLONE)	+= cyclone.o
 obj-$(CONFIG_IA64_MCA_RECOVERY)	+= mca_recovery.o
diff -urN linux-2.6.10.orig/arch/ia64/kernel/acpi.c linux-2.6.10/arch/ia64/kernel/acpi.c
--- linux-2.6.10.orig/arch/ia64/kernel/acpi.c	2004-12-24 14:34:45.000000000 -0700
+++ linux-2.6.10/arch/ia64/kernel/acpi.c	2005-01-07 19:56:56.333010884 -0700
@@ -627,9 +627,11 @@
 			if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
 				node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
 	}
-	build_cpu_to_node_map();
 # endif
 #endif
+#ifdef CONFIG_ACPI_NUMA
+	build_cpu_to_node_map();
+#endif
 	/* Make boot-up look pretty */
 	printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
 	return 0;
diff -urN linux-2.6.10.orig/arch/ia64/kernel/numa.c linux-2.6.10/arch/ia64/kernel/numa.c
--- linux-2.6.10.orig/arch/ia64/kernel/numa.c	1969-12-31 17:00:00.000000000 -0700
+++ linux-2.6.10/arch/ia64/kernel/numa.c	2005-01-07 19:56:56.333987446 -0700
@@ -0,0 +1,57 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * ia64 kernel NUMA specific stuff
+ *
+ * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
+ * Copyright (C) 2004 Silicon Graphics, Inc.
+ *   Jesse Barnes <jbarnes@sgi.com>
+ */
+#include <linux/config.h>
+#include <linux/topology.h>
+#include <linux/module.h>
+#include <asm/processor.h>
+#include <asm/smp.h>
+
+u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
+EXPORT_SYMBOL(cpu_to_node_map);
+
+cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
+
+/**
+ * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
+ *
+ * Build cpu to node mapping and initialize the per node cpu masks using
+ * info from the node_cpuid array handed to us by ACPI.
+ */
+void __init build_cpu_to_node_map(void)
+{
+	int cpu, i, node;
+
+	for(node=0; node < MAX_NUMNODES; node++)
+		cpus_clear(node_to_cpu_mask[node]);
+
+	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
+		node = -1;
+		for (i = 0; i < NR_CPUS; ++i)
+			if (cpu_physical_id(cpu) = node_cpuid[i].phys_id) {
+				node = node_cpuid[i].nid;
+				break;
+			}
+		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
+		if (node >= 0)
+			cpu_set(cpu, node_to_cpu_mask[node]);
+	}
+}
diff -urN linux-2.6.10.orig/arch/ia64/kernel/smpboot.c linux-2.6.10/arch/ia64/kernel/smpboot.c
--- linux-2.6.10.orig/arch/ia64/kernel/smpboot.c	2004-12-24 14:34:26.000000000 -0700
+++ linux-2.6.10/arch/ia64/kernel/smpboot.c	2005-01-07 19:56:49.253909408 -0700
@@ -478,47 +478,6 @@
 	}
 }
 
-#ifdef CONFIG_NUMA
-
-/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
-u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
-EXPORT_SYMBOL(cpu_to_node_map);
-/* which logical CPUs are on which nodes */
-cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
-
-/*
- * Build cpu to node mapping and initialize the per node cpu masks.
- */
-void __init
-build_cpu_to_node_map (void)
-{
-	int cpu, i, node;
-
-	for(node=0; node<MAX_NUMNODES; node++)
-		cpus_clear(node_to_cpu_mask[node]);
-	for(cpu = 0; cpu < NR_CPUS; ++cpu) {
-		/*
-		 * All Itanium NUMA platforms I know use ACPI, so maybe we
-		 * can drop this ifdef completely.                    [EF]
-		 */
-#ifdef CONFIG_ACPI_NUMA
-		node = -1;
-		for (i = 0; i < NR_CPUS; ++i)
-			if (cpu_physical_id(cpu) = node_cpuid[i].phys_id) {
-				node = node_cpuid[i].nid;
-				break;
-			}
-#else
-#		error Fixme: Dunno how to build CPU-to-node map.
-#endif
-		cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
-		if (node >= 0)
-			cpu_set(cpu, node_to_cpu_mask[node]);
-	}
-}
-
-#endif /* CONFIG_NUMA */
-
 /*
  * Cycle through the APs sending Wakeup IPIs to boot each.
  */
diff -urN linux-2.6.10.orig/arch/ia64/mm/discontig.c linux-2.6.10/arch/ia64/mm/discontig.c
--- linux-2.6.10.orig/arch/ia64/mm/discontig.c	2004-12-24 14:35:25.000000000 -0700
+++ linux-2.6.10/arch/ia64/mm/discontig.c	2005-01-07 19:56:56.380862445 -0700
@@ -239,6 +239,33 @@
 }
 
 /**
+ * per_cpu_node_setup - setup per-cpu areas on each node
+ * @cpu_data: per-cpu area on this node
+ * @node: node to setup
+ *
+ * Copy the static per-cpu data into the region we just set aside and then
+ * setup __per_cpu_offset for each CPU on this node.  Return a pointer to
+ * the end of the area.
+ */
+static void *per_cpu_node_setup(void *cpu_data, int node)
+{
+#ifdef CONFIG_SMP
+	int cpu;
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+		if (node = node_cpuid[cpu].nid) {
+			memcpy(__va(cpu_data), __phys_per_cpu_start,
+			       __per_cpu_end - __per_cpu_start);
+			__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
+				__per_cpu_start;
+			cpu_data += PERCPU_PAGE_SIZE;
+		}
+	}
+#endif
+	return cpu_data;
+}
+
+/**
  * find_pernode_space - allocate memory for memory map and per-node structures
  * @start: physical start of range
  * @len: length of range
@@ -269,7 +296,7 @@
 static int __init find_pernode_space(unsigned long start, unsigned long len,
 				     int node)
 {
-	unsigned long epfn, cpu, cpus;
+	unsigned long epfn, cpus;
 	unsigned long pernodesize = 0, pernode, pages, mapsize;
 	void *cpu_data;
 	struct bootmem_data *bdp = &mem_data[node].bootmem_data;
@@ -319,20 +346,7 @@
 		mem_data[node].pgdat->bdata = bdp;
 		pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
 
-		/*
-		 * Copy the static per-cpu data into the region we
-		 * just set aside and then setup __per_cpu_offset
-		 * for each CPU on this node.
-		 */
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			if (node = node_cpuid[cpu].nid) {
-				memcpy(__va(cpu_data), __phys_per_cpu_start,
-				       __per_cpu_end - __per_cpu_start);
-				__per_cpu_offset[cpu] = (char*)__va(cpu_data) -
-					__per_cpu_start;
-				cpu_data += PERCPU_PAGE_SIZE;
-			}
-		}
+		cpu_data = per_cpu_node_setup(cpu_data, node);
 	}
 
 	return 0;
@@ -398,8 +412,8 @@
  */
 static void __init initialize_pernode_data(void)
 {
-	int cpu, node;
 	pg_data_t *pgdat_list[NR_NODES];
+	int cpu, node;
 
 	for (node = 0; node < numnodes; node++)
 		pgdat_list[node] = mem_data[node].pgdat;
@@ -409,12 +423,22 @@
 		memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
 		       sizeof(pgdat_list));
 	}
-
+#ifdef CONFIG_SMP
 	/* Set the node_data pointer for each per-cpu struct */
 	for (cpu = 0; cpu < NR_CPUS; cpu++) {
 		node = node_cpuid[cpu].nid;
 		per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
 	}
+#else
+	{
+		struct cpuinfo_ia64 *cpu0_cpu_info;
+		cpu = 0;
+		node = node_cpuid[cpu].nid;
+		cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
+			((char *)&per_cpu__cpu_info - __per_cpu_start));
+		cpu0_cpu_info->node_data = mem_data[node].node_data;
+	}
+#endif /* CONFIG_SMP */
 }
 
 /**
@@ -478,6 +502,7 @@
 	find_initrd();
 }
 
+#ifdef CONFIG_SMP
 /**
  * per_cpu_init - setup per-cpu variables
  *
@@ -488,15 +513,15 @@
 {
 	int cpu;
 
-	if (smp_processor_id() = 0) {
-		for (cpu = 0; cpu < NR_CPUS; cpu++) {
-			per_cpu(local_per_cpu_offset, cpu) -				__per_cpu_offset[cpu];
-		}
-	}
+	if (smp_processor_id() != 0)
+		return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
 
 	return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
 }
+#endif /* CONFIG_SMP */
 
 /**
  * show_mem - give short summary of memory stats
diff -urN linux-2.6.10.orig/include/asm-ia64/smp.h linux-2.6.10/include/asm-ia64/smp.h
--- linux-2.6.10.orig/include/asm-ia64/smp.h	2004-12-24 14:34:45.000000000 -0700
+++ linux-2.6.10/include/asm-ia64/smp.h	2005-01-07 19:56:49.255862533 -0700
@@ -126,6 +126,7 @@
 #else
 
 #define cpu_logical_id(cpuid)		0
+#define cpu_physical_id(i)	((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
 
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
diff -urN linux-2.6.10.orig/include/asm-ia64/sn/sn_cpuid.h linux-2.6.10/include/asm-ia64/sn/sn_cpuid.h
--- linux-2.6.10.orig/include/asm-ia64/sn/sn_cpuid.h	2004-12-24 14:34:01.000000000 -0700
+++ linux-2.6.10/include/asm-ia64/sn/sn_cpuid.h	2005-01-07 19:56:49.278323470 -0700
@@ -80,12 +80,6 @@
  *
  */
 
-#ifndef CONFIG_SMP
-#define cpu_logical_id(cpu)			0
-#define cpu_physical_id(cpuid)			((ia64_getreg(_IA64_REG_CR_LID) >> 16) & 0xffff)
-#endif
-
-
 #define get_node_number(addr)			(((unsigned long)(addr)>>38) & 0x7ff)
 
 /*

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (4 preceding siblings ...)
  2005-01-08  3:02 ` dann frazier
@ 2005-01-13  0:02 ` Luck, Tony
  2005-01-13  0:20 ` Jesse Barnes
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Luck, Tony @ 2005-01-13  0:02 UTC (permalink / raw)
  To: linux-ia64

>I've regenerated this patch, original developed by Jesse 
>Barnes, against 2.6.10, which fixes UP builds.  I've also removed the bogus 
>header removals from the cyclone driver.
>
>I won't pretend to be able to explain the details, hopefully 
>Jesse recalls :)

I think that I pulled together all the pieces, but I still see
a couple of problems when trying to build a generic-UP kernel:

  CC      drivers/char/mmtimer.o
drivers/char/mmtimer.c: In function `mmtimer_tasklet':
drivers/char/mmtimer.c:502: structure has no member named `write_lock'
make[1]: *** [drivers/char/mmtimer.o] Error 1
make: *** [drivers/char/mmtimer.o] Error 2

  CC      arch/ia64/sn/kernel/sn2/sn_hwperf.o
In file included from arch/ia64/sn/kernel/sn2/sn_hwperf.c:33:
include/linux/nodemask.h: In function `__first_unset_node':
include/linux/nodemask.h:244: warning: passing arg 1 of `__find_next_zero_bit' discards qualifiers from pointer target type
arch/ia64/sn/kernel/sn2/sn_hwperf.c: In function `sn_hwperf_op_cpu':
arch/ia64/sn/kernel/sn2/sn_hwperf.c:360: warning: implicit declaration of function `smp_call_function_single'

-Tony

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (5 preceding siblings ...)
  2005-01-13  0:02 ` Luck, Tony
@ 2005-01-13  0:20 ` Jesse Barnes
  2005-01-13  0:34 ` Luck, Tony
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jesse Barnes @ 2005-01-13  0:20 UTC (permalink / raw)
  To: linux-ia64

On Wednesday, January 12, 2005 4:02 pm, Luck, Tony wrote:
> >I've regenerated this patch, original developed by Jesse
> >Barnes, against 2.6.10, which fixes UP builds.  I've also removed the
> > bogus header removals from the cyclone driver.
> >
> >I won't pretend to be able to explain the details, hopefully
> >Jesse recalls :)
>
> I think that I pulled together all the pieces, but I still see
> a couple of problems when trying to build a generic-UP kernel:
>
>   CC      drivers/char/mmtimer.o
> drivers/char/mmtimer.c: In function `mmtimer_tasklet':
> drivers/char/mmtimer.c:502: structure has no member named `write_lock'
> make[1]: *** [drivers/char/mmtimer.o] Error 1
> make: *** [drivers/char/mmtimer.o] Error 2

Looks like we need rwlock_is_write_locked for this one.  Christoph?

>   CC      arch/ia64/sn/kernel/sn2/sn_hwperf.o
> In file included from arch/ia64/sn/kernel/sn2/sn_hwperf.c:33:
> include/linux/nodemask.h: In function `__first_unset_node':
> include/linux/nodemask.h:244: warning: passing arg 1 of
> `__find_next_zero_bit' discards qualifiers from pointer target type

This warning was introduced upstream with the nodemask stuff.  It should be 
fixed but is unrelated to the UP stuff.

> arch/ia64/sn/kernel/sn2/sn_hwperf.c: In function `sn_hwperf_op_cpu':
> arch/ia64/sn/kernel/sn2/sn_hwperf.c:360: warning: implicit declaration of
> function `smp_call_function_single'

Looks like we need a !CONFIG_SMP version of smp_call_function_single.  
include/linux/smp.h has a non-smp version of smp_call_function that just 
returns 0, should smp_call_function_single do the same thing?

Jesse

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (6 preceding siblings ...)
  2005-01-13  0:20 ` Jesse Barnes
@ 2005-01-13  0:34 ` Luck, Tony
  2005-01-13  0:36 ` Christoph Lameter
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Luck, Tony @ 2005-01-13  0:34 UTC (permalink / raw)
  To: linux-ia64

>> arch/ia64/sn/kernel/sn2/sn_hwperf.c: In function `sn_hwperf_op_cpu':
>> arch/ia64/sn/kernel/sn2/sn_hwperf.c:360: warning: implicit declaration of function `smp_call_function_single'
>
>Looks like we need a !CONFIG_SMP version of smp_call_function_single.  
>include/linux/smp.h has a non-smp version of smp_call_function 
>that just returns 0, should smp_call_function_single do the same thing?

That would make the warning go away, but it isn't obvious to me
that you'd end up with code that did the right thing.  Looking
at the bigger picture, just what is sn_hwperf_op_cpu() supposed
to do in the UP case?

-Tony

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (7 preceding siblings ...)
  2005-01-13  0:34 ` Luck, Tony
@ 2005-01-13  0:36 ` Christoph Lameter
  2005-01-13  0:50 ` Jesse Barnes
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Christoph Lameter @ 2005-01-13  0:36 UTC (permalink / raw)
  To: linux-ia64

On Wed, 12 Jan 2005, Jesse Barnes wrote:

> >   CC      drivers/char/mmtimer.o
> > drivers/char/mmtimer.c: In function `mmtimer_tasklet':
> > drivers/char/mmtimer.c:502: structure has no member named `write_lock'
> > make[1]: *** [drivers/char/mmtimer.o] Error 1
> > make: *** [drivers/char/mmtimer.o] Error 2
>
> Looks like we need rwlock_is_write_locked for this one.  Christoph?

Correct.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (8 preceding siblings ...)
  2005-01-13  0:36 ` Christoph Lameter
@ 2005-01-13  0:50 ` Jesse Barnes
  2005-01-13  0:55 ` Mark Goodwin
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Jesse Barnes @ 2005-01-13  0:50 UTC (permalink / raw)
  To: linux-ia64

On Wednesday, January 12, 2005 4:34 pm, Luck, Tony wrote:
> >> arch/ia64/sn/kernel/sn2/sn_hwperf.c: In function `sn_hwperf_op_cpu':
> >> arch/ia64/sn/kernel/sn2/sn_hwperf.c:360: warning: implicit declaration
> >> of function `smp_call_function_single'
> >
> >Looks like we need a !CONFIG_SMP version of smp_call_function_single.
> >include/linux/smp.h has a non-smp version of smp_call_function
> >that just returns 0, should smp_call_function_single do the same thing?
>
> That would make the warning go away, but it isn't obvious to me
> that you'd end up with code that did the right thing.  Looking
> at the bigger picture, just what is sn_hwperf_op_cpu() supposed
> to do in the UP case?

It's supposed to make a SAL call for the CPU specified in the op_arg.  Seems 
like smp_call_function_single should make the specified call unconditionally 
on CPU 0?

Jesse

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (9 preceding siblings ...)
  2005-01-13  0:50 ` Jesse Barnes
@ 2005-01-13  0:55 ` Mark Goodwin
  2005-01-13  1:42 ` Mark Goodwin
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: Mark Goodwin @ 2005-01-13  0:55 UTC (permalink / raw)
  To: linux-ia64


On Wed, 12 Jan 2005, Luck, Tony wrote:

> just what is sn_hwperf_op_cpu() supposed to do in the UP case?

Needs to be wrapped with CONFIG_SMP, as follows (untested) :

=== arch/ia64/sn/kernel/sn2/sn_hwperf.c 1.5 vs edited ==--- 1.5/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2004-10-27 05:12:58 +10:00
+++ edited/arch/ia64/sn/kernel/sn2/sn_hwperf.c	2005-01-13 11:53:01 +11:00
@@ -355,9 +355,13 @@
  	}
  	else {
  		if (use_ipi) {
+#ifdef CONFIG_SMP
  			/* use an interprocessor interrupt to call SAL */
  			smp_call_function_single(cpu, sn_hwperf_call_sal,
  				op_info, 1, 1);
+#else
+			sn_hwperf_call_sal(op_info);
+#endif

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (10 preceding siblings ...)
  2005-01-13  0:55 ` Mark Goodwin
@ 2005-01-13  1:42 ` Mark Goodwin
  2005-01-13  8:14 ` Christoph Hellwig
  2005-01-13 19:11 ` Christoph Lameter
  13 siblings, 0 replies; 15+ messages in thread
From: Mark Goodwin @ 2005-01-13  1:42 UTC (permalink / raw)
  To: linux-ia64



On Wed, 12 Jan 2005, Jesse Barnes wrote:

> On Wednesday, January 12, 2005 4:34 pm, Luck, Tony wrote:
>>>> arch/ia64/sn/kernel/sn2/sn_hwperf.c: In function `sn_hwperf_op_cpu':
>>>> arch/ia64/sn/kernel/sn2/sn_hwperf.c:360: warning: implicit declaration
>>>> of function `smp_call_function_single'
>>>
>>> Looks like we need a !CONFIG_SMP version of smp_call_function_single.
>>> include/linux/smp.h has a non-smp version of smp_call_function
>>> that just returns 0, should smp_call_function_single do the same thing?
>>
>> That would make the warning go away, but it isn't obvious to me
>> that you'd end up with code that did the right thing.  Looking
>> at the bigger picture, just what is sn_hwperf_op_cpu() supposed
>> to do in the UP case?
>
> It's supposed to make a SAL call for the CPU specified in the op_arg.  Seems
> like smp_call_function_single should make the specified call unconditionally
> on CPU 0?

that's fine for the call to smp_call_function_single() in sn_hwperf_op_cpu(),
but may not be desirable elsewhere, I don't know. All the other calls to
smp_call_function_single seem to be already conditional on CONFIG_SMP,
so perhaps just do the same for sn_hwperf_op_cpu.

-- Mark

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (11 preceding siblings ...)
  2005-01-13  1:42 ` Mark Goodwin
@ 2005-01-13  8:14 ` Christoph Hellwig
  2005-01-13 19:11 ` Christoph Lameter
  13 siblings, 0 replies; 15+ messages in thread
From: Christoph Hellwig @ 2005-01-13  8:14 UTC (permalink / raw)
  To: linux-ia64

On Wed, Jan 12, 2005 at 04:20:43PM -0800, Jesse Barnes wrote:
> >   CC      drivers/char/mmtimer.o
> > drivers/char/mmtimer.c: In function `mmtimer_tasklet':
> > drivers/char/mmtimer.c:502: structure has no member named `write_lock'
> > make[1]: *** [drivers/char/mmtimer.o] Error 1
> > make: *** [drivers/char/mmtimer.o] Error 2
> 
> Looks like we need rwlock_is_write_locked for this one.  Christoph?

Looks like the driver is doing something completely bogus which it should
stop ASAP.


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: fixing 2.6.10 UP builds
  2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
                   ` (12 preceding siblings ...)
  2005-01-13  8:14 ` Christoph Hellwig
@ 2005-01-13 19:11 ` Christoph Lameter
  13 siblings, 0 replies; 15+ messages in thread
From: Christoph Lameter @ 2005-01-13 19:11 UTC (permalink / raw)
  To: linux-ia64

On Thu, 13 Jan 2005, Christoph Hellwig wrote:

> On Wed, Jan 12, 2005 at 04:20:43PM -0800, Jesse Barnes wrote:
> > >   CC      drivers/char/mmtimer.o
> > > drivers/char/mmtimer.c: In function `mmtimer_tasklet':
> > > drivers/char/mmtimer.c:502: structure has no member named `write_lock'
> > > make[1]: *** [drivers/char/mmtimer.o] Error 1
> > > make: *** [drivers/char/mmtimer.o] Error 2
> >
> > Looks like we need rwlock_is_write_locked for this one.  Christoph?
>
> Looks like the driver is doing something completely bogus which it should
> stop ASAP.

Here is the fix:

Index: linux-2.6.10/drivers/char/mmtimer.c
=================================--- linux-2.6.10.orig/drivers/char/mmtimer.c	2004-12-24 13:35:20.000000000 -0800
+++ linux-2.6.10/drivers/char/mmtimer.c	2005-01-13 09:46:10.000000000 -0800
@@ -494,17 +494,15 @@ void mmtimer_tasklet(unsigned long data)
 	/* Send signal and deal with periodic signals */
 	spin_lock_irqsave(&t->it_lock, flags);
 	spin_lock(&x->lock);
+
 	/* If timer was deleted between interrupt and here, leave */
 	if (t != x->timer)
 		goto out;
 	t->it_overrun = 0;

-	if (tasklist_lock.write_lock || posix_timer_event(t, 0) != 0) {
-
-		// printk(KERN_WARNING "mmtimer: cannot deliver signal.\n");
-
+	if (posix_timer_event(t, 0) != 0)
 		t->it_overrun++;
-	}
+
 	if(t->it_incr) {
 		/* Periodic timer */
 		if (reschedule_periodic_timer(x)) {
@@ -512,7 +510,7 @@ void mmtimer_tasklet(unsigned long data)
 			x->timer = NULL;
 		}
 	} else {
-		/* Ensure we don't false trigger in mmtimer_interrupt */
+		/* Ensure we do not trigger another tasklet run from mmtimer_interrupt */
 		t->it_timer.expires = 0;
 	}
 	t->it_overrun_last = t->it_overrun;

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-01-13 19:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 20:14 fixing 2.6.10 UP builds dann frazier
2005-01-06 21:31 ` Luck, Tony
2005-01-06 21:36 ` Christoph Hellwig
2005-01-06 21:54 ` Jesse Barnes
2005-01-06 21:59 ` Luck, Tony
2005-01-08  3:02 ` dann frazier
2005-01-13  0:02 ` Luck, Tony
2005-01-13  0:20 ` Jesse Barnes
2005-01-13  0:34 ` Luck, Tony
2005-01-13  0:36 ` Christoph Lameter
2005-01-13  0:50 ` Jesse Barnes
2005-01-13  0:55 ` Mark Goodwin
2005-01-13  1:42 ` Mark Goodwin
2005-01-13  8:14 ` Christoph Hellwig
2005-01-13 19:11 ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox