Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9129690pxu; Mon, 28 Dec 2020 07:20:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQqk5zIHgo3bFDUR2JHI33ipswot3W6xJa6GctwmkmMrJbVyriYI2R2JiDuOIdWya11jFZ X-Received: by 2002:aa7:c84c:: with SMTP id g12mr41901494edt.193.1609168846472; Mon, 28 Dec 2020 07:20:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609168846; cv=none; d=google.com; s=arc-20160816; b=x1d7LzVCOBGnV1/1ZrtcCJ8qSHMhYTTazOqa9FS8QN2RkltnyplRgq6TsSeNwuJgN7 HLpnLiiJfRzZy7Fh3njnTYo+E81QsZjNrEo5c45GTORPtIU/UV/MkkQNDldBdkpxjV2l NUarIP4/hsvcFsTEGIZm7V5leQ2Tok3vZhVj/h8jY2rMF1SAFZscrYbBB2FcurX40Dur XSlHIgIc7tN9WSdncdz/VqIYTjeLpQIvs/tUZMzJ3KqbrNRUfAhDtIJqeyxJO3YW9eT/ li6jDyGwEImkHyZ4za85A7qql27HBUL4vCXT3uxRcD4KjFFbGoa2xkX+gpBohiL/H8YS bfmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qWa+ktcDxwI/a6oaWv97GPYX03WFqI0ybOInuXET+uM=; b=Yq6Tck3tqUboPrZ8wJLXOTvKD9AgABv+0tlahSc9PGWjDT6xLQtTLhtPuarD2cm49z hIJAB46ckCFT4F+PKUR2fBaDLMQUWelDTSylm6iUCTvltF13ZPuLKC/UlpK4T0sFejXn 6VDxIXLXAbkRoXk3BKASNCxSGJ4+inMN/+tNwKJlg8MxZ1efaYgK7fawYUgy8RMt3SGv gXYsm74sgxR8IStnbX/LEeOAcM5Tw+5iMd+4HqSmKyShWZKPULwhdM+CqwCOuM36oEig cR1QAc+/2a0+0DzeWkkb9HUa4bkjxrhKv4eyPL5zkRuQNNDNa9xgCyBG6Atay0Xm+6st MtRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dCfBEcSq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si10749167edb.68.2020.12.28.07.20.22; Mon, 28 Dec 2020 07:20:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dCfBEcSq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437147AbgL1PSl (ORCPT + 99 others); Mon, 28 Dec 2020 10:18:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:36026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437072AbgL1ODH (ORCPT ); Mon, 28 Dec 2020 09:03:07 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B8672063A; Mon, 28 Dec 2020 14:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164171; bh=nRf3/WRu2GDMLK5H8uNZSOI5Rwq1q3jFSCWjRTjDcZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dCfBEcSqjuiVLWYmkQGwe5cJZCma9+V8soePNnFsA5P5Jud9+6s3g7wmKjsIoe/Pb nbSFNvxFC0hezoxBFa07u64Uk/kBmj/6MGQ69Be1WoyEQXdByVwljWJIaj1XaUjBE6 Qe3wph1S/PvBtB0+emEfzp4MvO/+vM9fKxD3Klew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Sasha Levin Subject: [PATCH 5.10 087/717] drm/msm/a5xx: Clear shadow on suspend Date: Mon, 28 Dec 2020 13:41:25 +0100 Message-Id: <20201228125025.146827964@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark [ Upstream commit 5771de5d5b3bfaf279e5c262a113d4b6fbe54355 ] Similar to the previous patch, clear shadow on suspend to avoid timeouts waiting for ringbuffer space. Fixes: 8907afb476ac ("drm/msm: Allow a5xx to mark the RPTR shadow as privileged") Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index d6804a8023555..8aa08976aad17 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -1207,7 +1207,9 @@ static int a5xx_pm_resume(struct msm_gpu *gpu) static int a5xx_pm_suspend(struct msm_gpu *gpu) { struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); + struct a5xx_gpu *a5xx_gpu = to_a5xx_gpu(adreno_gpu); u32 mask = 0xf; + int i, ret; /* A510 has 3 XIN ports in VBIF */ if (adreno_is_a510(adreno_gpu)) @@ -1227,7 +1229,15 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu) gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD, 0x003C0000); gpu_write(gpu, REG_A5XX_RBBM_BLOCK_SW_RESET_CMD, 0x00000000); - return msm_gpu_pm_suspend(gpu); + ret = msm_gpu_pm_suspend(gpu); + if (ret) + return ret; + + if (a5xx_gpu->has_whereami) + for (i = 0; i < gpu->nr_rings; i++) + a5xx_gpu->shadow[i] = 0; + + return 0; } static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) -- 2.27.0