Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbbLIDQT (ORCPT ); Tue, 8 Dec 2015 22:16:19 -0500 Received: from mail1.windriver.com ([147.11.146.13]:61098 "EHLO mail1.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751422AbbLIDPw (ORCPT ); Tue, 8 Dec 2015 22:15:52 -0500 From: To: , CC: , , , , Subject: [PATCH] MIPS: oprofile: Fix a preemption issue Date: Wed, 9 Dec 2015 11:15:27 +0800 Message-ID: <1449630927-14355-2-git-send-email-yanjiang.jin@windriver.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1449630927-14355-1-git-send-email-yanjiang.jin@windriver.com> References: <1449630927-14355-1-git-send-email-yanjiang.jin@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2440 Lines: 57 From: Yanjiang Jin Use boot_cpu_type() instead of current_cpu_type() in oprofile_arch_init() to avoid the below warning, cpu_type is consistent in a MIPS SMP system. BUG: using smp_processor_id() in preemptible [00000000] code: insmod/952 caller is oprofile_arch_init+0x30/0x194 [oprofile] CPU: 5 PID: 952 Comm: insmod Not tainted 4.1.13-WR8.0.0.0_standard #1 Stack : ffffffff80c10000 0000000000000001 8000000025bf0790 ffffffff80e10000 ffffffff80e50000 ffffffff80254e2c ffffffff80b64428 ffffffff80e10790 0000000000000000 ffffffff801caeb8 0000000000000045 0000000000000005 ffffffff80c10000 ffffffff801cb798 0000000000000000 ffffffff80e30000 0000000000000000 ffffffff801ff1c0 ffffffff80e2d2f8 000000000000000b ffffffff801cbba0 ffffffff80e107b0 ffffffff80a77828 0000000000000005 00000000000003b8 ffffffff80e2d2f8 800000040ad39960 ffffffff801f9950 0000000000000124 80000004093b7990 80000004093b7ab8 ffffffff80925108 ffffffff80b69a07 ffffffff80a6f0d0 8000000407240e00 ffffffff801cc934 000000000000005d ffffffff80159080 0000000000000005 00000000000003b8 ... Call Trace: [] show_stack+0xe8/0x108 [] dump_stack+0x8c/0xd8 [] check_preemption_disabled+0x110/0x118 [] oprofile_arch_init+0x30/0x194 [oprofile] [] oprofile_init+0x2c/0xc0 [oprofile] [] do_one_initcall+0xa0/0x1c0 [] do_init_module+0x80/0x1d8 [] load_module+0x1b74/0x2278 [] SyS_finit_module+0xcc/0xf0 [] handle_sysn32+0x44/0x70 Signed-off-by: Yanjiang Jin --- arch/mips/oprofile/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c index 3c9ec3d..2f33992 100644 --- a/arch/mips/oprofile/common.c +++ b/arch/mips/oprofile/common.c @@ -77,7 +77,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) struct op_mips_model *lmodel = NULL; int res; - switch (current_cpu_type()) { + switch (boot_cpu_type()) { case CPU_5KC: case CPU_M14KC: case CPU_M14KEC: -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/