From patchwork Mon Oct 16 20:42:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 10009831 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 3C577601D5 for ; Mon, 16 Oct 2017 20:42:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E6E028633 for ; Mon, 16 Oct 2017 20:42:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23284286C5; Mon, 16 Oct 2017 20:42:52 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CD99328633 for ; Mon, 16 Oct 2017 20:42:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C0BD6E507; Mon, 16 Oct 2017 20:42:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id F0C316E507 for ; Mon, 16 Oct 2017 20:42:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 8CE793F2078B; Mon, 16 Oct 2017 13:42:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id uvMjdS-2G0AD; Mon, 16 Oct 2017 13:42:46 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id B14E13F20341; Mon, 16 Oct 2017 13:42:46 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 9C5F9158215D; Mon, 16 Oct 2017 13:42:46 -0700 (PDT) From: "Keith Packard" To: Sean Paul 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 Cc: Dave Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Sean Paul writes: > With these nits fixed, > Reviewed-by: Sean Paul Like this? From 0aa52dd5a0873831c79c14942075354c041e5bed 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 --- 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