From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756307AbdJPUmt (ORCPT ); Mon, 16 Oct 2017 16:42:49 -0400 Received: from home.keithp.com ([63.227.221.253]:46060 "EHLO elaine.keithp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753181AbdJPUms (ORCPT ); Mon, 16 Oct 2017 16:42:48 -0400 From: "Keith Packard" To: Sean Paul Cc: linux-kernel@vger.kernel.org, Dave Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 3/5] drm: Add drm_object lease infrastructure [v4] In-Reply-To: <20171016194404.ugdcgjskit44bj7v@art_vandelay> References: <20171013015631.6926-1-keithp@keithp.com> <20171013015631.6926-4-keithp@keithp.com> <20171016194404.ugdcgjskit44bj7v@art_vandelay> Date: Mon, 16 Oct 2017 13:42:46 -0700 Message-ID: <87mv4qx1rt.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Sean Paul writes: > With these nits fixed, > Reviewed-by: Sean Paul Like this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-drm-Mark-functions-requiring-idr_mutex.-Add-lockdep-.patch Content-Transfer-Encoding: quoted-printable From=200aa52dd5a0873831c79c14942075354c041e5bed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Oct 2017 13:41:20 -0700 Subject: [PATCH] drm: Mark functions requiring idr_mutex. Add lockdep to _drm_lease_revoke Reasonable suggestions by Sean Paul. Signed-off-by: Keith Packard =2D-- drivers/gpu/drm/drm_lease.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c index 88c213f9c4ab..20694c77a2de 100644 =2D-- a/drivers/gpu/drm/drm_lease.c +++ b/drivers/gpu/drm/drm_lease.c @@ -58,7 +58,9 @@ _drm_find_lessee(struct drm_master *master, int lessee_id) } =20 /** =2D * _drm_lease_held_master - check to see if an object is leased (or owne= d) by master + * _drm_lease_held_master - check to see if an object is leased (or + * owned) by master (idr_mutex held) + * * @master: the master to check the lease status of * @id: the id to check * @@ -77,7 +79,7 @@ static int _drm_lease_held_master(struct drm_master *mast= er, int id) } =20 /** =2D * _drm_has_leased - check to see if an object has been leased + * _drm_has_leased - check to see if an object has been leased (idr mutex = held) * @master: the master to check the lease status of * @id: the id to check * @@ -300,8 +302,8 @@ void drm_lease_destroy(struct drm_master *master) } =20 /** =2D * _drm_lease_revoke - revoke access to all leased objects =2D * @master: the master losing its lease + * _drm_lease_revoke - revoke access to all leased objects (idr_mutex held) + * @top: the master losing its lease */ =20 void _drm_lease_revoke(struct drm_master *top) @@ -310,6 +312,7 @@ void _drm_lease_revoke(struct drm_master *top) void *entry; struct drm_master *master =3D top; =20 + lockdep_assert_held(&top->dev->mode_config.idr_mutex); /* * Walk the tree starting at 'top' emptying all leases. Because * the tree is fully connected, we can do this without recursing =2D-=20 2.15.0.rc0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 =2Dkeith --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAlnlGcYACgkQ2yIaaQAA ABE0dhAAga77BKkysrO0VcP64a3+TmIvPn4pOXQkrYx/9T5vx2y7f4P0ZWrR8KsT 11FwwnCDCb3BBwgkJX3jkdnVoY0t1aMEprlJvO8FfSb5/6xsU8xYQlp93xd7po8u kFm16jHi0RIWOJWvqMwXk/FbuPZ5C2IrNmklPnMVQbKx9x7YHz8v6rXOs9vQV5Gp aimQCyKdsgYEuKlagEtvOC/Vtdl8Lw7yv74+FDU5wx1gKcma1ltVDzl+Pdcp7uUW 7BBzrlJCi+e7UZhy6p4fDrvVRD89xDeoVCHHWC2svfDfEyymOjqkezFG2MGalApn bNE8uztJyVJ3paztYq78el+9h0UBkEz9u5PYDqm9o32fnO+8GXcawMcZ3eMs/7xB T4O/Cs6CWtcX5eA979U+0wWmCv8AcsTE3MUsPo04sFz8BIWjv/KazNa/p6Z0MrHD q+ZZc//nnQtwX/3rmlBp8pnW8anPJucxMk8CeUx2trjkhJAR8FX3Q2NYqFrL95kR 3C/qdP1m76vGQ5At7RuiKNGYoJHfK/oK5wtnbqi6AC1LR6nhnz2l1Xa0QH77KcWi Yef5SaAS8vV4moKAGN2HMij2vU1gk/G6Ik14nKiLzlZsjmC2fWndt2CuvMfVItl7 hBBzD0xJseqXsazIDDkIuk+5AhUlzJ2xByyEfXbSglo6+5RpMsA= =GHlm -----END PGP SIGNATURE----- --==-=-=--