All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Keith Packard" <keithp@keithp.com>
To: Sean Paul <seanpaul@chromium.org>
Cc: linux-kernel@vger.kernel.org, Dave Airlie <airlied@redhat.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm: Add drm_object lease infrastructure [v4]
Date: Mon, 16 Oct 2017 13:42:46 -0700	[thread overview]
Message-ID: <87mv4qx1rt.fsf@keithp.com> (raw)
In-Reply-To: <20171016194404.ugdcgjskit44bj7v@art_vandelay>


[-- Attachment #1.1: Type: text/plain, Size: 131 bytes --]

Sean Paul <seanpaul@chromium.org> writes:


> With these nits fixed,
> Reviewed-by: Sean Paul <seanpaul@chromium.org>

Like this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-drm-Mark-functions-requiring-idr_mutex.-Add-lockdep-.patch --]
[-- Type: text/x-diff, Size: 2063 bytes --]

From 0aa52dd5a0873831c79c14942075354c041e5bed Mon Sep 17 00:00:00 2001
From: Keith Packard <keithp@keithp.com>
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 <keithp@keithp.com>
---
 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
--- 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)
 }
 
 /**
- * _drm_lease_held_master - check to see if an object is leased (or owned) 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 *master, int id)
 }
 
 /**
- * _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)
 }
 
 /**
- * _drm_lease_revoke - revoke access to all leased objects
- * @master: the master losing its lease
+ * _drm_lease_revoke - revoke access to all leased objects (idr_mutex held)
+ * @top: the master losing its lease
  */
 
 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 = top;
 
+	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
-- 
2.15.0.rc0


[-- Attachment #1.3: Type: text/plain, Size: 17 bytes --]



-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2017-10-16 20:42 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  1:56 [PATCH 0/5]: drm: Add drm mode object leases Keith Packard
2017-10-13  1:56 ` Keith Packard
2017-10-13  1:56 ` [PATCH 1/5] drm/plane: drop num_overlay_planes (v2) Keith Packard
2017-10-16 19:23   ` Sean Paul
2017-10-13  1:56 ` [PATCH 2/5] drm: Add new LEASE debug level Keith Packard
2017-10-13  1:56   ` Keith Packard
2017-10-16 19:24   ` Sean Paul
2017-10-13  1:56 ` [PATCH 3/5] drm: Add drm_object lease infrastructure [v4] Keith Packard
2017-10-13  1:56   ` Keith Packard
2017-10-16 19:44   ` Sean Paul
2017-10-16 20:42     ` Keith Packard [this message]
2017-10-16 21:05       ` Sean Paul
2017-10-16 21:05         ` Sean Paul
2017-10-13  1:56 ` [PATCH 4/5] drm: Check mode object lease status in all master ioctl paths [v3] Keith Packard
2017-10-13  1:56   ` Keith Packard
2017-10-16 20:34   ` Sean Paul
2017-10-13  1:56 ` [PATCH 5/5] drm: Add four ioctls for managing drm mode object leases [v6] Keith Packard
2017-10-13  1:56   ` Keith Packard
2017-10-16 21:03   ` Sean Paul
2017-10-16 21:03     ` Sean Paul
2017-10-16 21:31     ` Keith Packard
2017-10-16 21:31       ` Keith Packard
2017-10-16  9:13 ` [PATCH 0/5]: drm: Add drm mode object leases Daniel Vetter
2017-10-16  9:13   ` Daniel Vetter
2017-10-16 17:52   ` Keith Packard
2017-10-16 17:52     ` Keith Packard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mv4qx1rt.fsf@keithp.com \
    --to=keithp@keithp.com \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.