From patchwork Wed Dec 9 07:23:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 7805161 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A4A1FBEEE1 for ; Wed, 9 Dec 2015 07:26:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ADBEE20524 for ; Wed, 9 Dec 2015 07:26:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A07E4204FB for ; Wed, 9 Dec 2015 07:26:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6Z75-0003jc-0K; Wed, 09 Dec 2015 07:24:35 +0000 Received: from mail-pa0-f44.google.com ([209.85.220.44]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a6Z71-0003W9-CZ for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2015 07:24:32 +0000 Received: by pacwq6 with SMTP id wq6so25364928pac.1 for ; Tue, 08 Dec 2015 23:24:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id; bh=62NGUkortTUjvcM50J38vtQuw24kwnqQ0C/llIdUf7s=; b=R3LSVyRUPNJypGyXsA9ppqFfq6nHtR8Y0397UrYAXF8MAXIfBWocWsKR/wccOMscfo bnaTcl38LYoG0ocU/GIOWcYSr6Wb+lhDL+g87eQpPSXoVveercad6kBXe/aezA/2R/3Y C624OJPFEsERKgBCe24Je6HMpaSbWba35R+6LCBd94kx2YKtsOiEFgjkxMzXSun4lXxX qFeNgza0+rGQJrD+8srOGRIGwUe+WhEd2YfBhF/atSAh0QRbxtFIh2fcm4P6zYY63lXq DDKqMtNPG0w49WmXE0Kqb26EE5F12olVY+jpKgVml/llPMYrgn3BOSqKpZEI2DtUPnH/ 5zrg== X-Received: by 10.66.142.168 with SMTP id rx8mr5923905pab.16.1449645849754; Tue, 08 Dec 2015 23:24:09 -0800 (PST) Received: from localhost ([116.251.217.174]) by smtp.gmail.com with ESMTPSA id kp11sm9305674pab.16.2015.12.08.23.24.08 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 08 Dec 2015 23:24:08 -0800 (PST) From: Ming Lei To: Catalin Marinas , linux-arm-kernel@lists.infradead.org, Will Deacon Subject: [PATCH] arm64: annotate irq off before schedule Date: Wed, 9 Dec 2015 15:23:49 +0800 Message-Id: <1449645829-1070-1-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151208_232431_518996_63E671D2 X-CRM114-Status: GOOD ( 10.81 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ming Lei MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Before schedule in ret_to_user(), irq has been disabled, so irq off should be annotated for killing the following lockdep warning during kernel booting: [ 13.762775] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled) [ 13.768065] ------------[ cut here ]------------ [ 13.772843] WARNING: at kernel/locking/lockdep.c:3519 [ 13.777866] Modules linked in: [ 13.782398] CPU: 1 PID: 1 Comm: init Not tainted 4.4.0-rc4+ #54 [ 13.788287] Hardware name: AppliedMicro Mustang/Mustang, BIOS 2.0.0 Oct 23 2015 [ 13.795557] task: fffffe07c0440000 ti: fffffe07c0480000 task.ti: fffffe07c0480000 [ 13.803005] PC is at check_flags.part.35+0x144/0x19c [ 13.807943] LR is at check_flags.part.35+0x144/0x19c [ 13.812882] pc : [] lr : [] pstate: 800001c5 [ 13.820238] sp : fffffe07c0483d90 [ 13.823534] x29: fffffe07c0483d90 x28: fffffe07c0480000 [ 13.828839] x27: fffffe0000cc2000 x26: fffffe0000861bd0 [ 13.834144] x25: 0000000000000001 x24: 000003ffe3504d50 [ 13.839450] x23: 0000000000000000 x22: fffffe0000db5000 [ 13.844755] x21: fffffe0000aba788 x20: fffffe0000ceaa98 [ 13.850059] x19: fffffe0001b7e000 x18: 0000000000000000 [ 13.855364] x17: 000003ffb2ba4440 x16: 000003ffb2bbd000 [ 13.860670] x15: 000003ffb27241a0 x14: 0ffffffffffffffd [ 13.865975] x13: 0000000000000008 x12: 0101010101010101 [ 13.871280] x11: 7f7f7f7f7f7f7f7f x10: fefefefefefeff63 [ 13.876585] x9 : 000000000000013d x8 : fffffe07c0483ae0 [ 13.881889] x7 : fffffe07c0440000 x6 : fffffe0000122008 [ 13.887196] x5 : 0000000000000000 x4 : fffffe0000cc2000 [ 13.892501] x3 : fffffe07c0483c10 x2 : 0000000000000002 [ 13.897807] x1 : 0000000000000000 x0 : 000000000000002e [ 13.904593] ---[ end trace 42e2299dc2cf1b7d ]--- [ 13.909184] Call trace: [ 13.911618] [] check_flags.part.35+0x144/0x19c [ 13.917594] [] lock_is_held+0x7c/0x88 [ 13.922793] [] rcu_read_lock_sched_held+0xa0/0xac [ 13.929028] [] rcu_note_context_switch+0x28c/0x56c [ 13.935350] [] __schedule+0x4c/0xa28 [ 13.940462] [] schedule+0x40/0xa0 [ 13.945315] [] ret_to_user+0x0/0x24 [ 13.950339] possible reason: unannotated irqs-off. [ 13.955104] irq event stamp: 2488963 [ 13.958660] hardirqs last enabled at (2488963): [] el0_irq_naked+0x1c/0x24 [ 13.967151] hardirqs last disabled at (2488962): [] el0_irq_naked+0x8/0x24 [ 13.975557] softirqs last enabled at (2488958): [] __do_softirq+0x308/0x4f8 [ 13.984137] softirqs last disabled at (2488935): [] irq_exit+0x9c/0xec Signed-off-by: Ming Lei --- arch/arm64/kernel/entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 7ed3d75..4769190 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -634,6 +634,9 @@ work_pending: bl do_notify_resume b ret_to_user work_resched: +#ifdef CONFIG_TRACE_IRQFLAGS + bl trace_hardirqs_off +#endif bl schedule /*