dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Rob Clark <robdclark@chromium.org>,
	Sasha Levin <sashal@kernel.org>,
	freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org
Subject: [PATCH AUTOSEL 5.4 032/459] drm/msm/adreno: fix zap vs no-zap handling
Date: Fri, 14 Feb 2020 10:54:42 -0500	[thread overview]
Message-ID: <20200214160149.11681-32-sashal@kernel.org> (raw)
In-Reply-To: <20200214160149.11681-1-sashal@kernel.org>

From: Rob Clark <robdclark@chromium.org>

[ Upstream commit 15ab987c423df561e0949d77fb5043921ae59956 ]

We can have two cases, when it comes to "zap" fw.  Either the fw
requires zap fw to take the GPU out of secure mode at boot, or it does
not and we can write RBBM_SECVID_TRUST_CNTL directly.  Previously we
decided based on whether zap fw load succeeded, but this is not a great
plan because:

1) we could have zap fw in the filesystem on a device where it is not
   required
2) we could have the inverse case

Instead, shift to deciding based on whether we have a 'zap-shader' node
in dt.  In practice, there is only one device (currently) with upstream
dt that does not use zap (cheza), and it already has a /delete-node/ for
the zap-shader node.

Fixes: abccb9fe3267 ("drm/msm/a6xx: Add zap shader load")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 +++++++++--
 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 11 +++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
index e9c55d1d6c044..99cd6e62a9715 100644
--- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c
@@ -726,11 +726,18 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
 		gpu->funcs->flush(gpu, gpu->rb[0]);
 		if (!a5xx_idle(gpu, gpu->rb[0]))
 			return -EINVAL;
-	} else {
-		/* Print a warning so if we die, we know why */
+	} else if (ret == -ENODEV) {
+		/*
+		 * This device does not use zap shader (but print a warning
+		 * just in case someone got their dt wrong.. hopefully they
+		 * have a debug UART to realize the error of their ways...
+		 * if you mess this up you are about to crash horribly)
+		 */
 		dev_warn_once(gpu->dev->dev,
 			"Zap shader not enabled - using SECVID_TRUST_CNTL instead\n");
 		gpu_write(gpu, REG_A5XX_RBBM_SECVID_TRUST_CNTL, 0x0);
+	} else {
+		return ret;
 	}
 
 	/* Last step - yield the ringbuffer */
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
index dc8ec2c94301b..686c34d706b0d 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c
@@ -537,12 +537,19 @@ static int a6xx_hw_init(struct msm_gpu *gpu)
 		a6xx_flush(gpu, gpu->rb[0]);
 		if (!a6xx_idle(gpu, gpu->rb[0]))
 			return -EINVAL;
-	} else {
-		/* Print a warning so if we die, we know why */
+	} else if (ret == -ENODEV) {
+		/*
+		 * This device does not use zap shader (but print a warning
+		 * just in case someone got their dt wrong.. hopefully they
+		 * have a debug UART to realize the error of their ways...
+		 * if you mess this up you are about to crash horribly)
+		 */
 		dev_warn_once(gpu->dev->dev,
 			"Zap shader not enabled - using SECVID_TRUST_CNTL instead\n");
 		gpu_write(gpu, REG_A6XX_RBBM_SECVID_TRUST_CNTL, 0x0);
 		ret = 0;
+	} else {
+		return ret;
 	}
 
 out:
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-02-14 16:02 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 15:54 [PATCH AUTOSEL 5.4 001/459] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c' Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 002/459] drm/gma500: Fixup fbdev stolen size usage evaluation Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 005/459] drm/qxl: Complete exception handling in qxl_device_init() Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 023/459] drm/amd/display: Map ODM memory correctly when doing ODM combine Sasha Levin
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 031/459] drm/mipi_dbi: Fix off-by-one bugs in mipi_dbi_blank() Sasha Levin
2020-02-14 15:54 ` Sasha Levin [this message]
2020-02-14 15:54 ` [PATCH AUTOSEL 5.4 033/459] pxa168fb: Fix the function used to release some memory in an error handling path Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 061/459] drm/amdgpu/sriov: workaround on rev_id for Navi12 under sriov Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 065/459] drm/nouveau/nouveau: fix incorrect sizeof on args.src an args.dst Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 070/459] drm/amd/display: Clear state after exiting fixed active VRR state Sasha Levin
2020-02-14 15:55 ` [PATCH AUTOSEL 5.4 101/459] drm/amd/display: Retrain dongles when SINK_COUNT becomes non-zero Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 113/459] drm/amdkfd: Fix a bug in SDMA RLC queue counting under HWS mode Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 119/459] drm/amdgpu: remove 4 set but not used variable in amdgpu_atombios_get_connector_info_from_object_table Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 120/459] drm/amdgpu: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 121/459] drm/amdgpu: remove set but not used variable 'dig' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 122/459] drm/amdgpu: remove always false comparison in 'amdgpu_atombios_i2c_process_i2c_ch' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 123/459] drm/amdgpu: remove set but not used variable 'mc_shared_chmap' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 124/459] drm/amd/powerplay: remove set but not used variable 'vbios_version', 'data' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 125/459] drm/amd/powerplay: remove set but not used variable 'data' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 126/459] drm/amd/powerplay: remove set but not used variable 'threshold', 'state' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 127/459] drm/amdgpu: remove set but not used variable 'amdgpu_connector' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 128/459] drm/amdgpu: remove set but not used variable 'count' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 129/459] drm/amdgpu: remove set but not used variable 'invalid' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 130/459] drm/amd/powerplay: remove set but not used variable 'us_mvdd' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 131/459] drm/gma500: remove set but not used variable 'htotal' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 132/459] drm/gma500: remove set but not used variable 'error' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 133/459] drm/gma500: remove set but not used variable 'is_hdmi', 'is_crt' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 134/459] drm/gma500: remove set but not used variable 'channel_eq' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 135/459] drm/amdkfd: remove set but not used variable 'top_dev' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 136/459] drm/amd/display: remove set but not used variable 'old_plane_crtc' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 137/459] drm/amd/display: remove set but not used variable 'bp' in bios_parser2.c Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 138/459] drm/amd/display: remove set but not used variable 'bp' in bios_parser.c Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 139/459] drm/radeon: remove set but not used variable 'size', 'relocs_chunk' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 140/459] drm/radeon: remove set but not used variable 'backbias_response_time' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 141/459] drm/radeon: remove set but not used variable 'dig_connector' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 142/459] drm/radeon: remove set but not used variable 'radeon_connector' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 143/459] drm/radeon: remove set but not used variable 'blocks' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 144/459] drm/radeon: remove set but not used variable 'tv_pll_cntl1' Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 146/459] drm/amdgpu: Ensure ret is always initialized when using SOC15_WAIT_ON_RREG Sasha Levin
2020-02-14 15:56 ` [PATCH AUTOSEL 5.4 147/459] drm/panel: simple: Add Logic PD Type 28 display support Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 182/459] gpu/drm: ingenic: Avoid null pointer deference in plane atomic update Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 204/459] drm/amdgpu: fix KIQ ring test fail in TDR of SRIOV Sasha Levin
2020-02-14 15:57 ` [PATCH AUTOSEL 5.4 212/459] drm/mediatek: handle events when enabling/disabling crtc Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 234/459] drm/fbdev: Fallback to non tiled mode if all tiles not present Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 239/459] fbdev: fix numbering of fbcon options Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 255/459] drm/amdkfd: Fix permissions of hang_hws Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 258/459] drm: remove the newline for CRC source name Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 260/459] drm/gma500: remove set but not used variables 'hist_reg' Sasha Levin
2020-02-14 15:58 ` [PATCH AUTOSEL 5.4 270/459] drm/mediatek: Add gamma property according to hardware capability Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 309/459] drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new() Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 310/459] drm/nouveau/gr/gk20a, gm200-: add terminators to method lists read from fw Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 311/459] drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 312/459] drm/nouveau/drm/ttm: Remove set but not used variable 'mem' Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 313/459] drm/nouveau/fault/gv100-: fix memory leak on module unload Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 316/459] drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add Sasha Levin
2020-02-14 15:59 ` [PATCH AUTOSEL 5.4 337/459] drm/amd/display: fixup DML dependencies Sasha Levin
2020-02-14 16:00 ` [PATCH AUTOSEL 5.4 379/459] drm/nouveau/mmu: fix comptag memory leak Sasha Levin
2020-02-14 16:00 ` [PATCH AUTOSEL 5.4 380/459] drm/nouveau/kms/nv50: remove set but not unused variable 'nv_connector' Sasha Levin
2020-02-14 16:01 ` [PATCH AUTOSEL 5.4 422/459] drm/amd/display: do not allocate display_mode_lib unnecessarily Sasha Levin
2020-02-14 16:01 ` [PATCH AUTOSEL 5.4 424/459] drm/nouveau/disp/nv50-: prevent oops when no channel method map provided Sasha Levin
2020-02-14 16:01 ` [PATCH AUTOSEL 5.4 429/459] radeon: insert 10ms sleep in dce5_crtc_load_lut Sasha Levin
2020-02-14 16:01 ` [PATCH AUTOSEL 5.4 449/459] drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_latency Sasha Levin
2020-02-14 16:01 ` [PATCH AUTOSEL 5.4 450/459] drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_voltage Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200214160149.11681-32-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@chromium.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).