From patchwork Fri May 4 17:51:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 10381267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D8DBF6037D for ; Fri, 4 May 2018 17:52:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4DEC1FFF9 for ; Fri, 4 May 2018 17:52:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B970A2846F; Fri, 4 May 2018 17:52:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 681D31FFF9 for ; Fri, 4 May 2018 17:52:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbeEDRwd (ORCPT ); Fri, 4 May 2018 13:52:33 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:42374 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbeEDRwI (ORCPT ); Fri, 4 May 2018 13:52:08 -0400 Received: from localhost ([127.0.0.1] helo=bazinga.breakpoint.cc) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1fEes6-0000Yf-Us; Fri, 04 May 2018 19:51:55 +0200 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, Peter Zijlstra , Ingo Molnar , "David S. Miller" , Johannes Berg , Alexander Aring , Stefan Schmidt , netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-wpan@vger.kernel.org, Anna-Maria Gleixner , Sebastian Andrzej Siewior Subject: [RFC PATCH 1/2] lockdep: Add a assert_in_softirq() Date: Fri, 4 May 2018 19:51:43 +0200 Message-Id: <20180504175144.12179-2-bigeasy@linutronix.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180504175144.12179-1-bigeasy@linutronix.de> References: <20180504175144.12179-1-bigeasy@linutronix.de> MIME-Version: 1.0 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Anna-Maria Gleixner Instead of directly warn on wrong context, check if softirq context is set. This check could be a nop on RT. Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior --- include/linux/lockdep.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 6fc77d4dbdcd..59363c3047c6 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -608,11 +608,17 @@ do { \ "IRQs not disabled as expected\n"); \ } while (0) +#define lockdep_assert_in_softirq() do { \ + WARN_ONCE(debug_locks && !current->lockdep_recursion && \ + !current->softirq_context, \ + "Not in softirq context as expected\n"); \ + } while (0) #else # define might_lock(lock) do { } while (0) # define might_lock_read(lock) do { } while (0) # define lockdep_assert_irqs_enabled() do { } while (0) # define lockdep_assert_irqs_disabled() do { } while (0) +# define lockdep_assert_in_softirq() do { } while (0) #endif #ifdef CONFIG_LOCKDEP