From patchwork Tue Mar 17 10:54:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 229244 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EE46C2BB1D for ; Tue, 17 Mar 2020 11:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 58E47205ED for ; Tue, 17 Mar 2020 11:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584443819; bh=8QmZkzuHsdxht+9tD81+KsUAcaTkKirBAlactgxm99g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XjiPUV/ZugpXDApKWlmX+qPr261K272Sp0IunvvoGn2vCkVh0/c6cdHlZP+Ix5LWC 3dIYkoCfAOflcug6Qz/C395fBe/1xkytde1S2GnrfSvnSk1g87znACXlcblerfGW6/ ZMJ0yVlU2CRerpYJgz6nXjlAtSTRnzvbF5OvKTMk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728300AbgCQLQ6 (ORCPT ); Tue, 17 Mar 2020 07:16:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:53998 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbgCQLK5 (ORCPT ); Tue, 17 Mar 2020 07:10:57 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A296E205ED; Tue, 17 Mar 2020 11:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584443456; bh=8QmZkzuHsdxht+9tD81+KsUAcaTkKirBAlactgxm99g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CGOALJab7NG2GIhm9h1YTpN4i4Cfqd2bzbu9HRMYhnxfIB9K7VzDurRgjVj4QOJKn YQKnj/Yj7dPE2m12bZkEnROgKsTOvrx6gltio7mN4mI6OKsMPYyVkcvi/zX0kdIEXi /ngQruGMy+rWAmBAtaiVo+9ed9JRfXn9CPTYVF+o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chris Wilson , Tvrtko Ursulin , Tvrtko Ursulin , Jani Nikula Subject: [PATCH 5.5 086/151] drm/i915: Return early for await_start on same timeline Date: Tue, 17 Mar 2020 11:54:56 +0100 Message-Id: <20200317103332.561541321@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200317103326.593639086@linuxfoundation.org> References: <20200317103326.593639086@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Chris Wilson commit c951b0af2dddbb1f34be103029eb9030392d5554 upstream. Requests within a timeline are ordered by that timeline, so awaiting for the start of a request within the timeline is a no-op. This used to work by falling out of the mutex_trylock() as the signaler and waiter had the same timeline and not returning an error. Fixes: 6a79d848403d ("drm/i915: Lock signaler timeline while navigating") Signed-off-by: Chris Wilson Cc: Tvrtko Ursulin Cc: # v5.5+ Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20200305134822.2750496-1-chris@chris-wilson.co.uk (cherry picked from commit ab7a69020fb5d5c7ba19fba60f62fd6f9ca9f779) Signed-off-by: Jani Nikula Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/i915_request.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -759,8 +759,8 @@ i915_request_await_start(struct i915_req struct dma_fence *fence; int err; - GEM_BUG_ON(i915_request_timeline(rq) == - rcu_access_pointer(signal->timeline)); + if (i915_request_timeline(rq) == rcu_access_pointer(signal->timeline)) + return 0; rcu_read_lock(); tl = rcu_dereference(signal->timeline);