On Wed, Apr 16, 2025 at 9:48 AM Alexey Klimov <alexey.kli...@linaro.org> wrote:
>
> On Wed Apr 16, 2025 at 4:12 AM BST, Fugang Duan wrote:
> > 发件人: Alexey Klimov <alexey.kli...@linaro.org> 发送时间: 2025年4月16日 2:28
> >>#regzbot introduced: v6.12..v6.13
>
> [..]
>
> >>The only change related to hdp_v5_0_flush_hdp() was
> >>cf424020e040 drm/amdgpu/hdp5.0: do a posting read when flushing HDP
> >>
> >>Reverting that commit ^^ did help and resolved that problem. Before sending
> >>revert as-is I was interested to know if there supposed to be a proper fix 
> >>for
> >>this or maybe someone is interested to debug this or have any suggestions.
> >>
> > Can you revert the change and try again 
> > https://gitlab.com/linux-kernel/linux/-/commit/cf424020e040be35df05b682b546b255e74a420f
>
> Please read my email in the first place.
> Let me quote just in case:
>
> >The only change related to hdp_v5_0_flush_hdp() was
> >cf424020e040 drm/amdgpu/hdp5.0: do a posting read when flushing HDP
>
> >Reverting that commit ^^ did help and resolved that problem.

We can't really revert the change as that will lead to coherency
problems.  What is the page size on your system?  Does the attached
patch fix it?

Alex

>
> Thanks,
> Alexey
>
From 5c173675ce496b289b0b0e7d97e57cbb0c5a53fe Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deuc...@amd.com>
Date: Wed, 16 Apr 2025 10:30:20 -0400
Subject: [PATCH] drm/amdgpu: don't remap HDP registers if page size is > 4K

We remap the HDP registers to an open part of the MMIO
aperture if page size is < 4K, but if it's > 4k, we remap
the HDP registers back to themselves.  This doesn't seem
to work properly, at least on ARM systems, so just skip
the HDP remap altogether if page size is > 4K.

Fixes: c9b8dcabb52a ("drm/amdgpu/hdp4.0: do a posting read when flushing HDP")
Fixes: cf424020e040 ("drm/amdgpu/hdp5.0: do a posting read when flushing HDP")
Fixes: f756dbac1ce1 ("drm/amdgpu/hdp5.2: do a posting read when flushing HDP")
Fixes: abe1cbaec6cf ("drm/amdgpu/hdp6.0: do a posting read when flushing HDP")
Fixes: 689275140cb8 ("drm/amdgpu/hdp7.0: do a posting read when flushing HDP")
Signed-off-by: Alex Deucher <alexander.deuc...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/nv.c    | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc15.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc21.c | 3 ++-
 drivers/gpu/drm/amd/amdgpu/soc24.c | 2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 50e77d9b30afa..890f846b80607 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1002,7 +1002,8 @@ static int nv_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	adev->nbio.funcs->enable_doorbell_aperture(adev, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index c457be3a3c56f..ef24201ffad52 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1297,7 +1297,8 @@ static int soc15_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 
 	/* enable the doorbell aperture */
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index ad36c96478a82..23d4117287702 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -877,7 +877,8 @@ static int soc21_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev) &&
+	    (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	adev->nbio.funcs->enable_doorbell_aperture(adev, true);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 972b449ab89fa..71ba1fa8a8899 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -486,7 +486,7 @@ static int soc24_common_hw_init(struct amdgpu_ip_block *ip_block)
 	 * for the purpose of expose those registers
 	 * to process space
 	 */
-	if (adev->nbio.funcs->remap_hdp_registers)
+	if (adev->nbio.funcs->remap_hdp_registers && (PAGE_SIZE <= 4096))
 		adev->nbio.funcs->remap_hdp_registers(adev);
 
 	if (adev->df.funcs->hw_init)
-- 
2.49.0

Reply via email to