From nobody Sun Feb 20 18:15:43 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EEC6719CF420; Sun, 20 Feb 2022 18:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K1tsC2xSBz4Xkp; Sun, 20 Feb 2022 18:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vW6nAoxlYfxGQXLZbCop8qY1YYq23Lskkx91PQPa3G4=; b=XLfqkEndpUkY6JO6Yl1f1hnS4hrqCQBJCUB0e3NllNdbSucynTwgkoM0OtUObe2q9huNP/ mxRvaz7Zy31Nlpt/xYifLEJK6unnHJh44c2dRCa5wwIO1SESbOhFcBSlAun72M4t7LhOwU iR/guY+RabrcY4Oc+J0ITIpOAHqYjVsob9s7DCacqsYq8nbvNMG29khItGz7SCtAQsU9py WlVHWikkum0lfs3JrBqa2+wtwys0GHyPYvK7+Jca3/SoR6PHM5OoN974WpPlUxdBJ2OBCN tojiMZIRia1orDsLXhIXbbSwKt0TWTs924HgAh0EwIA7MNmFHhUUVcprEAnF2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22D70212B8; Sun, 20 Feb 2022 18:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21KIFhC8023056; Sun, 20 Feb 2022 18:15:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21KIFh5N023055; Sun, 20 Feb 2022 18:15:43 GMT (envelope-from git) Date: Sun, 20 Feb 2022 18:15:43 GMT Message-Id: <202202201815.21KIFh5N023055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: a108252a712a - stable/13 - LinuxKPI: lockdep add lockdep_assert_not_held() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a108252a712aec9ed2cc4bdbdd76d45d253fd3ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645380943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vW6nAoxlYfxGQXLZbCop8qY1YYq23Lskkx91PQPa3G4=; b=QKfym6SB2PfhbW03T6ZvllrtAZwhCV78spqtnazdmGwFaBeMs8uKrfMgiJdOyNaL7zebDZ CML9V2ikNXi13VRkeOqu68dC7UlHWCLE6SPYJMqpYZ0fbWHFlqpid/Sq/l+ckJuozSyCMd 59TmE64RbjzkmEXGiMowNJe1OuRZUrMsUdYM5cNFTFJU6C4QSSDBQi+HuSpTjmEM9XeXl2 JAziJV0bYt7KIxdz/3BV6pOLtkpcuctpwEHyukD+PczgLR+GfEBqvw1ghuNlw9KIkUgEuP dMVaVVDBVhaX7Ki/OSrQ9yza6ZOoguC6I8KT6tvQFWvDSFkgHsioSYAePKGYdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645380943; a=rsa-sha256; cv=none; b=irfa2uc1RvkAucTqWdftxPGyBNGYAprIu5czoPcRLblR3WW95wfPhBeJ4EG5hqug+P5X7b C4tA4+cJB2gw/abRgjiLLWhHpa/tITxOxaGJeppkeITysG73tMahzlqWnmj2vFxPoNFGsI H8gKGfpyWa4TCAShVXcbnpPws55CuP1Ydn2/aMi8DJP7MowX7ZN3bTN5IIbqVGFoLfjtya mK51s5aP7nTX3QFws4C8FeXyN0nzZZf/XaFHIsU3TGSg1ceaZuXZ/MAgbwMw7cL9QmVKAj a6j9MoMdUE6XNEuimMXpMw0ZnbRK0+Mm7H8x5Mn1sDpwnAh8phvTzADUHW48TA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a108252a712aec9ed2cc4bdbdd76d45d253fd3ea commit a108252a712aec9ed2cc4bdbdd76d45d253fd3ea Author: Bjoern A. Zeeb AuthorDate: 2022-02-09 12:01:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-02-20 16:25:03 +0000 LinuxKPI: lockdep add lockdep_assert_not_held() Add lockdep_assert_not_held() asserting LA_UNLOCKED as needed by a driver. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D34232 (cherry picked from commit 064c110f4b551cbf3f2ef6f567736005c2d7007a) --- sys/compat/linuxkpi/common/include/linux/lockdep.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/lockdep.h b/sys/compat/linuxkpi/common/include/linux/lockdep.h index a801f2c2bbac..66bda709606e 100644 --- a/sys/compat/linuxkpi/common/include/linux/lockdep.h +++ b/sys/compat/linuxkpi/common/include/linux/lockdep.h @@ -50,6 +50,11 @@ struct pin_cookie { #define lockdep_init_map(_map, _name, _key, _x) do { } while(0) #ifdef INVARIANTS +#define lockdep_assert_not_held(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_UNLOCKED); \ +} while (0) + #define lockdep_assert_held(m) do { \ struct lock_object *__lock = (struct lock_object *)(m); \ LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED); \ @@ -72,6 +77,7 @@ lockdep_is_held(void *__m) #define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else +#define lockdep_assert_not_held(m) do { (void)(m); } while (0) #define lockdep_assert_held(m) do { (void)(m); } while (0) #define lockdep_assert_held_once(m) do { (void)(m); } while (0)