From patchwork Mon Nov 4 17:37:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11226145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0161B13BD for ; Mon, 4 Nov 2019 17:37:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC82A214D9 for ; Mon, 4 Nov 2019 17:37:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC82A214D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D89666E78F; Mon, 4 Nov 2019 17:37:34 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 65F356E78E for ; Mon, 4 Nov 2019 17:37:33 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id a15so18087649wrf.9 for ; Mon, 04 Nov 2019 09:37:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q42A9GE6rbKyvGuSxAml40ibzM2Hb1uuhq9f3IXuc4Y=; b=niD+P2JJa+A/owMX5QIrieHH0XOYMobEhIhkSX/uT9sRtP3J3cTsDJYFOoCetwtAaL wWJgM36WxXqALJuz6MDGNytxVsMb9p7gXeRXIpB5+nxSC9P0l2EeDBCK5b3d2ScYmTbH m8wPsiGI2/d9i9k0+0nn/SoBEPNMrcn1jGcEIxMapruMC4m7ah2Q1P6GuxrtJkaZEClW E7KOOq4+qXaaQYFXPJk4saZlu3pzk/7M6b6afTHrspV9SLmD+qPbP3NN8qatQLL725xP BFgotE8H0SQ8x7DS7gdf2BWTyF31RNW9gxsJI6oAH4riOu57VO0DUPKMTXSH8+j1WgVX C7eQ== X-Gm-Message-State: APjAAAWMVRdA0PJIaKlGE96cD7KdTIRBC1Rd8pD7LE+xk7zz7/TttlX/ 8TyCOHB8VFjhKH32lCJMw6evrv7Xegc= X-Google-Smtp-Source: APXvYqyZGwOKtaoeBaHT91cDJ8JsAllkAP5LrJWjODhvvXVM7htvxjcm6lrzfjLAuEk+9Ke+1UEPnA== X-Received: by 2002:adf:d18b:: with SMTP id v11mr25588251wrc.308.1572889051786; Mon, 04 Nov 2019 09:37:31 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-96.fiber7.init7.net. [212.51.149.96]) by smtp.gmail.com with ESMTPSA id l22sm32408863wrb.45.2019.11.04.09.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 09:37:30 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Mon, 4 Nov 2019 18:37:19 +0100 Message-Id: <20191104173720.2696-2-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.24.0.rc2 In-Reply-To: <20191104173720.2696-1-daniel.vetter@ffwll.ch> References: <20191104173720.2696-1-daniel.vetter@ffwll.ch> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q42A9GE6rbKyvGuSxAml40ibzM2Hb1uuhq9f3IXuc4Y=; b=cWzsrd68SdlOV0Q302wyR11tF2fkJQituuofoLZ+F7zHH+FsGdI5n7j9ewIP4i68t1 gXlwqq2sifm3AD7OAy94JW+f9rDRDD+4V6dymz3aeo86ZQANScxbAns0LeqfbDoHpwA7 ceGpUMSuTsUpfDA7pjN3SCRZORqyFTw2D4K3U= Subject: [Intel-gfx] [PATCH 2/3] lockdep: add might_lock_nested() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Zijlstra , Daniel Vetter , linux-kernel@vger.kernel.org, Ingo Molnar , Daniel Vetter , Will Deacon Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Necessary to annotate functions where we might acquire a mutex_lock_nested() or similar. Needed by i915. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Daniel Vetter Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Will Deacon Cc: linux-kernel@vger.kernel.org --- include/linux/lockdep.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index e0eca94e58c8..c4155436e6fc 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -628,6 +628,13 @@ do { \ lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \ lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ } while (0) +# define might_lock_nested(lock, subclass) \ +do { \ + typecheck(struct lockdep_map *, &(lock)->dep_map); \ + lock_acquire(&(lock)->dep_map, subclass, 0, 1, 1, NULL, \ + _THIS_IP_); \ + lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ +} while (0) #define lockdep_assert_irqs_enabled() do { \ WARN_ONCE(debug_locks && !current->lockdep_recursion && \ @@ -650,6 +657,7 @@ do { \ #else # define might_lock(lock) do { } while (0) # define might_lock_read(lock) do { } while (0) +# define might_lock_nested(lock, subclass) do { } while (0) # define lockdep_assert_irqs_enabled() do { } while (0) # define lockdep_assert_irqs_disabled() do { } while (0) # define lockdep_assert_in_irq() do { } while (0)