From: Vladimir Lypak <vladimir.lypak@gmail.com> To: Vladimir Lypak <vladimir.lypak@gmail.com> Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>, Jordan Crouse <jordan@cosmicpenguin.net>, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Konrad Dybcio <konrad.dybcio@somainline.org>, Jonathan Marek <jonathan@marek.ca>, Akhil P Oommen <akhilpo@codeaurora.org>, Iskren Chernev <iskren.chernev@gmail.com>, Bjorn Andersson <bjorn.andersson@linaro.org>, Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/msm/a5xx: Fix missing CP_PROTECT for SMMU on A540 Date: Sun, 12 Dec 2021 16:03:17 +0000 [thread overview] Message-ID: <20211212160333.980343-2-vladimir.lypak@gmail.com> (raw) In-Reply-To: <20211212160333.980343-1-vladimir.lypak@gmail.com> A CP_PROTECT entry for SMMU registers is missing for A540. According to downstream sources its length is same as on A530 - 0x20000 bytes. On all other revisions SMMU region length is 0x10000 bytes. Despite this, we setup region of length 0x20000 on all revisions. This doesn't cause any issues on those GPUs. As for preventing accesses to the region from protected mode it was tested to work the same. This patch drops the "if" condition in setup of CP_PROTECT entry because it already includes all supported revisions except A540. Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com> --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 894881d273b8..fea632c789a0 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -860,10 +860,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) /* UCHE */ gpu_write(gpu, REG_A5XX_CP_PROTECT(16), ADRENO_PROTECT_RW(0xE80, 16)); - if (adreno_is_a506(adreno_gou) || adreno_is_a508(adreno_gpu) || - adreno_is_a509(adreno_gpu) || adreno_is_a510(adreno_gpu) || - adreno_is_a512(adreno_gpu) || adreno_is_a530(adreno_gpu)) - gpu_write(gpu, REG_A5XX_CP_PROTECT(17), + /* SMMU */ + gpu_write(gpu, REG_A5XX_CP_PROTECT(17), ADRENO_PROTECT_RW(0x10000, 0x8000)); gpu_write(gpu, REG_A5XX_RBBM_SECVID_TSB_CNTL, 0); -- 2.33.1
WARNING: multiple messages have this Message-ID (diff)
From: Vladimir Lypak <vladimir.lypak@gmail.com> To: Vladimir Lypak <vladimir.lypak@gmail.com> Cc: freedreno@lists.freedesktop.org, Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>, Jonathan Marek <jonathan@marek.ca>, David Airlie <airlied@linux.ie>, linux-arm-msm@vger.kernel.org, Konrad Dybcio <konrad.dybcio@somainline.org>, Akhil P Oommen <akhilpo@codeaurora.org>, dri-devel@lists.freedesktop.org, Jordan Crouse <jordan@cosmicpenguin.net>, Iskren Chernev <iskren.chernev@gmail.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>, Bjorn Andersson <bjorn.andersson@linaro.org>, Sean Paul <sean@poorly.run>, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm/msm/a5xx: Fix missing CP_PROTECT for SMMU on A540 Date: Sun, 12 Dec 2021 16:03:17 +0000 [thread overview] Message-ID: <20211212160333.980343-2-vladimir.lypak@gmail.com> (raw) In-Reply-To: <20211212160333.980343-1-vladimir.lypak@gmail.com> A CP_PROTECT entry for SMMU registers is missing for A540. According to downstream sources its length is same as on A530 - 0x20000 bytes. On all other revisions SMMU region length is 0x10000 bytes. Despite this, we setup region of length 0x20000 on all revisions. This doesn't cause any issues on those GPUs. As for preventing accesses to the region from protected mode it was tested to work the same. This patch drops the "if" condition in setup of CP_PROTECT entry because it already includes all supported revisions except A540. Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com> --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index 894881d273b8..fea632c789a0 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -860,10 +860,8 @@ static int a5xx_hw_init(struct msm_gpu *gpu) /* UCHE */ gpu_write(gpu, REG_A5XX_CP_PROTECT(16), ADRENO_PROTECT_RW(0xE80, 16)); - if (adreno_is_a506(adreno_gou) || adreno_is_a508(adreno_gpu) || - adreno_is_a509(adreno_gpu) || adreno_is_a510(adreno_gpu) || - adreno_is_a512(adreno_gpu) || adreno_is_a530(adreno_gpu)) - gpu_write(gpu, REG_A5XX_CP_PROTECT(17), + /* SMMU */ + gpu_write(gpu, REG_A5XX_CP_PROTECT(17), ADRENO_PROTECT_RW(0x10000, 0x8000)); gpu_write(gpu, REG_A5XX_RBBM_SECVID_TSB_CNTL, 0); -- 2.33.1
next prev parent reply other threads:[~2021-12-12 16:40 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-12 16:03 [PATCH v2 1/2] drm/msm/a5xx: Add support for Adreno 506 GPU Vladimir Lypak 2021-12-12 16:03 ` Vladimir Lypak 2021-12-12 16:03 ` Vladimir Lypak [this message] 2021-12-12 16:03 ` [PATCH v2 2/2] drm/msm/a5xx: Fix missing CP_PROTECT for SMMU on A540 Vladimir Lypak 2021-12-13 6:06 ` [PATCH v2 1/2] drm/msm/a5xx: Add support for Adreno 506 GPU kernel test robot
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=20211212160333.980343-2-vladimir.lypak@gmail.com \ --to=vladimir.lypak@gmail.com \ --cc=airlied@linux.ie \ --cc=akhilpo@codeaurora.org \ --cc=angelogioacchino.delregno@somainline.org \ --cc=bjorn.andersson@linaro.org \ --cc=daniel@ffwll.ch \ --cc=dri-devel@lists.freedesktop.org \ --cc=freedreno@lists.freedesktop.org \ --cc=iskren.chernev@gmail.com \ --cc=jonathan@marek.ca \ --cc=jordan@cosmicpenguin.net \ --cc=konrad.dybcio@somainline.org \ --cc=linux-arm-msm@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=robdclark@gmail.com \ --cc=saiprakash.ranjan@codeaurora.org \ --cc=sean@poorly.run \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.