From patchwork Tue Sep 15 14:13:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "gregkh@linuxfoundation.org" X-Patchwork-Id: 309737 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=-15.7 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=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 4C5D8C43461 for ; Tue, 15 Sep 2020 14:34:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F124621655 for ; Tue, 15 Sep 2020 14:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600180483; bh=4sSaA8sSc/MSeLJiOieIDKBP7CzF7vHakoPHP8AZ5Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=nGzALzkt5Pf0vKB+lpoO6pK/IBq2H296NXJcOJ+wmFvUVyMvRycopr31NzT4NlIAz 0x+pi7DCuV7RrScGoCu4Y2Iea3x6F9rnO4C9/7wzikJ7OJfbgNYXBKIDpV64bXBniP f0z2wtyexKX1zE9vIx9bL9gounDW0L52LnJrK4p0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726450AbgIOOdN (ORCPT ); Tue, 15 Sep 2020 10:33:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:42988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgIOOca (ORCPT ); Tue, 15 Sep 2020 10:32:30 -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 B0F29222BB; Tue, 15 Sep 2020 14:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600179834; bh=4sSaA8sSc/MSeLJiOieIDKBP7CzF7vHakoPHP8AZ5Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GTUAhr/QVsV0d1p01tGVcaBk4aZ/KrfhZz4juuUBOP/XaYSn+ksF6X4sdViPjZIZl tJQccIaK/nHXeyVCDd+F/Eszz5fcyhXEkJuXG8QeFrlccAcS3j9s9F1aVLA0Flqxw8 adx+Lrvj6G4iVxTMa/0IzoTMiRHAFe+VGo+P/4vc= 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 5.4 129/132] drm/msm/gpu: make ringbuffer readonly Date: Tue, 15 Sep 2020 16:13:51 +0200 Message-Id: <20200915140650.568692745@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140644.037604909@linuxfoundation.org> References: <20200915140644.037604909@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 352c83fb39cae3eff95a8e1ed23006291abb6196 ] The GPU has no business writing into the ringbuffer, let's make it readonly to the GPU. Fixes: 7198e6b03155 ("drm/msm: add a3xx gpu support") Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/msm_ringbuffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c index e397c44cc0112..39ecb5a18431e 100644 --- a/drivers/gpu/drm/msm/msm_ringbuffer.c +++ b/drivers/gpu/drm/msm/msm_ringbuffer.c @@ -27,7 +27,8 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu *gpu, int id, ring->id = id; ring->start = msm_gem_kernel_new(gpu->dev, MSM_GPU_RINGBUFFER_SZ, - MSM_BO_WC, gpu->aspace, &ring->bo, &ring->iova); + MSM_BO_WC | MSM_BO_GPU_READONLY, gpu->aspace, &ring->bo, + &ring->iova); if (IS_ERR(ring->start)) { ret = PTR_ERR(ring->start);