From patchwork Tue Dec 9 10:03:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Moon X-Patchwork-Id: 5461581 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 81B0FBEEA8 for ; Tue, 9 Dec 2014 10:06:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A774920121 for ; Tue, 9 Dec 2014 10:06:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF4A3200F0 for ; Tue, 9 Dec 2014 10:06:28 +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 1XyHei-0006ID-Vj; Tue, 09 Dec 2014 10:04:32 +0000 Received: from nm31-vm8.bullet.mail.bf1.yahoo.com ([72.30.239.134]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XyHee-0005y6-BZ for linux-arm-kernel@lists.infradead.org; Tue, 09 Dec 2014 10:04:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1418119446; bh=JcaCDu69Kb+QpHYlAiiRsgiqpYglji0hKSncpGl/8dQ=; h=From:To:Cc:Subject:Date:From:Subject; b=At3o3C+pkAtWkhfupabZqZQVUxc+jOxgWj7RBifPrkILf8PSkKk/kdDPfCY6k5qwOUeZU0PFkfwM5z275SOLF/6XHVUZInseNp+863qoCHm5/nGkudKaTKHVfcmHpVTS/CDbnnQ71xkECc0YIBQtmXerMpoCZGzHAbPvqd+AP6ISVHJvC8BeYFs6az3uAFDQh37E/77GY+Ipu6IdmOz6CH8dJyX5RAn+8n2nxFv371QWlRotIDrclRfynP0h6suqdJsOqtHnnOA3eOn1eo+kOn1zfOU7N7gDAB+Syajfbl+M5+U5X+dWFpczXK1XyiNysfevTQQtbMW2gZkiRG0Mjg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=BhqeW4bUIQtAziKoA0S8kM/torHYXkeX/pLdZ6cLskF+1WWA659IOyiPBjeQFzXCaWavqx97jJoX4H5k728+3lQ1BYwFvEnG3TzfVjShtzYMIhzM7OsU0ii4u1vB6bv2n6DXdL/sBVj5Ab+FIP9ZDMNKpWZq3UfiNKeF+HePse5Jdb4bC2G+CyRwil0wMF0JZFbdZeMO1W24O3c+XE76BpQGT+Pe9bsyKGHOi4905UC71rpAggOXqhGNXgFldB8lg/FjzGD98ItDsCl8Puz7Th2OjKDSXfYfk9HRCzYDGCIPjR9EZz4s3P+Y3f7GYFEw7H8vSsTUOIIdTVB7XjXT+Q==; Received: from [98.139.212.151] by nm31.bullet.mail.bf1.yahoo.com with NNFMP; 09 Dec 2014 10:04:06 -0000 Received: from [98.139.211.203] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 09 Dec 2014 10:04:06 -0000 Received: from [127.0.0.1] by smtp212.mail.bf1.yahoo.com with NNFMP; 09 Dec 2014 10:04:06 -0000 X-Yahoo-Newman-Id: 165452.61698.bm@smtp212.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: aHUZfr4VM1nSTj4u7BT2ujp_28fYzc00wEDWAGm4JyKodcR syfUDLd6fjspPDVg0TnZE6rKvsAXocY5WAXIdQMIbuSEBZV.gq8bMurVlzSC hx_KSRQx_GYH3c6nAPJVmtxRcD6bLoS24VkDZp8nnU9CBFB1F54tpoz5yRkJ _0_9G.cAQCc5nccnLcBgq05ptqHuBXQZ8nyocWLdsa1uZGG_A4bBoL4C8lCv BaSDIivm4S5gDDbwMC3BF7LXsKLIcJKvxqKsvrZDhbMJThAn4FteDbzdQfZR s.Sz6vF7zdYk1j6c5kKvrgADxT61PKhRIGAi_d4ac4CarWpiuqTFSe5PJg5. tUReJ9Iqzu0RjIoD.kNgt9t7QOqfXVIvyTEts04x1dXG8mXZOMyQ.RMjKpp0 XcBllr.cyS.h7VsPXRoJFcHAWOsXZFi7du2kG5J_pbNBq8.8gf_.w3jDKrPu Ohp7mMjN8enzR0GiKunqEta3OXIhDd_MyCmooQ0TsikhlxwkqlPFRQ2R72HA AKkGJ0JJt5a5yjOKdBhG_pyDdGR89WTmJcw-- X-Yahoo-SMTP: Yh1ZCseswBB87.sev4MWOyuvEVa7giM- From: Anand Moon To: Russell King , "David A. Long" , Rabin Vincent , Anand Moon Subject: [PATCH v2] do_work_pending: Enable interrupts in do_work_pending() Date: Tue, 9 Dec 2014 15:33:18 +0530 Message-Id: <1418119398-5112-1-git-send-email-moon.linux@yahoo.com> X-Mailer: git-send-email 2.1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141209_020428_643013_07341B47 X-CRM114-Status: GOOD ( 12.09 ) X-Spam-Score: -0.1 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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=-0.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FORGED_YAHOO_RCVD, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=no 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 A recent change triggered a WARN_ON that interrupts were disabled, and in fact other architectures enable interrupts uniformly for their related do_work_pending() type code, and all the things we call from this routine appear to expect interrupts to be enabled. So, enable them. Below is the warning. v2 Remove the call of local_irq_disable during restart of signal. [ 12.094106] systemd-udevd[1643]: starting version 204 [ 13.466537] ------------[ cut here ]------------ [ 13.469750] WARNING: CPU: 1 PID: 1645 at kernel/locking/lockdep.c:3536 check_flags+0x7c/0x1d0() [ 13.478397] DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled) [ 13.483663] Modules linked in: [ 13.486863] CPU: 1 PID: 1645 Comm: systemd-udevd Not tainted 3.17.4-arm7 #6 [ 13.493851] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 13.501563] [] (show_stack) from [] (dump_stack+0x80/0xac) [ 13.508753] [] (dump_stack) from [] (warn_slowpath_common+0x60/0x84) [ 13.516808] [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x2c/0x3c) [ 13.525463] [] (warn_slowpath_fmt) from [] (check_flags+0x7c/0x1d0) [ 13.533447] [] (check_flags) from [] (lock_is_held+0x34/0x60) [ 13.540884] [] (lock_is_held) from [] (__schedule+0x98/0x7cc) [ 13.548342] [] (__schedule) from [] (do_work_pending+0x28/0xbc) [ 13.555962] [] (do_work_pending) from [] (work_pending+0xc/0x20) [ 13.563663] ---[ end trace 33bbfa4173cfa520 ]--- [ 13.568238] possible reason: unannotated irqs-off. [ 13.573005] irq event stamp: 5227 [ 13.576293] hardirqs last enabled at (5227): [] ret_fast_syscall+0x24/0x48 [ 13.584096] hardirqs last disabled at (5226): [] ret_fast_syscall+0xc/0x48 [ 13.591823] softirqs last enabled at (5222): [] __do_softirq+0x1e8/0x270 [ 13.599447] softirqs last disabled at (5205): [] irq_exit+0x84/0xf4 [ 13.656634] random: nonblocking pool is initialized Signed-off-by: Anand Moon --- arch/arm/kernel/signal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index bd19834..195745a 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -574,12 +574,13 @@ asmlinkage int do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) { do { + if (unlikely(!user_mode(regs))) + return 0; + + local_irq_enable(); if (likely(thread_flags & _TIF_NEED_RESCHED)) { schedule(); } else { - if (unlikely(!user_mode(regs))) - return 0; - local_irq_enable(); if (thread_flags & _TIF_SIGPENDING) { int restart = do_signal(regs, syscall); if (unlikely(restart)) {