From: Brian Uhrain <buhrain@rosettastone.com>
To: linux-kernel@vger.kernel.org
Cc: rth@twiddle.net, Alan Cox <alan@redhat.com>
Subject: [PATCH] Small fixes for Alpha architecture
Date: Thu, 06 Apr 2006 17:57:10 +0100 [thread overview]
Message-ID: <44354866.3030200@rosettastone.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1449 bytes --]
Hi,
I've encountered two problems with 2.6.16 and newer kernels on my API
CS20 (dual 833MHz Alpha 21264b processors). The first is the kernel
OOPSing because of a NULL pointer dereference while trying to populate
SysFS with the CPU information. The other is that only one processor
was being brought up. I've included a small Alpha-specific patch that
fixes both problems.
The first problem was caused by the CPUs never being properly registered
using register_cpu(), the way it's done on other architectures. I've
added an arch_initcall called alpha_init that is modelled after the
ppc_init arch_initcall.
The second problem has to do with the removal of hwrpb_cpu_present_mask
in arch/alpha/kernel/smp.c. In setup_smp() in the 2.6.15 kernel
sources, hwrpb_cpu_present_mask has a bit set for each processor that is
probed, and afterwards cpu_present_mask is set to the cpumask for the
boot CPU. In the same function of the same file in the 2.6.16 sources,
instead of hwrpb_cpu_present_mask being set, cpu_possible_map is updated
for each probed CPU. cpu_present_mask is still set to the cpumask of
the boot CPU afterwards. The problem lies in include/asm-alpha/smp.h,
where cpu_possible_map is #define'd to be cpu_present_mask. My patch
just replaces the #define with an actual cpumask_t declaration for
cpu_possible_map since it is used separately from cpu_present_mask in
the Alpha SMP code.
Regards,
Brian Uhrain
[-- Attachment #2: alpha-fixes-2.6.16.diff --]
[-- Type: text/plain, Size: 2002 bytes --]
diff -rudp linux-2.6.16/arch/alpha/kernel/setup.c linux-2.6.16.new/arch/alpha/kernel/setup.c
--- linux-2.6.16/arch/alpha/kernel/setup.c 2006-03-20 05:53:29.000000000 +0000
+++ linux-2.6.16.new/arch/alpha/kernel/setup.c 2006-04-06 17:45:04.009752787 +0100
@@ -24,6 +24,7 @@
#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
#include <linux/mc146818rtc.h>
#include <linux/console.h>
+#include <linux/cpu.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/string.h>
@@ -477,6 +478,22 @@ page_is_ram(unsigned long pfn)
#undef PFN_PHYS
#undef PFN_MAX
+static struct cpu cpu_devices[NR_CPUS];
+
+int __init alpha_init(void)
+{
+ int i;
+
+ /* register CPU devices */
+ for (i = 0; i < NR_CPUS; i++)
+ if (cpu_possible(i))
+ register_cpu(&cpu_devices[i], i, NULL);
+
+ return 0;
+}
+
+arch_initcall(alpha_init);
+
void __init
setup_arch(char **cmdline_p)
{
diff -rudp linux-2.6.16/arch/alpha/kernel/smp.c linux-2.6.16.new/arch/alpha/kernel/smp.c
--- linux-2.6.16/arch/alpha/kernel/smp.c 2006-03-20 05:53:29.000000000 +0000
+++ linux-2.6.16.new/arch/alpha/kernel/smp.c 2006-04-06 17:45:08.810533978 +0100
@@ -69,6 +69,7 @@ static int smp_secondary_alive __initdat
/* Which cpus ids came online. */
cpumask_t cpu_present_mask;
+cpumask_t cpu_possible_map;
cpumask_t cpu_online_map;
EXPORT_SYMBOL(cpu_online_map);
diff -rudp linux-2.6.16/include/asm-alpha/smp.h linux-2.6.16.new/include/asm-alpha/smp.h
--- linux-2.6.16/include/asm-alpha/smp.h 2006-03-20 05:53:29.000000000 +0000
+++ linux-2.6.16.new/include/asm-alpha/smp.h 2006-04-06 17:45:08.812487103 +0100
@@ -46,9 +46,9 @@ extern struct cpuinfo_alpha cpu_data[NR_
#define raw_smp_processor_id() (current_thread_info()->cpu)
extern cpumask_t cpu_present_mask;
+extern cpumask_t cpu_possible_map;
extern cpumask_t cpu_online_map;
extern int smp_num_cpus;
-#define cpu_possible_map cpu_present_mask
int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu);
reply other threads:[~2006-04-06 16:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=44354866.3030200@rosettastone.com \
--to=buhrain@rosettastone.com \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rth@twiddle.net \
/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