From patchwork Tue Sep 1 15:10:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 264510 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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 4A4F6C433E7 for ; Tue, 1 Sep 2020 16:57:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 143D920767 for ; Tue, 1 Sep 2020 16:57:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598979447; bh=I0kOzhv1g8NoCAaKgJBn0Xb3Tnk6vW4cGCeV6bycCBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=p5rQdwr9ne9xkCVx70OOpEAsoY8uZ0vBNBExHDX+xEjWx0sVEwzCtzfxpkiszpEYU fbqbh0Q2vt3w4j/VUB1HpTZxpI+VAfNaLmLJ+fg41Tg0cEJt8OUmnxbWfRATBLfXtz WXGCm0/fBSkR3tA8PYIRjzbp3DXPRRKf8Ng0NY9I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729099AbgIAPX3 (ORCPT ); Tue, 1 Sep 2020 11:23:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:46512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbgIAPX1 (ORCPT ); Tue, 1 Sep 2020 11:23:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 6CAED206FA; Tue, 1 Sep 2020 15:23:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598973806; bh=I0kOzhv1g8NoCAaKgJBn0Xb3Tnk6vW4cGCeV6bycCBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=foEKt4SmSfkDYcNZo0BgBYScSbKDa9gsKAs9vHtzS3Oxby0ufWnBcgjlXWQodb7pf Ufv2HN0bPV4I6/2YEf/37TIMgXqy4vs1z0tr9yXS+8LEV4nGtSBM2CcQ1gPiY1/Lq5 1QtSDV7Ls3AF+Ma/H0pvP+vXBiUYj/f5QjBRDJGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Jordan Crouse , Sasha Levin Subject: [PATCH 4.19 054/125] drm/msm/adreno: fix updating ring fence Date: Tue, 1 Sep 2020 17:10:09 +0200 Message-Id: <20200901150937.201029823@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901150934.576210879@linuxfoundation.org> References: <20200901150934.576210879@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: Rob Clark [ Upstream commit f228af11dfa1d1616bc67f3a4119ab77c36181f1 ] We need to set it to the most recent completed fence, not the most recent submitted. Otherwise we have races where we think we can retire submits that the GPU is not finished with, if the GPU doesn't manage to overwrite the seqno before we look at it. This can show up with hang recovery if one of the submits after the crashing submit also hangs after it is replayed. Fixes: f97decac5f4c ("drm/msm: Support multiple ringbuffers") Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index 93d70f4a2154e..c9f831604558f 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -221,7 +221,7 @@ int adreno_hw_init(struct msm_gpu *gpu) ring->next = ring->start; /* reset completed fence seqno: */ - ring->memptrs->fence = ring->seqno; + ring->memptrs->fence = ring->fctx->completed_fence; ring->memptrs->rptr = 0; }