From patchwork Thu Feb 14 18:24:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kernel test robot via dri-devel X-Patchwork-Id: 10813475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 903FE922 for ; Thu, 14 Feb 2019 18:25:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E8D42E7BC for ; Thu, 14 Feb 2019 18:25:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FDC82E6E2; Thu, 14 Feb 2019 18:25:06 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 20A4D2E6E2 for ; Thu, 14 Feb 2019 18:25:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B2D46E996; Thu, 14 Feb 2019 18:25:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BD486E996 for ; Thu, 14 Feb 2019 18:25:01 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 10:25:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,369,1544515200"; d="scan'208";a="299790521" Received: from delly.ld.intel.com ([10.103.238.201]) by orsmga005.jf.intel.com with ESMTP; 14 Feb 2019 10:24:59 -0800 To: dri-devel@lists.freedesktop.org Subject: [PATCH] dma-buf/sw_sync: remove points on release prior to signaling Date: Thu, 14 Feb 2019 18:24:56 +0000 Message-Id: <20190214182456.16871-1-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Lionel Landwerlin via dri-devel From: kernel test robot via dri-devel Reply-To: Lionel Landwerlin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Much like the sync_timeline_signal(), remove the points from the timeline so that if the callee is dropping the last reference on the point's fence we don't end up in a deadlock in timeline_fence_release(). Signed-off-by: Lionel Landwerlin --- drivers/dma-buf/sw_sync.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c index 32dcf7b4c935..78c1c25cab7b 100644 --- a/drivers/dma-buf/sw_sync.c +++ b/drivers/dma-buf/sw_sync.c @@ -325,6 +325,9 @@ static int sw_sync_debugfs_release(struct inode *inode, struct file *file) spin_lock_irq(&obj->lock); list_for_each_entry_safe(pt, next, &obj->pt_list, link) { + list_del_init(&pt->link); + rb_erase(&pt->node, &obj->pt_tree); + dma_fence_set_error(&pt->base, -ENOENT); dma_fence_signal_locked(&pt->base); }