From patchwork Tue Sep 15 14:14:07 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: 309712 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 D5F3DC2D0E3 for ; Tue, 15 Sep 2020 23:10:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95EEC20B1F for ; Tue, 15 Sep 2020 23:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600211440; bh=4sSaA8sSc/MSeLJiOieIDKBP7CzF7vHakoPHP8AZ5Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ZxePbMv/O0Y9xKGiznY6/2hyLWuRLs18ech0cuHNJm8FlsodYwuP93DffHWkaGx6h GUi31WzDr9dGVbd1Vxu/pLd1lRP7a6Mm30vl4rIiAskt97iazHg9iScOVtleQBDPNH bg7AXQXhQTjFV1ORfXG33vzdK6/a2Te925IBgaHI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727362AbgIOXKd (ORCPT ); Tue, 15 Sep 2020 19:10:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:48878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727296AbgIOOlg (ORCPT ); Tue, 15 Sep 2020 10:41:36 -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 89206229C5; Tue, 15 Sep 2020 14:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600180273; bh=4sSaA8sSc/MSeLJiOieIDKBP7CzF7vHakoPHP8AZ5Fs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bkwtr3WUI/SLaX2GOaw6rUWi47FmuSKoU9hg4Ilo6XARCR67mzBmnw0KidKZUjt1M 23ZpRntx4bUpPjVj99/hGBfMnQQDTPj4LHPPw+Na62oozeLXUTunCz4sQfL5gqInoO 9nqqAz3lbKOZGh+yJ+A/0B9vREeYTbIMsQd0Hmrg= 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.8 176/177] drm/msm/gpu: make ringbuffer readonly Date: Tue, 15 Sep 2020 16:14:07 +0200 Message-Id: <20200915140702.136549679@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200915140653.610388773@linuxfoundation.org> References: <20200915140653.610388773@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);