diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch b/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch new file mode 100644 index 00000000..dc5522d0 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From b376276870006eabba46427b79a3f3be70b3e3ea Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Richter <robert.richter@amd.com> | ||
3 | Date: Mon, 3 Jan 2011 12:15:14 +0100 | ||
4 | Subject: [PATCH 53/65] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU | ||
5 | |||
6 | Disable preemption in init_ibs(). The function only checks the | ||
7 | ibs capabilities and sets up pci devices (if necessary). It runs | ||
8 | only on one cpu but operates with the local APIC and some MSRs, | ||
9 | thus it is better to disable preemption. | ||
10 | |||
11 | [ 7.034377] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/483 | ||
12 | [ 7.034385] caller is setup_APIC_eilvt+0x155/0x180 | ||
13 | [ 7.034389] Pid: 483, comm: modprobe Not tainted 2.6.37-rc1-20101110+ #1 | ||
14 | [ 7.034392] Call Trace: | ||
15 | [ 7.034400] [<ffffffff812a2b72>] debug_smp_processor_id+0xd2/0xf0 | ||
16 | [ 7.034404] [<ffffffff8101e985>] setup_APIC_eilvt+0x155/0x180 | ||
17 | [ ... ] | ||
18 | |||
19 | Addresses https://bugzilla.kernel.org/show_bug.cgi?id=22812 | ||
20 | |||
21 | Reported-by: <atswartz@gmail.com> | ||
22 | Signed-off-by: Robert Richter <robert.richter@amd.com> | ||
23 | Cc: oprofile-list@lists.sourceforge.net <oprofile-list@lists.sourceforge.net> | ||
24 | Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> | ||
25 | Cc: Frederic Weisbecker <fweisbec@gmail.com> | ||
26 | Cc: Rafael J. Wysocki <rjw@sisk.pl> | ||
27 | Cc: Dan Carpenter <error27@gmail.com> | ||
28 | Cc: Andrew Morton <akpm@linux-foundation.org> | ||
29 | Cc: <stable@kernel.org> [2.6.37.x] | ||
30 | LKML-Reference: <20110103111514.GM4739@erda.amd.com> | ||
31 | [ small cleanups ] | ||
32 | Signed-off-by: Ingo Molnar <mingo@elte.hu> | ||
33 | --- | ||
34 | arch/x86/oprofile/op_model_amd.c | 24 ++++++++++++++++-------- | ||
35 | 1 files changed, 16 insertions(+), 8 deletions(-) | ||
36 | |||
37 | diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c | ||
38 | index a011bcc..7d90d47 100644 | ||
39 | --- a/arch/x86/oprofile/op_model_amd.c | ||
40 | +++ b/arch/x86/oprofile/op_model_amd.c | ||
41 | @@ -630,21 +630,29 @@ static int __init_ibs_nmi(void) | ||
42 | return 0; | ||
43 | } | ||
44 | |||
45 | -/* initialize the APIC for the IBS interrupts if available */ | ||
46 | +/* | ||
47 | + * check and reserve APIC extended interrupt LVT offset for IBS if | ||
48 | + * available | ||
49 | + * | ||
50 | + * init_ibs() preforms implicitly cpu-local operations, so pin this | ||
51 | + * thread to its current CPU | ||
52 | + */ | ||
53 | + | ||
54 | static void init_ibs(void) | ||
55 | { | ||
56 | - ibs_caps = get_ibs_caps(); | ||
57 | + preempt_disable(); | ||
58 | |||
59 | + ibs_caps = get_ibs_caps(); | ||
60 | if (!ibs_caps) | ||
61 | - return; | ||
62 | + goto out; | ||
63 | |||
64 | - if (__init_ibs_nmi()) { | ||
65 | + if (__init_ibs_nmi() < 0) | ||
66 | ibs_caps = 0; | ||
67 | - return; | ||
68 | - } | ||
69 | + else | ||
70 | + printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps); | ||
71 | |||
72 | - printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", | ||
73 | - (unsigned)ibs_caps); | ||
74 | +out: | ||
75 | + preempt_enable(); | ||
76 | } | ||
77 | |||
78 | static int (*create_arch_files)(struct super_block *sb, struct dentry *root); | ||
79 | -- | ||
80 | 1.6.6.1 | ||
81 | |||