Skip to contentSkip to conversation

drm/amdgpu: Move HDP remapping earlier during init

PATCH Superseded Lijo Lazar 6 participants 12 messages Aug 25, 2022 – Sep 8, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lijo Lazar

author
#0 lore raw

PATCH 1/2 drm/amdgpu: Move HDP remapping earlier during init

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
 4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +9 -0
index ce7d117efdb5..53d753e94a71 100644
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 				DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
 				goto init_failed;
 			}
+
+			/* remap HDP registers to a hole in mmio space,
+			 * for the purpose of expose those registers
+			 * to process space. This is needed for any early HDP
+			 * flush operation during gmc initialization.
+			 */
+			if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+				adev->nbio.funcs->remap_hdp_registers(adev);
+
 			r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
 			if (r) {
 				DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
 	nv_program_aspm(adev);
 	/* setup nbio registers */
 	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
 	soc15_program_aspm(adev);
 	/* setup nbio registers */
 	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-		adev->nbio.funcs->remap_hdp_registers(adev);
 
 	/* enable the doorbell aperture */
 	soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -6
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
 	soc21_program_aspm(adev);
 	/* setup nbio registers */
 	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers)
-		adev->nbio.funcs->remap_hdp_registers(adev);
 	/* enable the doorbell aperture */
 	soc21_enable_doorbell_aperture(adev, true);
 
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 drm/amdgpu: Init VF's HDP flush reg offset early

Make sure the register offsets used for HDP flush in VF is initialized early so that it works fine during any early HDP flush sequence. For that, move the offset initialization to *_remap_hdp.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c     | 12 +++++++----
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c     | 21 ++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c     | 24 ++++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c     | 23 +++++++++++++--------
 7 files changed, 84 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 53d753e94a71..c0bb2e9616c5 100644
@@ -2382,7 +2382,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
 			 * to process space. This is needed for any early HDP
 			 * flush operation during gmc initialization.
 			 */
-			if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+			if (adev->nbio.funcs->remap_hdp_registers)
 				adev->nbio.funcs->remap_hdp_registers(adev);
 
 			r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +15 -8
index b465baa26762..20fa2c5ad510 100644
@@ -65,10 +65,21 @@
 
 static void nbio_v2_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (amdgpu_sriov_vf(adev))
+		adev->rmmio_remap.reg_offset =
+			SOC15_REG_OFFSET(
+				NBIO, 0,
+				mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+			<< 2;
+
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v2_3_get_rev_id(struct amdgpu_device *adev)
@@ -338,10 +349,6 @@ static void nbio_v2_3_init_registers(struct amdgpu_device *adev)
 
 	if (def != data)
 		WREG32_PCIE(smnPCIE_CONFIG_CNTL, data);
-
-	if (amdgpu_sriov_vf(adev))
-		adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-			mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 #define NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT		0x00000000 // off by default, no gains over L1
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +8 -4
index 982a89f841d5..e011d9856794 100644
@@ -30,10 +30,14 @@
 
 static void nbio_v4_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v4_3_get_rev_id(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +15 -8
index f7f6ddebd3e4..7536ca3fcd69 100644
@@ -55,10 +55,21 @@
 
 static void nbio_v6_1_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (amdgpu_sriov_vf(adev))
+		adev->rmmio_remap.reg_offset =
+			SOC15_REG_OFFSET(
+				NBIO, 0,
+				mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+			<< 2;
+
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v6_1_get_rev_id(struct amdgpu_device *adev)
@@ -276,10 +287,6 @@ static void nbio_v6_1_init_registers(struct amdgpu_device *adev)
 
 	if (def != data)
 		WREG32_PCIE(smnPCIE_CI_CNTL, data);
-
-	if (amdgpu_sriov_vf(adev))
-		adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-			mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 static void nbio_v6_1_program_ltr(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +14 -7
index aa0326d00c72..6b4ac16a8466 100644
@@ -35,10 +35,20 @@
 
 static void nbio_v7_0_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (amdgpu_sriov_vf(adev))
+		adev->rmmio_remap.reg_offset =
+			SOC15_REG_OFFSET(NBIO, 0,
+					 mmHDP_MEM_COHERENCY_FLUSH_CNTL)
+			<< 2;
+
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v7_0_get_rev_id(struct amdgpu_device *adev)
@@ -273,9 +283,6 @@ const struct nbio_hdp_flush_reg nbio_v7_0_hdp_flush_reg = {
 
 static void nbio_v7_0_init_registers(struct amdgpu_device *adev)
 {
-	if (amdgpu_sriov_vf(adev))
-		adev->rmmio_remap.reg_offset =
-			SOC15_REG_OFFSET(NBIO, 0, mmHDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_0_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +16 -8
index 31776b12e4c4..fb4be72eade7 100644
@@ -49,10 +49,21 @@
 
 static void nbio_v7_2_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (amdgpu_sriov_vf(adev))
+		adev->rmmio_remap.reg_offset =
+			SOC15_REG_OFFSET(
+				NBIO, 0,
+				regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+			<< 2;
+
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v7_2_get_rev_id(struct amdgpu_device *adev)
@@ -369,6 +380,7 @@ const struct nbio_hdp_flush_reg nbio_v7_2_hdp_flush_reg = {
 static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
 {
 	uint32_t def, data;
+
 	switch (adev->ip_versions[NBIO_HWIP][0]) {
 	case IP_VERSION(7, 2, 1):
 	case IP_VERSION(7, 3, 0):
@@ -393,10 +405,6 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
 			WREG32_PCIE_PORT(SOC15_REG_OFFSET(NBIO, 0, regPCIE_CONFIG_CNTL), data);
 		break;
 	}
-
-	if (amdgpu_sriov_vf(adev))
-		adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-			regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_2_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +15 -8
index 11848d1e238b..3c11af99582f 100644
@@ -101,10 +101,21 @@ static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
 
 static void nbio_v7_4_remap_hdp_registers(struct amdgpu_device *adev)
 {
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-	WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-		adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	if (amdgpu_sriov_vf(adev))
+		adev->rmmio_remap.reg_offset =
+			SOC15_REG_OFFSET(
+				NBIO, 0,
+				mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+			<< 2;
+
+	if (!amdgpu_sriov_vf(adev)) {
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+		WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+			     adev->rmmio_remap.reg_offset +
+				     KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+	}
 }
 
 static u32 nbio_v7_4_get_rev_id(struct amdgpu_device *adev)
@@ -343,10 +354,6 @@ static void nbio_v7_4_init_registers(struct amdgpu_device *adev)
 {
 	uint32_t baco_cntl;
 
-	if (amdgpu_sriov_vf(adev))
-		adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-			mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
-
 	if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(7, 4, 4) &&
 	    !amdgpu_sriov_vf(adev)) {
 		baco_cntl = RREG32_SOC15(NBIO, 0, mmBACO_CNTL);
Signature · 1 line
2.25.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu: Init VF's HDP flush reg offset early

Series is:

Quoted 266 lines · Lijo Lazar

Make sure the register offsets used for HDP flush in VF is initialized early so that it works fine during any early HDP flush sequence. For that, move the offset initialization to *_remap_hdp.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c     | 12 +++++++----
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c     | 21 ++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c     | 24 ++++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c     | 23 +++++++++++++--------
 7 files changed, 84 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 53d753e94a71..c0bb2e9616c5 100644
@@ -2382,7 +2382,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                         * to process space. This is needed for any early HDP
                         * flush operation during gmc initialization.
                         */
-                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                       if (adev->nbio.funcs->remap_hdp_registers)
                                adev->nbio.funcs->remap_hdp_registers(adev);
 
                        r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +15 -8
index b465baa26762..20fa2c5ad510 100644
@@ -65,10 +65,21 @@
 
 static void nbio_v2_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v2_3_get_rev_id(struct amdgpu_device *adev)
@@ -338,10 +349,6 @@ static void nbio_v2_3_init_registers(struct amdgpu_device *adev)
 
        if (def != data)
                WREG32_PCIE(smnPCIE_CONFIG_CNTL, data);
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 #define NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT         0x00000000 // off by default, no gains over L1
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +8 -4
index 982a89f841d5..e011d9856794 100644
@@ -30,10 +30,14 @@
 
 static void nbio_v4_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v4_3_get_rev_id(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +15 -8
index f7f6ddebd3e4..7536ca3fcd69 100644
@@ -55,10 +55,21 @@
 
 static void nbio_v6_1_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v6_1_get_rev_id(struct amdgpu_device *adev)
@@ -276,10 +287,6 @@ static void nbio_v6_1_init_registers(struct amdgpu_device *adev)
 
        if (def != data)
                WREG32_PCIE(smnPCIE_CI_CNTL, data);
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 static void nbio_v6_1_program_ltr(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +14 -7
index aa0326d00c72..6b4ac16a8466 100644
@@ -35,10 +35,20 @@
 
 static void nbio_v7_0_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(NBIO, 0,
+                                        mmHDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_0_get_rev_id(struct amdgpu_device *adev)
@@ -273,9 +283,6 @@ const struct nbio_hdp_flush_reg nbio_v7_0_hdp_flush_reg = {
 
 static void nbio_v7_0_init_registers(struct amdgpu_device *adev)
 {
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset =
-                       SOC15_REG_OFFSET(NBIO, 0, mmHDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_0_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +16 -8
index 31776b12e4c4..fb4be72eade7 100644
@@ -49,10 +49,21 @@
 
 static void nbio_v7_2_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_2_get_rev_id(struct amdgpu_device *adev)
@@ -369,6 +380,7 @@ const struct nbio_hdp_flush_reg nbio_v7_2_hdp_flush_reg = {
 static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
 {
        uint32_t def, data;
+
        switch (adev->ip_versions[NBIO_HWIP][0]) {
        case IP_VERSION(7, 2, 1):
        case IP_VERSION(7, 3, 0):
@@ -393,10 +405,6 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
                        WREG32_PCIE_PORT(SOC15_REG_OFFSET(NBIO, 0, regPCIE_CONFIG_CNTL), data);
                break;
        }
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_2_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +15 -9
index 11848d1e238b..3c11af99582f 100644
@@ -101,10 +101,21 @@ static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
 
 static void nbio_v7_4_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_4_get_rev_id(struct amdgpu_device *adev)
@@ -343,10 +354,6 @@ static void nbio_v7_4_init_registers(struct amdgpu_device *adev)
 {
        uint32_t baco_cntl;
 
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
-
        if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(7, 4, 4) &&
            !amdgpu_sriov_vf(adev)) {
                baco_cntl = RREG32_SOC15(NBIO, 0, mmBACO_CNTL);
--

2.25.1

#3 lore raw

Re: [PATCH 2/2] drm/amdgpu: Init VF's HDP flush reg offset early

Quoted 4 lines · Alex Deucher

Series is:

Actually, hold off on that, I have a comment on patch 1.

Alex

Quoted 267 lines · Lijo Lazar
Quoted 266 lines

Make sure the register offsets used for HDP flush in VF is initialized early so that it works fine during any early HDP flush sequence. For that, move the offset initialization to *_remap_hdp.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c     | 12 +++++++----
 drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c     | 23 +++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c     | 21 ++++++++++++-------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c     | 24 ++++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c     | 23 +++++++++++++--------
 7 files changed, 84 insertions(+), 44 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 -1
index 53d753e94a71..c0bb2e9616c5 100644
@@ -2382,7 +2382,7 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                         * to process space. This is needed for any early HDP
                         * flush operation during gmc initialization.
                         */
-                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                       if (adev->nbio.funcs->remap_hdp_registers)
                                adev->nbio.funcs->remap_hdp_registers(adev);
 
                        r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +15 -8
index b465baa26762..20fa2c5ad510 100644
@@ -65,10 +65,21 @@
 
 static void nbio_v2_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v2_3_get_rev_id(struct amdgpu_device *adev)
@@ -338,10 +349,6 @@ static void nbio_v2_3_init_registers(struct amdgpu_device *adev)
 
        if (def != data)
                WREG32_PCIE(smnPCIE_CONFIG_CNTL, data);
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 #define NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT         0x00000000 // off by default, no gains over L1
drivers/gpu/drm/amd/amdgpu/nbio_v4_3.c +8 -4
index 982a89f841d5..e011d9856794 100644
@@ -30,10 +30,14 @@
 
 static void nbio_v4_3_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v4_3_get_rev_id(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v6_1.c +15 -8
index f7f6ddebd3e4..7536ca3fcd69 100644
@@ -55,10 +55,21 @@
 
 static void nbio_v6_1_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v6_1_get_rev_id(struct amdgpu_device *adev)
@@ -276,10 +287,6 @@ static void nbio_v6_1_init_registers(struct amdgpu_device *adev)
 
        if (def != data)
                WREG32_PCIE(smnPCIE_CI_CNTL, data);
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 static void nbio_v6_1_program_ltr(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/nbio_v7_0.c +14 -7
index aa0326d00c72..6b4ac16a8466 100644
@@ -35,10 +35,20 @@
 
 static void nbio_v7_0_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(NBIO, 0,
+                                        mmHDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_0_get_rev_id(struct amdgpu_device *adev)
@@ -273,9 +283,6 @@ const struct nbio_hdp_flush_reg nbio_v7_0_hdp_flush_reg = {
 
 static void nbio_v7_0_init_registers(struct amdgpu_device *adev)
 {
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset =
-                       SOC15_REG_OFFSET(NBIO, 0, mmHDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_0_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_2.c +16 -8
index 31776b12e4c4..fb4be72eade7 100644
@@ -49,10 +49,21 @@
 
 static void nbio_v7_2_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, regBIF_BX0_REMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_2_get_rev_id(struct amdgpu_device *adev)
@@ -369,6 +380,7 @@ const struct nbio_hdp_flush_reg nbio_v7_2_hdp_flush_reg = {
 static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
 {
        uint32_t def, data;
+
        switch (adev->ip_versions[NBIO_HWIP][0]) {
        case IP_VERSION(7, 2, 1):
        case IP_VERSION(7, 3, 0):
@@ -393,10 +405,6 @@ static void nbio_v7_2_init_registers(struct amdgpu_device *adev)
                        WREG32_PCIE_PORT(SOC15_REG_OFFSET(NBIO, 0, regPCIE_CONFIG_CNTL), data);
                break;
        }
-
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       regBIF_BX_PF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
 }
 
 const struct amdgpu_nbio_funcs nbio_v7_2_funcs = {
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +15 -9
index 11848d1e238b..3c11af99582f 100644
@@ -101,10 +101,21 @@ static void nbio_v7_4_query_ras_error_count(struct amdgpu_device *adev,
 
 static void nbio_v7_4_remap_hdp_registers(struct amdgpu_device *adev)
 {
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
-       WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
-               adev->rmmio_remap.reg_offset + KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       if (amdgpu_sriov_vf(adev))
+               adev->rmmio_remap.reg_offset =
+                       SOC15_REG_OFFSET(
+                               NBIO, 0,
+                               mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL)
+                       << 2;
+
+       if (!amdgpu_sriov_vf(adev)) {
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_MEM_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_MEM_FLUSH_CNTL);
+               WREG32_SOC15(NBIO, 0, mmREMAP_HDP_REG_FLUSH_CNTL,
+                            adev->rmmio_remap.reg_offset +
+                                    KFD_MMIO_REMAP_HDP_REG_FLUSH_CNTL);
+       }
 }
 
 static u32 nbio_v7_4_get_rev_id(struct amdgpu_device *adev)
@@ -343,10 +354,6 @@ static void nbio_v7_4_init_registers(struct amdgpu_device *adev)
 {
        uint32_t baco_cntl;
 
-       if (amdgpu_sriov_vf(adev))
-               adev->rmmio_remap.reg_offset = SOC15_REG_OFFSET(NBIO, 0,
-                       mmBIF_BX_DEV0_EPF0_VF0_HDP_MEM_COHERENCY_FLUSH_CNTL) << 2;
-
        if (adev->ip_versions[NBIO_HWIP][0] == IP_VERSION(7, 4, 4) &&
            !amdgpu_sriov_vf(adev)) {
                baco_cntl = RREG32_SOC15(NBIO, 0, mmBACO_CNTL);
--

2.25.1

#4 lore raw
In reply to Lijo Lazar
Quoted 26 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
 drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
 drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
 4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index ce7d117efdb5..53d753e94a71 100644
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                                DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
                                goto init_failed;

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_init(struct amdgpu_device *adev) · line 2387

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +9 -0
                        }
+
+                       /* remap HDP registers to a hole in mmio space,
+                        * for the purpose of expose those registers
+                        * to process space. This is needed for any early HDP
+                        * flush operation during gmc initialization.
+                        */
+                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                               adev->nbio.funcs->remap_hdp_registers(adev);
+

We probably also need this in ip_resume() as well to handle the suspend and resume case. Thinking about this more, maybe it's easier to just track whether the remap has happened yet and use the old or new offset based on that.

Alex

Quoted 57 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
                        r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
                        if (r) {
                                DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
        nv_program_aspm(adev);
        /* setup nbio registers */
        adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
        /* enable the doorbell aperture */
        nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
        soc15_program_aspm(adev);
        /* setup nbio registers */
        adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
 
        /* enable the doorbell aperture */
        soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -7
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
        soc21_program_aspm(adev);
        /* setup nbio registers */
        adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers)
-               adev->nbio.funcs->remap_hdp_registers(adev);
        /* enable the doorbell aperture */
        soc21_enable_doorbell_aperture(adev, true);
 
--

2.25.1

#5 lore raw
Quoted 34 lines · Alex Deucher
Quoted 33 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
  drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
  4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index ce7d117efdb5..53d753e94a71 100644
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                                 DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
                                 goto init_failed;
                         }
+
+                       /* remap HDP registers to a hole in mmio space,
+                        * for the purpose of expose those registers
+                        * to process space. This is needed for any early HDP
+                        * flush operation during gmc initialization.
+                        */
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_init(struct amdgpu_device *adev) · line 2387

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
+                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                               adev->nbio.funcs->remap_hdp_registers(adev);
+

We probably also need this in ip_resume() as well to handle the suspend and resume case. Thinking about this more, maybe it's easier to just track whether the remap has happened yet and use the old or new offset based on that.

If we can use the default offset without a remap, does it make sense to remap? What about calling the same in ip_resume?

Thanks,
Lijo

Quoted 61 lines

Alex

Quoted 57 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
                         r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
                         if (r) {
                                 DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
         nv_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
         /* enable the doorbell aperture */
         nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
         soc15_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
 
         /* enable the doorbell aperture */
         soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -7
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
         soc21_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers)
-               adev->nbio.funcs->remap_hdp_registers(adev);
         /* enable the doorbell aperture */
         soc21_enable_doorbell_aperture(adev, true);
 
--

2.25.1

#6 lore raw
Quoted 47 lines · Lijo
Quoted 34 lines · Alex Deucher
Quoted 33 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
  drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
  4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
index ce7d117efdb5..53d753e94a71 100644
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                                 DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
                                 goto init_failed;
                         }
+
+                       /* remap HDP registers to a hole in mmio space,
+                        * for the purpose of expose those registers
+                        * to process space. This is needed for any early HDP
+                        * flush operation during gmc initialization.
+                        */
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_init(struct amdgpu_device *adev) · line 2387

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +3 -0
+                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                               adev->nbio.funcs->remap_hdp_registers(adev);
+

We probably also need this in ip_resume() as well to handle the suspend and resume case. Thinking about this more, maybe it's easier to just track whether the remap has happened yet and use the old or new offset based on that.

Quoted 2 lines

If we can use the default offset without a remap, does it make sense to remap? What about calling the same in ip_resume?

The remap is necessary so that userspace drivers can access this to flush the HDP registers when they need to since normally it's in a non-accessible region of the MMIO space. I'm fine with updating it in ip_resume as well.

Alex

Quoted 65 lines

Thanks,
Lijo

Quoted 61 lines

Alex

Quoted 57 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
                         r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
                         if (r) {
                                 DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
         nv_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
         /* enable the doorbell aperture */
         nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
         soc15_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
 
         /* enable the doorbell aperture */
         soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -7
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
         soc21_program_aspm(adev);
         /* setup nbio registers */
         adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers)
-               adev->nbio.funcs->remap_hdp_registers(adev);
         /* enable the doorbell aperture */
         soc21_enable_doorbell_aperture(adev, true);
 
--

2.25.1

#7 lore raw

Am 25.08.22 um 16:26 schrieb Alex Deucher:

Quoted 44 lines · Lijo
Quoted 43 lines · Alex Deucher
Quoted 40 lines · Lijo Lazar
Quoted 25 lines

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
   drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
   drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
   drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
   4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index ce7d117efdb5..53d753e94a71 100644
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                                  DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
                                  goto init_failed;

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_init(struct amdgpu_device *adev) · line 2387

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +9 -0
                          }
+
+                       /* remap HDP registers to a hole in mmio space,
+                        * for the purpose of expose those registers
+                        * to process space. This is needed for any early HDP
+                        * flush operation during gmc initialization.
+                        */
+                       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
+                               adev->nbio.funcs->remap_hdp_registers(adev);
+

We probably also need this in ip_resume() as well to handle the suspend and resume case. Thinking about this more, maybe it's easier to just track whether the remap has happened yet and use the old or new offset based on that.

Quoted 6 lines
Quoted 2 lines

If we can use the default offset without a remap, does it make sense to remap? What about calling the same in ip_resume?

The remap is necessary so that userspace drivers can access this to flush the HDP registers when they need to since normally it's in a non-accessible region of the MMIO space. I'm fine with updating it in ip_resume as well.

Correct me if I'm wrong but I think remap means it is available at an additional location, the privileged region still works as well.

So Lijo suggestion is to use the privileged area in the kernel instead of the remapped one.

Right?

Christian.

Quoted 67 lines

Alex

Quoted 63 lines

Thanks,
Lijo

Quoted 60 lines

Alex

Quoted 57 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
                          r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
                          if (r) {
                                  DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
          nv_program_aspm(adev);
          /* setup nbio registers */
          adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
          /* enable the doorbell aperture */
          nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
          soc15_program_aspm(adev);
          /* setup nbio registers */
          adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-               adev->nbio.funcs->remap_hdp_registers(adev);
 
          /* enable the doorbell aperture */
          soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -7
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
          soc21_program_aspm(adev);
          /* setup nbio registers */
          adev->nbio.funcs->init_registers(adev);
-       /* remap HDP registers to a hole in mmio space,
-        * for the purpose of expose those registers
-        * to process space
-        */
-       if (adev->nbio.funcs->remap_hdp_registers)
-               adev->nbio.funcs->remap_hdp_registers(adev);
          /* enable the doorbell aperture */
          soc21_enable_doorbell_aperture(adev, true);
 
--

2.25.1

#8 lore raw
In reply to Lijo Lazar

Am 2022-08-25 um 04:58 schrieb Lijo Lazar:

Quoted 23 lines

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 +++++++++
  drivers/gpu/drm/amd/amdgpu/nv.c            | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc15.c         | 6 ------
  drivers/gpu/drm/amd/amdgpu/soc21.c         | 6 ------
  4 files changed, 9 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -0
index ce7d117efdb5..53d753e94a71 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c static int amdgpu_device_ip_init(struct amdgpu_device *adev) · line 2385

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 -0
@@ -2376,6 +2376,15 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
  				DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
  				goto init_failed;
  			}
+
+			/* remap HDP registers to a hole in mmio space,
+			 * for the purpose of expose those registers
+			 * to process space. This is needed for any early HDP
+			 * flush operation during gmc initialization.
+			 */
+			if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))

Does this work on GFXv8? You may need a NULL-check for adev->nbio.funcs.

Regards,
  Felix

Quoted 56 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +2 -0
+				adev->nbio.funcs->remap_hdp_registers(adev);
+
  			r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
  			if (r) {
  				DRM_ERROR("hw_init %d failed %d\n", i, r);
drivers/gpu/drm/amd/amdgpu/nv.c +0 -6
index b3fba8dea63c..3ac7fef74277 100644
@@ -1032,12 +1032,6 @@ static int nv_common_hw_init(void *handle)
  	nv_program_aspm(adev);
  	/* setup nbio registers */
  	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-		adev->nbio.funcs->remap_hdp_registers(adev);
  	/* enable the doorbell aperture */
  	nv_enable_doorbell_aperture(adev, true);
 
drivers/gpu/drm/amd/amdgpu/soc15.c +0 -6
index fde6154f2009..a0481e37d7cf 100644
@@ -1240,12 +1240,6 @@ static int soc15_common_hw_init(void *handle)
  	soc15_program_aspm(adev);
  	/* setup nbio registers */
  	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers && !amdgpu_sriov_vf(adev))
-		adev->nbio.funcs->remap_hdp_registers(adev);
 
  	/* enable the doorbell aperture */
  	soc15_enable_doorbell_aperture(adev, true);
drivers/gpu/drm/amd/amdgpu/soc21.c +0 -6
index 55284b24f113..16b447055102 100644
@@ -660,12 +660,6 @@ static int soc21_common_hw_init(void *handle)
  	soc21_program_aspm(adev);
  	/* setup nbio registers */
  	adev->nbio.funcs->init_registers(adev);
-	/* remap HDP registers to a hole in mmio space,
-	 * for the purpose of expose those registers
-	 * to process space
-	 */
-	if (adev->nbio.funcs->remap_hdp_registers)
-		adev->nbio.funcs->remap_hdp_registers(adev);
  	/* enable the doorbell aperture */
  	soc21_enable_doorbell_aperture(adev, true);
 
#9 lore raw
In reply to Lijo Lazar

[+cc Greg, no action needed yet, just FYI that stable will want these]

Quoted 6 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

I would say something like:

This prevents writes to unimplemented space, which would cause Unsupported Request errors. Prior to 8795e182b02d ("PCI/portdrv:
Don't disable AER reporting in get_port_device_capability()"), these errors occurred but were ignored.

The write is the error; AER is just the reporting mechanism.

Quoted 1 line

We need a cc: stable because 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") has already been backported to at lealst these stable kernels:

5.10.137 5.15.61 5.18.18 5.19.2

and these fixes need to go there as well. So add something like this:

Fixes 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()")

It's not that there was something wrong with 8795e182b02d and these patches fix it; it's just that 8795e182b02d *exposed* an amdgpu problem that was there all along. But we need some way to connect with it.

Quoted 2 lines
#10 lore raw

[Public]

Quoted 60 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Bjorn Helgaas
Sent: Thursday, August 25, 2022 2:02 PM
To: Lazar, Lijo <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>; Kuehling, Felix <[email protected]>; [email protected]; [email protected]; Deucher, Alexander <[email protected]>; [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Move HDP remapping earlier during init

[+cc Greg, no action needed yet, just FYI that stable will want these]

Quoted 6 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

I would say something like:

This prevents writes to unimplemented space, which would cause Unsupported Request errors. Prior to 8795e182b02d ("PCI/portdrv:
Don't disable AER reporting in get_port_device_capability()"), these errors occurred but were ignored.

The write is the error; AER is just the reporting mechanism.

Quoted 2 lines

Link:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz

Quoted 1 line

illa.kernel.org%2Fshow_bug.cgi%3Fid%3D216373&amp;data=05%7C01%7Cal exan

Quoted 1 line

der.deucher%40amd.com%7C3306aa3e6a834f2d394808da86c3dfb1%7C3dd8 961fe48

Quoted 1 line

84e608e11a82d994e183d%7C0%7C0%7C637970473081942953%7CUnknown% 7CTWFpbGZ

Quoted 1 line

sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M n0%3

Quoted 1 line

D%7C3000%7C%7C%7C&amp;sdata=DFqggIRt4sKNjJB5bY14yi5oJ8I4szzndQD blr6Vcr

Quoted 1 line

c%3D&amp;reserved=0

We need a cc: stable because 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") has already been backported to at lealst these stable kernels:

5.10.137 5.15.61 5.18.18 5.19.2

and these fixes need to go there as well. So add something like this:

Quoted 7 lines
Fixes 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in

get_port_device_capability()")
cc: [email protected]

It's not that there was something wrong with 8795e182b02d and these patches fix it; it's just that 8795e182b02d *exposed* an amdgpu problem that was there all along. But we need some way to connect with it.

Will update the patch with these comments. Also @[email protected] can you please test this patch and confirm that it fixes things for you as well?

Alex

Quoted 3 lines
Quoted 3 lines
#11 lore raw
Quoted 67 lines · Alexander

[Public]

Quoted 64 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Bjorn Helgaas
Sent: Thursday, August 25, 2022 2:02 PM
To: Lazar, Lijo <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>; Kuehling, Felix <[email protected]>; [email protected]; [email protected]; Deucher, Alexander <[email protected]>; [email protected]; Koenig, Christian <[email protected]>; Zhang, Hawking <[email protected]>
Subject: Re: [PATCH 1/2] drm/amdgpu: Move HDP remapping earlier during init

[+cc Greg, no action needed yet, just FYI that stable will want these]

Quoted 6 lines · Lijo Lazar

HDP flush is used early in the init sequence as part of memory controller block initialization. Hence remapping of HDP registers needed for flush needs to happen earlier.

This also fixes the AER error reported as Unsupported Request during driver load.

I would say something like:

This prevents writes to unimplemented space, which would cause Unsupported Request errors. Prior to 8795e182b02d ("PCI/portdrv:
Don't disable AER reporting in get_port_device_capability()"), these errors occurred but were ignored.

The write is the error; AER is just the reporting mechanism.

Quoted 2 lines

Link:

https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz

Quoted 1 line

illa.kernel.org%2Fshow_bug.cgi%3Fid%3D216373&amp;data=05%7C01%7Cal exan

Quoted 1 line

der.deucher%40amd.com%7C3306aa3e6a834f2d394808da86c3dfb1%7C3dd8 961fe48

Quoted 1 line

84e608e11a82d994e183d%7C0%7C0%7C637970473081942953%7CUnknown% 7CTWFpbGZ

Quoted 1 line

sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M n0%3

Quoted 1 line

D%7C3000%7C%7C%7C&amp;sdata=DFqggIRt4sKNjJB5bY14yi5oJ8I4szzndQD blr6Vcr

Quoted 1 line

c%3D&amp;reserved=0

We need a cc: stable because 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") has already been backported to at lealst these stable kernels:

5.10.137 5.15.61 5.18.18 5.19.2

and these fixes need to go there as well. So add something like this:

Fixes 8795e182b02d ("PCI/portdrv: Don't disable AER reporting in

get_port_device_capability()")
cc: [email protected]

Quoted 5 lines
Quoted 3 lines

It's not that there was something wrong with 8795e182b02d and these patches fix it; it's just that 8795e182b02d *exposed* an amdgpu problem that was there all along. But we need some way to connect with it.

Will update the patch with these comments. Also @[email protected] can you please test this patch and confirm that it fixes things for you as well?

Sorry, ignore this. This old email showed up at the top of my inbox for some reason and I mixed up the threads.

Alex

Quoted 6 lines

Alex

Quoted 3 lines
Quoted 3 lines