From: Akhil P Oommen <akhilpo@oss.qualcomm.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Sean Paul <sean@poorly.run>, 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>,
Jonathan Marek <jonathan@marek.ca>,
Jordan Crouse <jordan@cosmicpenguin.net>,
Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Joerg Roedel <joro@8bytes.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
Connor Abbott <cwabbott0@gmail.com>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev,
devicetree@vger.kernel.org,
Akhil P Oommen <akhilpo@oss.qualcomm.com>
Subject: [PATCH v2 11/21] drm/msm/a6xx: Improve MX rail fallback in RPMH vote init
Date: Mon, 10 Nov 2025 22:07:17 +0530 [thread overview]
Message-ID: <20251110-kaana-gpu-support-v2-11-bef18acd5e94@oss.qualcomm.com> (raw)
In-Reply-To: <20251110-kaana-gpu-support-v2-0-bef18acd5e94@oss.qualcomm.com>
Current logic assumes that the voltage corners in both MxG and MxA are
always same. This is not true for recent targets. So, rework the rpmh init
sequence to probe and calculate the votes with the respective rails, ie,
GX rails should use MxG as secondary rail and Cx rail should use MxA as
the secondary rail.
Fixes: d6225e0cd096 ("drm/msm/adreno: Add support for X185 GPU")
Signed-off-by: Akhil P Oommen <akhilpo@oss.qualcomm.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 112ef7ea320f..8597d7adf2f7 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1519,13 +1519,14 @@ static unsigned int a6xx_gmu_get_arc_level(struct device *dev,
}
static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
- unsigned long *freqs, int freqs_count, const char *id)
+ unsigned long *freqs, int freqs_count,
+ const char *pri_id, const char *sec_id)
{
int i, j;
const u16 *pri, *sec;
size_t pri_count, sec_count;
- pri = cmd_db_read_aux_data(id, &pri_count);
+ pri = cmd_db_read_aux_data(pri_id, &pri_count);
if (IS_ERR(pri))
return PTR_ERR(pri);
/*
@@ -1536,13 +1537,7 @@ static int a6xx_gmu_rpmh_arc_votes_init(struct device *dev, u32 *votes,
if (!pri_count)
return -EINVAL;
- /*
- * Some targets have a separate gfx mxc rail. So try to read that first and then fall back
- * to regular mx rail if it is missing
- */
- sec = cmd_db_read_aux_data("gmxc.lvl", &sec_count);
- if (IS_ERR(sec) && sec != ERR_PTR(-EPROBE_DEFER))
- sec = cmd_db_read_aux_data("mx.lvl", &sec_count);
+ sec = cmd_db_read_aux_data(sec_id, &sec_count);
if (IS_ERR(sec))
return PTR_ERR(sec);
@@ -1610,15 +1605,24 @@ static int a6xx_gmu_rpmh_votes_init(struct a6xx_gmu *gmu)
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
const struct a6xx_info *info = adreno_gpu->info->a6xx;
struct msm_gpu *gpu = &adreno_gpu->base;
+ const char *sec_id;
+ const u16 *gmxc;
int ret;
+ gmxc = cmd_db_read_aux_data("gmxc.lvl", NULL);
+ if (gmxc == ERR_PTR(-EPROBE_DEFER))
+ return -EPROBE_DEFER;
+
+ /* If GMxC is present, prefer that as secondary rail for GX votes */
+ sec_id = IS_ERR_OR_NULL(gmxc) ? "mx.lvl" : "gmxc.lvl";
+
/* Build the GX votes */
ret = a6xx_gmu_rpmh_arc_votes_init(&gpu->pdev->dev, gmu->gx_arc_votes,
- gmu->gpu_freqs, gmu->nr_gpu_freqs, "gfx.lvl");
+ gmu->gpu_freqs, gmu->nr_gpu_freqs, "gfx.lvl", sec_id);
/* Build the CX votes */
ret |= a6xx_gmu_rpmh_arc_votes_init(gmu->dev, gmu->cx_arc_votes,
- gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl");
+ gmu->gmu_freqs, gmu->nr_gmu_freqs, "cx.lvl", "mx.lvl");
/* Build the interconnect votes */
if (info->bcms && gmu->nr_gpu_bws > 1)
--
2.51.0
next prev parent reply other threads:[~2025-11-10 16:39 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 16:37 [PATCH v2 00/21] drm/msm/adreno: Introduce Adreno 8xx family support Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 01/21] drm/msm/a6xx: Flush LRZ cache before PT switch Akhil P Oommen
2025-11-12 10:07 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 02/21] drm/msm/a6xx: Fix the gemnoc workaround Akhil P Oommen
2025-11-12 10:18 ` Konrad Dybcio
2025-11-12 22:09 ` Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 03/21] drm/msm/adreno: Common-ize PIPE definitions Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 04/21] drm/msm/adreno: Create adreno_func->submit_flush() Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 05/21] drm/msm/adreno: Move adreno_gpu_func to catalogue Akhil P Oommen
2025-11-12 10:22 ` Konrad Dybcio
2025-11-12 22:02 ` Akhil P Oommen
2025-11-13 3:38 ` Dmitry Baryshkov
2025-11-13 9:27 ` Konrad Dybcio
2025-11-13 12:22 ` Dmitry Baryshkov
2025-11-13 13:10 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 06/21] drm/msm/adreno: Move gbif_halt() to adreno_gpu_func Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 07/21] drm/msm/adreno: Add MMU fault handler " Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 08/21] drm/msm/a6xx: Sync latest register definitions Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 09/21] drm/msm/a6xx: Rebase GMU register offsets Akhil P Oommen
2025-11-12 10:56 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 10/21] drm/msm/a8xx: Add support for A8x GMU Akhil P Oommen
2025-11-13 13:10 ` Konrad Dybcio
2025-11-13 20:00 ` Akhil P Oommen
2025-11-10 16:37 ` Akhil P Oommen [this message]
2025-11-12 10:59 ` [PATCH v2 11/21] drm/msm/a6xx: Improve MX rail fallback in RPMH vote init Konrad Dybcio
2025-11-14 11:26 ` Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 12/21] drm/msm/a6xx: Share dependency vote table with GMU Akhil P Oommen
2025-11-13 9:42 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 13/21] drm/msm/adreno: Introduce A8x GPU Support Akhil P Oommen
2025-11-13 10:15 ` Konrad Dybcio
2025-11-13 20:09 ` Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 14/21] drm/msm/adreno: Support AQE engine Akhil P Oommen
2025-11-12 11:07 ` Konrad Dybcio
2025-11-12 21:16 ` Akhil P Oommen
2025-11-13 9:29 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 15/21] drm/msm/a8xx: Add support for Adreno 840 GPU Akhil P Oommen
2025-11-13 10:58 ` Konrad Dybcio
2025-11-10 16:37 ` [PATCH v2 16/21] drm/msm/adreno: Do CX GBIF config before GMU start Akhil P Oommen
2025-11-12 10:37 ` Konrad Dybcio
2025-11-12 21:34 ` Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 17/21] drm/msm/a8xx: Add support for Adreno X2-85 GPU Akhil P Oommen
2025-11-12 14:41 ` Konrad Dybcio
2025-11-12 21:07 ` Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 18/21] dt-bindings: arm-smmu: Add Kaanapali GPU SMMU Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 19/21] dt-bindings: display/msm/gmu: Add Adreno 840 GMU Akhil P Oommen
2025-11-10 16:37 ` [PATCH v2 20/21] dt-bindings: display/msm/gmu: Add Adreno X2-85 GMU Akhil P Oommen
2025-11-11 7:49 ` Krzysztof Kozlowski
2025-11-11 14:25 ` Akhil P Oommen
2025-11-13 8:14 ` Krzysztof Kozlowski
2025-11-13 8:21 ` Krzysztof Kozlowski
2025-11-10 16:37 ` [PATCH v2 21/21] dt-bindings: arm-smmu: Add Glymur GPU SMMU Akhil P Oommen
2025-11-11 7:50 ` Krzysztof Kozlowski
2025-11-11 14:27 ` Akhil P Oommen
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=20251110-kaana-gpu-support-v2-11-bef18acd5e94@oss.qualcomm.com \
--to=akhilpo@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=conor+dt@kernel.org \
--cc=cwabbott0@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=iommu@lists.linux.dev \
--cc=jesszhan0024@gmail.com \
--cc=jonathan@marek.ca \
--cc=jordan@cosmicpenguin.net \
--cc=joro@8bytes.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.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=robin.murphy@arm.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=will@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).