mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Puranam V G Tejaswi <puranam.tejaswi@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Abel Vesa <abelvesa@kernel.org>,
	Rob Clark <robin.clark@oss.qualcomm.com>,
	Sean Paul <sean@poorly.run>,
	Akhil P Oommen <akhilpo@oss.qualcomm.com>,
	Dmitry Baryshkov <lumag@kernel.org>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Puranam V G Tejaswi <puranam.tejaswi@oss.qualcomm.com>
Subject: [PATCH 2/6] drm/msm/a6xx: Don't fail GMU resume if the GPU init regs SCM call is absent
Date: Wed, 18 Nov 2026 18:38:26 +0530	[thread overview]
Message-ID: <20261118-adreno-scm-fallback-v1-2-e99cdbf3121d@oss.qualcomm.com> (raw)
In-Reply-To: <20261118-adreno-scm-fallback-v1-0-e99cdbf3121d@oss.qualcomm.com>

On A750, A753 and A8xx, a6xx_gmu_secure_init() asks the secure world to
program CX_MISC_SW_FUSE_VALUE through qcom_scm_gpu_init_regs(), and
aborts the GMU resume if that call fails.

Some platforms have a secure world that does not implement this call.
The call fails every time and the GPU never powers up. The fuse
register is still protected from the kernel, so the driver cannot
program it directly either.

If the secure world does not support the call, skip it, but still read
the fuse register back. An earlier boot stage may have programmed it,
and the features it enables, such as raytracing, are then reported
correctly. If nothing programmed it, they stay disabled. Log once when
the call is skipped.

Signed-off-by: Puranam V G Tejaswi <puranam.tejaswi@oss.qualcomm.com>
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 0fa2d2091f3e..95636dabee38 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1249,22 +1249,31 @@ static int a6xx_gmu_secure_init(struct a6xx_gpu *a6xx_gpu)
 			goto done;
 		}
 
-		u32 gpu_req = QCOM_SCM_GPU_ALWAYS_EN_REQ | QCOM_SCM_GPU_TSENSE_EN_REQ;
+		/*
+		 * Some secure world implementations do not provide this call.
+		 * Skip it then. An earlier boot stage may still have
+		 * programmed the fuse register, so read it back either way.
+		 */
+		if (qcom_scm_gpu_init_regs_is_available()) {
+			u32 gpu_req = QCOM_SCM_GPU_ALWAYS_EN_REQ |
+				      QCOM_SCM_GPU_TSENSE_EN_REQ;
 
-		if (adreno_gpu->info->a6xx->clx_tbl)
-			gpu_req |= QCOM_SCM_GPU_CLX_EN_REQ;
+			if (adreno_gpu->info->a6xx->clx_tbl)
+				gpu_req |= QCOM_SCM_GPU_CLX_EN_REQ;
 
-		ret = qcom_scm_gpu_init_regs(gpu_req);
-		if (ret) {
-			dev_warn_once(gpu->dev->dev,
-				"SCM call failed\n");
-			return ret;
+			ret = qcom_scm_gpu_init_regs(gpu_req);
+			if (ret) {
+				dev_warn_once(gpu->dev->dev, "SCM call failed\n");
+				return ret;
+			}
+		} else {
+			dev_info_once(gpu->dev->dev, "GPU init regs SCM call not available, skipping\n");
 		}
 
 		/*
 		 * On A7XX_GEN3 and newer, raytracing may be disabled by the
 		 * firmware, find out whether that's the case. The scm call
-		 * above sets the fuse register.
+		 * above, or an earlier boot stage, sets the fuse register.
 		 */
 		fuse_val = a6xx_cx_misc_read(a6xx_gpu,
 					 REG_A7XX_CX_MISC_SW_FUSE_VALUE);

-- 
2.34.1


  parent reply	other threads:[~2026-11-18 13:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 13:08 [PATCH 0/6] drm/msm/adreno: Handle unavailable GPU SCM calls Puranam V G Tejaswi
2026-11-18 13:08 ` [PATCH 1/6] firmware: qcom: scm: Add qcom_scm_gpu_init_regs_is_available() Puranam V G Tejaswi
2026-11-18 13:08 ` Puranam V G Tejaswi [this message]
2026-11-18 13:08 ` [PATCH 3/6] dt-bindings: display/msm: gpu: Document the CX SMMU aperture region Puranam V G Tejaswi
2026-11-18 13:08 ` [PATCH 4/6] drm/msm/adreno: Program the SMMU aperture when the secure world can't Puranam V G Tejaswi
2026-11-18 13:08 ` [PATCH 5/6] arm64: dts: qcom: nord: Describe the GPU CX SMMU aperture Puranam V G Tejaswi
2026-11-18 13:08 ` [PATCH 6/6] arm64: dts: qcom: shikra: " Puranam V G Tejaswi

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=20261118-adreno-scm-fallback-v1-2-e99cdbf3121d@oss.qualcomm.com \
    --to=puranam.tejaswi@oss.qualcomm.com \
    --cc=abelvesa@kernel.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=airlied@gmail.com \
    --cc=akhilpo@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lumag@kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marijn.suijten@somainline.org \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=robin.clark@oss.qualcomm.com \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®