From patchwork Fri Jul 21 16:20:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 9857281 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 04DFF60393 for ; Fri, 21 Jul 2017 16:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E59202872B for ; Fri, 21 Jul 2017 16:30:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA4D228767; Fri, 21 Jul 2017 16:30:17 +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.4 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_WEB autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 656D12872B for ; Fri, 21 Jul 2017 16:30:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752098AbdGUQaP (ORCPT ); Fri, 21 Jul 2017 12:30:15 -0400 Received: from vsmx011.vodafonemail.xion.oxcs.net ([153.92.174.89]:52081 "EHLO vsmx011.vodafonemail.xion.oxcs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996AbdGUQaP (ORCPT ); Fri, 21 Jul 2017 12:30:15 -0400 X-Greylist: delayed 596 seconds by postgrey-1.27 at vger.kernel.org; Fri, 21 Jul 2017 12:30:15 EDT Received: from vsmx003.vodafonemail.xion.oxcs.net (unknown [192.168.75.197]) by mta-5-out.mta.xion.oxcs.net (Postfix) with ESMTP id 25D413E0190; Fri, 21 Jul 2017 16:20:18 +0000 (UTC) Received: from laptop.amd.com (unknown [165.204.55.251]) by mta-7-out.mta.xion.oxcs.net (Postfix) with ESMTPA id B4985300EA4; Fri, 21 Jul 2017 16:20:06 +0000 (UTC) From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Cc: sumit.semwal@linaro.org Subject: [PATCH] dma-buf: fix reservation_object_wait_timeout_rcu to wait correctly Date: Fri, 21 Jul 2017 18:20:01 +0200 Message-Id: <1500654001-20899-1-git-send-email-deathsimple@vodafone.de> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-VADE-STATUS: LEGIT Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Christian König With hardware resets in mind it is possible that all shared fences are signaled, but the exlusive isn't. Fix waiting for everything in this situation. Signed-off-by: Christian König --- drivers/dma-buf/reservation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma-buf/reservation.c b/drivers/dma-buf/reservation.c index e2eff86..ce3f9c1 100644 --- a/drivers/dma-buf/reservation.c +++ b/drivers/dma-buf/reservation.c @@ -461,7 +461,7 @@ long reservation_object_wait_timeout_rcu(struct reservation_object *obj, } } - if (!shared_count) { + if (!fence) { struct dma_fence *fence_excl = rcu_dereference(obj->fence_excl); if (fence_excl &&