* [PATCH v4 00/15] validate/clean the functions of ip funcs
@ 2024-10-17 10:06 Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 01/15] drm/amdgpu: validate sw_init before function call Sunil Khatri
` (15 more replies)
0 siblings, 16 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
v4: hw_init/hw_fini functions are mandatory and raise error message if
these functions are not defined.
v3: Added 2 new patches to clean get_clocking_state and hw_init
validation.
Sunil Khatri (15):
drm/amdgpu: validate sw_init before function call
drm/amdgpu: clean the dummy sw_init functions
drm/amdgpu: validate sw_fini before function call
drm/amdgpu: clean the dummy sw_fini functions
drm/amdgpu: validate hw_fini before function call
drm/amdgpu: validate suspend before function call
drm/amdgpu: validate resume before function call
drm/amdgpu: validate wait_for_idle before function call
drm/amdgpu: clean the dummy resume functions
drm/amdgpu: clean the dummy suspend functions
drm/amdgpu: clean the dummy hw_fini functions
drm/amdgpu: clean the dummy wait_for_idle functions
drm/amdgpu: clean the dummy soft_reset functions
drm/amdgpu: clean unused functions of amd_ip_funcs
drm/amdgpu: validate get_clockgating_state before use
drivers/gpu/drm/amd/amdgpu/aldebaran.c | 38 ++-
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 16 -
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 138 +++++----
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 35 ---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 25 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
drivers/gpu/drm/amd/amdgpu/cik.c | 33 +-
drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 9 -
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 9 -
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 9 -
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 9 -
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 9 -
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 6 -
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 6 -
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 6 -
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +-
drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/nv.c | 29 +-
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/si.c | 40 ---
drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 43 +--
drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 29 +-
drivers/gpu/drm/amd/amdgpu/soc15.c | 14 -
drivers/gpu/drm/amd/amdgpu/soc21.c | 26 +-
drivers/gpu/drm/amd/amdgpu/soc24.c | 24 +-
drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
drivers/gpu/drm/amd/amdgpu/vi.c | 20 --
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 15 -
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 8 -
.../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 14 -
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
80 files changed, 171 insertions(+), 1208 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 31+ messages in thread
* [PATCH v4 01/15] drm/amdgpu: validate sw_init before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 02/15] drm/amdgpu: clean the dummy sw_init functions Sunil Khatri
` (14 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to sw_init, validate
the function pointer like we do in late_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 38a7423101f3..782f01ab39e2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2851,11 +2851,13 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
for (i = 0; i < adev->num_ip_blocks; i++) {
if (!adev->ip_blocks[i].status.valid)
continue;
- r = adev->ip_blocks[i].version->funcs->sw_init(&adev->ip_blocks[i]);
- if (r) {
- DRM_ERROR("sw_init of IP block <%s> failed %d\n",
+ if (adev->ip_blocks[i].version->funcs->sw_init) {
+ r = adev->ip_blocks[i].version->funcs->sw_init(&adev->ip_blocks[i]);
+ if (r) {
+ DRM_ERROR("sw_init of IP block <%s> failed %d\n",
adev->ip_blocks[i].version->funcs->name, r);
- goto init_failed;
+ goto init_failed;
+ }
}
adev->ip_blocks[i].status.sw = true;
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 02/15] drm/amdgpu: clean the dummy sw_init functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 01/15] drm/amdgpu: validate sw_init before function call Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 03/15] drm/amdgpu: validate sw_fini before function call Sunil Khatri
` (13 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy sw_init functions for all
IP blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 ------
drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
3 files changed, 18 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index adc0b80ca5db..c75bc32ca7ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -33,11 +33,6 @@
#include "isp_v4_1_0.h"
#include "isp_v4_1_1.h"
-static int isp_sw_init(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int isp_sw_fini(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -174,7 +169,6 @@ static const struct amd_ip_funcs isp_ip_funcs = {
.name = "isp_ip",
.early_init = isp_early_init,
.late_init = NULL,
- .sw_init = isp_sw_init,
.sw_fini = isp_sw_fini,
.hw_init = isp_hw_init,
.hw_fini = isp_hw_fini,
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 6c18ab35cf69..a374d1bb24ab 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2124,11 +2124,6 @@ static int cik_common_early_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int cik_common_sw_init(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int cik_common_sw_fini(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -2195,7 +2190,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
.name = "cik_common",
.early_init = cik_common_early_init,
.late_init = NULL,
- .sw_init = cik_common_sw_init,
.sw_fini = cik_common_sw_fini,
.hw_init = cik_common_hw_init,
.hw_fini = cik_common_hw_fini,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index b9934661a92e..3714c6d77f30 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2148,11 +2148,6 @@ static int si_common_early_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int si_common_sw_init(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int si_common_sw_fini(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -2691,7 +2686,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.name = "si_common",
.early_init = si_common_early_init,
.late_init = NULL,
- .sw_init = si_common_sw_init,
.sw_fini = si_common_sw_fini,
.hw_init = si_common_hw_init,
.hw_fini = si_common_hw_fini,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 03/15] drm/amdgpu: validate sw_fini before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 01/15] drm/amdgpu: validate sw_init before function call Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 02/15] drm/amdgpu: clean the dummy sw_init functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 04/15] drm/amdgpu: clean the dummy sw_fini functions Sunil Khatri
` (12 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to sw_fini, validate
the function pointer like we do in sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 782f01ab39e2..cf84b50f2355 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3379,12 +3379,13 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
amdgpu_ib_pool_fini(adev);
amdgpu_seq64_fini(adev);
}
-
- r = adev->ip_blocks[i].version->funcs->sw_fini(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- DRM_DEBUG("sw_fini of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
+ if (adev->ip_blocks[i].version->funcs->sw_fini) {
+ r = adev->ip_blocks[i].version->funcs->sw_fini(&adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ DRM_DEBUG("sw_fini of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ }
}
adev->ip_blocks[i].status.sw = false;
adev->ip_blocks[i].status.valid = false;
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 04/15] drm/amdgpu: clean the dummy sw_fini functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (2 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 03/15] drm/amdgpu: validate sw_fini before function call Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call Sunil Khatri
` (11 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy sw_fini functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 ------
drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
drivers/gpu/drm/amd/amdgpu/nv.c | 6 ------
drivers/gpu/drm/amd/amdgpu/si.c | 7 -------
drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ------
drivers/gpu/drm/amd/amdgpu/vi.c | 6 ------
7 files changed, 43 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index c75bc32ca7ef..9b98b40ac4db 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -33,11 +33,6 @@
#include "isp_v4_1_0.h"
#include "isp_v4_1_1.h"
-static int isp_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
/**
* isp_hw_init - start and test isp block
*
@@ -169,7 +164,6 @@ static const struct amd_ip_funcs isp_ip_funcs = {
.name = "isp_ip",
.early_init = isp_early_init,
.late_init = NULL,
- .sw_fini = isp_sw_fini,
.hw_init = isp_hw_init,
.hw_fini = isp_hw_fini,
.suspend = isp_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index a374d1bb24ab..f3f6b32d4e2a 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2124,11 +2124,6 @@ static int cik_common_early_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int cik_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int cik_common_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -2190,7 +2185,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
.name = "cik_common",
.early_init = cik_common_early_init,
.late_init = NULL,
- .sw_fini = cik_common_sw_fini,
.hw_init = cik_common_hw_init,
.hw_fini = cik_common_hw_fini,
.suspend = cik_common_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 4e8f9af1e2be..95c6461aab6f 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -983,11 +983,6 @@ static int nv_common_sw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int nv_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int nv_common_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -1111,7 +1106,6 @@ static const struct amd_ip_funcs nv_common_ip_funcs = {
.early_init = nv_common_early_init,
.late_init = nv_common_late_init,
.sw_init = nv_common_sw_init,
- .sw_fini = nv_common_sw_fini,
.hw_init = nv_common_hw_init,
.hw_fini = nv_common_hw_fini,
.suspend = nv_common_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 3714c6d77f30..f0817d5fbea8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2148,12 +2148,6 @@ static int si_common_early_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int si_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
-
static void si_init_golden_registers(struct amdgpu_device *adev)
{
switch (adev->asic_type) {
@@ -2686,7 +2680,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.name = "si_common",
.early_init = si_common_early_init,
.late_init = NULL,
- .sw_fini = si_common_sw_fini,
.hw_init = si_common_hw_init,
.hw_fini = si_common_hw_fini,
.suspend = si_common_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index c4b950e75133..cdcc5c09a6b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -842,11 +842,6 @@ static int soc21_common_sw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int soc21_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc21_common_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -1000,7 +995,6 @@ static const struct amd_ip_funcs soc21_common_ip_funcs = {
.early_init = soc21_common_early_init,
.late_init = soc21_common_late_init,
.sw_init = soc21_common_sw_init,
- .sw_fini = soc21_common_sw_fini,
.hw_init = soc21_common_hw_init,
.hw_fini = soc21_common_hw_fini,
.suspend = soc21_common_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index b20dc81dc257..34ed064a6a64 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -465,11 +465,6 @@ static int soc24_common_sw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int soc24_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc24_common_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -591,7 +586,6 @@ static const struct amd_ip_funcs soc24_common_ip_funcs = {
.early_init = soc24_common_early_init,
.late_init = soc24_common_late_init,
.sw_init = soc24_common_sw_init,
- .sw_fini = soc24_common_sw_fini,
.hw_init = soc24_common_hw_init,
.hw_fini = soc24_common_hw_fini,
.suspend = soc24_common_suspend,
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 4996049dc199..7a19b4f5b09f 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1699,11 +1699,6 @@ static int vi_common_sw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int vi_common_sw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int vi_common_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -2043,7 +2038,6 @@ static const struct amd_ip_funcs vi_common_ip_funcs = {
.early_init = vi_common_early_init,
.late_init = vi_common_late_init,
.sw_init = vi_common_sw_init,
- .sw_fini = vi_common_sw_fini,
.hw_init = vi_common_hw_init,
.hw_fini = vi_common_hw_fini,
.suspend = vi_common_suspend,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (3 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 04/15] drm/amdgpu: clean the dummy sw_fini functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 11:52 ` Christian König
2024-10-17 10:06 ` [PATCH v4 06/15] drm/amdgpu: validate suspend " Sunil Khatri
` (10 subsequent siblings)
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to hw_fini, validate
the function pointer like we do in sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 33 ++++++++++++++--------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index cf84b50f2355..96cecd4a636b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3287,11 +3287,17 @@ static void amdgpu_device_smu_fini_early(struct amdgpu_device *adev)
if (!adev->ip_blocks[i].status.hw)
continue;
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
- r = adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
+ if (!adev->ip_blocks[i].version->funcs->hw_fini) {
+ DRM_ERROR("hw_fini of IP block <%s> not defined\n",
+ adev->ip_blocks[i].version->funcs->name);
+ } else {
+ r = adev->ip_blocks[i].version->funcs->hw_fini(
+ &adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ }
}
adev->ip_blocks[i].status.hw = false;
break;
@@ -3325,12 +3331,17 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
if (!adev->ip_blocks[i].status.hw)
continue;
-
- r = adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
+ if (!adev->ip_blocks[i].version->funcs->hw_fini) {
+ DRM_ERROR("hw_fini of IP block <%s> not defined\n",
+ adev->ip_blocks[i].version->funcs->name);
+ } else {
+ r = adev->ip_blocks[i].version->funcs->hw_fini(
+ &adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ }
}
adev->ip_blocks[i].status.hw = false;
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 06/15] drm/amdgpu: validate suspend before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (4 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 11:54 ` Christian König
2024-10-17 10:06 ` [PATCH v4 07/15] drm/amdgpu: validate resume " Sunil Khatri
` (9 subsequent siblings)
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to suspend, validate
the function pointer like we do in sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/aldebaran.c | 15 ++++++------
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 ++++++++++++---------
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 ++++++----
drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 15 ++++++------
drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 15 ++++++------
5 files changed, 46 insertions(+), 37 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
index c1ff24335a0c..e55d680d95ce 100644
--- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
+++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
@@ -85,13 +85,14 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
-
- if (r) {
- dev_err(adev->dev,
- "suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "suspend of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = false;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 96cecd4a636b..fda89aeb4d1b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3478,12 +3478,14 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- DRM_ERROR("suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ DRM_ERROR("suspend of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = false;
@@ -3560,11 +3562,13 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- DRM_ERROR("suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ DRM_ERROR("suspend of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ }
}
adev->ip_blocks[i].status.hw = false;
/* handle putting the SMC in the appropriate state */
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
index 3e2724590dbf..6bc75aa1c3b1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
@@ -40,11 +40,13 @@ static int amdgpu_reset_xgmi_reset_on_init_suspend(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
- /* XXX handle errors */
- if (r) {
- dev_err(adev->dev, "suspend of IP block <%s> failed %d",
- adev->ip_blocks[i].version->funcs->name, r);
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ /* XXX handle errors */
+ if (r) {
+ dev_err(adev->dev, "suspend of IP block <%s> failed %d",
+ adev->ip_blocks[i].version->funcs->name, r);
+ }
}
adev->ip_blocks[i].status.hw = false;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
index 475b7df3a908..10dece12509f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
+++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
@@ -81,13 +81,14 @@ static int sienna_cichlid_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
-
- if (r) {
- dev_err(adev->dev,
- "suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "suspend of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = false;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
index 5ea9090b5040..ab049f0b4d39 100644
--- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
+++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
@@ -80,13 +80,14 @@ static int smu_v13_0_10_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_MES))
continue;
- r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
-
- if (r) {
- dev_err(adev->dev,
- "suspend of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->suspend) {
+ r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "suspend of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = false;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 07/15] drm/amdgpu: validate resume before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (5 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 06/15] drm/amdgpu: validate suspend " Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 11:55 ` Christian König
2024-10-17 10:06 ` [PATCH v4 08/15] drm/amdgpu: validate wait_for_idle " Sunil Khatri
` (8 subsequent siblings)
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to resume, validate
the function pointer like we do in sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/aldebaran.c | 23 ++++++----
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 ++++++++++++---------
drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 28 ++++++------
drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 14 +++---
4 files changed, 66 insertions(+), 46 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
index e55d680d95ce..4dd9af51210d 100644
--- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
+++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
@@ -247,9 +247,11 @@ static int aldebaran_mode2_restore_ip(struct amdgpu_device *adev)
dev_err(adev->dev, "Failed to get BIF handle\n");
return -EINVAL;
}
- r = cmn_block->version->funcs->resume(cmn_block);
- if (r)
- return r;
+ if (cmn_block->version->funcs->resume) {
+ r = cmn_block->version->funcs->resume(cmn_block);
+ if (r)
+ return r;
+ }
/* Reinit GFXHUB */
adev->gfxhub.funcs->init(adev);
@@ -283,12 +285,15 @@ static int aldebaran_mode2_restore_ip(struct amdgpu_device *adev)
adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- dev_err(adev->dev,
- "resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index fda89aeb4d1b..aa7314c14db8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2744,11 +2744,15 @@ static int amdgpu_device_fw_loading(struct amdgpu_device *adev)
break;
if (amdgpu_in_reset(adev) || adev->in_suspend) {
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- DRM_ERROR("resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(
+ &adev->ip_blocks[i]);
+ if (r) {
+ DRM_ERROR("resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs
+ ->name, r);
+ return r;
+ }
}
} else {
r = adev->ip_blocks[i].version->funcs->hw_init(&adev->ip_blocks[i]);
@@ -3683,10 +3687,12 @@ static int amdgpu_device_ip_reinit_late_sriov(struct amdgpu_device *adev)
block->status.hw)
continue;
- if (block->version->type == AMD_IP_BLOCK_TYPE_SMC)
- r = block->version->funcs->resume(&adev->ip_blocks[i]);
- else
+ if (block->version->type == AMD_IP_BLOCK_TYPE_SMC) {
+ if (adev->ip_blocks[i].version->funcs->resume)
+ r = block->version->funcs->resume(&adev->ip_blocks[i]);
+ } else {
r = block->version->funcs->hw_init(&adev->ip_blocks[i]);
+ }
DRM_INFO("RE-INIT-late: %s %s\n", block->version->funcs->name, r?"failed":"succeeded");
if (r)
@@ -3721,12 +3727,13 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
(adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP && amdgpu_sriov_vf(adev))) {
-
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- DRM_ERROR("resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ DRM_ERROR("resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
}
@@ -3760,11 +3767,13 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
continue;
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- DRM_ERROR("resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ DRM_ERROR("resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
}
diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
index 10dece12509f..082a69babe62 100644
--- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
+++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
@@ -176,12 +176,14 @@ static int sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
for (i = 0; i < adev->num_ip_blocks; i++) {
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH) {
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- dev_err(adev->dev,
- "resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
@@ -194,12 +196,14 @@ static int sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- dev_err(adev->dev,
- "resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
index ab049f0b4d39..2e041424ef9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
+++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
@@ -187,12 +187,14 @@ static int smu_v13_0_10_mode2_restore_ip(struct amdgpu_device *adev)
adev->ip_blocks[i].version->type ==
AMD_IP_BLOCK_TYPE_SDMA))
continue;
- r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
- if (r) {
- dev_err(adev->dev,
- "resume of IP block <%s> failed %d\n",
- adev->ip_blocks[i].version->funcs->name, r);
- return r;
+ if (adev->ip_blocks[i].version->funcs->resume) {
+ r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
+ if (r) {
+ dev_err(adev->dev,
+ "resume of IP block <%s> failed %d\n",
+ adev->ip_blocks[i].version->funcs->name, r);
+ return r;
+ }
}
adev->ip_blocks[i].status.hw = true;
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 08/15] drm/amdgpu: validate wait_for_idle before function call
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (6 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 07/15] drm/amdgpu: validate resume " Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 09/15] drm/amdgpu: clean the dummy resume functions Sunil Khatri
` (7 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Before making a function call to wait_for_idle,
validate the function pointer like we do in sw_init.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index aa7314c14db8..7c369448f2b7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2204,9 +2204,12 @@ int amdgpu_device_ip_wait_for_idle(struct amdgpu_device *adev,
if (!adev->ip_blocks[i].status.valid)
continue;
if (adev->ip_blocks[i].version->type == block_type) {
- r = adev->ip_blocks[i].version->funcs->wait_for_idle(&adev->ip_blocks[i]);
- if (r)
- return r;
+ if (adev->ip_blocks[i].version->funcs->wait_for_idle) {
+ r = adev->ip_blocks[i].version->funcs->wait_for_idle(
+ &adev->ip_blocks[i]);
+ if (r)
+ return r;
+ }
break;
}
}
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 09/15] drm/amdgpu: clean the dummy resume functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (7 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 08/15] drm/amdgpu: validate wait_for_idle " Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 10/15] drm/amdgpu: clean the dummy suspend functions Sunil Khatri
` (6 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy resume functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index 9b98b40ac4db..1383fd1644d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -71,11 +71,6 @@ static int isp_suspend(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int isp_resume(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int isp_load_fw_by_psp(struct amdgpu_device *adev)
{
const struct common_firmware_header *hdr;
@@ -167,7 +162,6 @@ static const struct amd_ip_funcs isp_ip_funcs = {
.hw_init = isp_hw_init,
.hw_fini = isp_hw_fini,
.suspend = isp_suspend,
- .resume = isp_resume,
.is_idle = isp_is_idle,
.wait_for_idle = isp_wait_for_idle,
.soft_reset = isp_soft_reset,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 10/15] drm/amdgpu: clean the dummy suspend functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (8 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 09/15] drm/amdgpu: clean the dummy resume functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions Sunil Khatri
` (5 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy suspend functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 6 ------
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 3 ++-
drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
4 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index 1383fd1644d6..4d82e8fec0f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -66,11 +66,6 @@ static int isp_hw_fini(struct amdgpu_ip_block *ip_block)
return -ENODEV;
}
-static int isp_suspend(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int isp_load_fw_by_psp(struct amdgpu_device *adev)
{
const struct common_firmware_header *hdr;
@@ -161,7 +156,6 @@ static const struct amd_ip_funcs isp_ip_funcs = {
.late_init = NULL,
.hw_init = isp_hw_init,
.hw_fini = isp_hw_fini,
- .suspend = isp_suspend,
.is_idle = isp_is_idle,
.wait_for_idle = isp_wait_for_idle,
.soft_reset = isp_soft_reset,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index fd31e2e9feb9..ed8015313827 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -613,7 +613,8 @@ static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
r = drm_mode_config_helper_suspend(adev_to_drm(adev));
if (r)
return r;
- return amdgpu_vkms_hw_fini(ip_block);
+
+ return 0;
}
static int amdgpu_vkms_resume(struct amdgpu_ip_block *ip_block)
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index f3f6b32d4e2a..c8fb592f13df 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2143,11 +2143,6 @@ static int cik_common_hw_fini(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int cik_common_suspend(struct amdgpu_ip_block *ip_block)
-{
- return cik_common_hw_fini(ip_block);
-}
-
static int cik_common_resume(struct amdgpu_ip_block *ip_block)
{
return cik_common_hw_init(ip_block);
@@ -2187,7 +2182,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
.late_init = NULL,
.hw_init = cik_common_hw_init,
.hw_fini = cik_common_hw_fini,
- .suspend = cik_common_suspend,
.resume = cik_common_resume,
.is_idle = cik_common_is_idle,
.wait_for_idle = cik_common_wait_for_idle,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index f0817d5fbea8..66ccb76eb72a 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2639,11 +2639,6 @@ static int si_common_hw_fini(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int si_common_suspend(struct amdgpu_ip_block *ip_block)
-{
- return si_common_hw_fini(ip_block);
-}
-
static int si_common_resume(struct amdgpu_ip_block *ip_block)
{
return si_common_hw_init(ip_block);
@@ -2682,7 +2677,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.late_init = NULL,
.hw_init = si_common_hw_init,
.hw_fini = si_common_hw_fini,
- .suspend = si_common_suspend,
.resume = si_common_resume,
.is_idle = si_common_is_idle,
.wait_for_idle = si_common_wait_for_idle,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (9 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 10/15] drm/amdgpu: clean the dummy suspend functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 11:58 ` Christian König
2024-10-17 10:06 ` [PATCH v4 12/15] drm/amdgpu: clean the dummy wait_for_idle functions Sunil Khatri
` (4 subsequent siblings)
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy hw_fini functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 ------
drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +----------
drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
4 files changed, 1 insertion(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index ed8015313827..e3a399bfab61 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -600,11 +600,6 @@ static int amdgpu_vkms_hw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int amdgpu_vkms_hw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -661,7 +656,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
.sw_init = amdgpu_vkms_sw_init,
.sw_fini = amdgpu_vkms_sw_fini,
.hw_init = amdgpu_vkms_hw_init,
- .hw_fini = amdgpu_vkms_hw_fini,
.suspend = amdgpu_vkms_suspend,
.resume = amdgpu_vkms_resume,
.is_idle = amdgpu_vkms_is_idle,
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index c8fb592f13df..9cb25d0d1051 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2138,11 +2138,6 @@ static int cik_common_hw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int cik_common_hw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int cik_common_resume(struct amdgpu_ip_block *ip_block)
{
return cik_common_hw_init(ip_block);
@@ -2181,7 +2176,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
.early_init = cik_common_early_init,
.late_init = NULL,
.hw_init = cik_common_hw_init,
- .hw_fini = cik_common_hw_fini,
.resume = cik_common_resume,
.is_idle = cik_common_is_idle,
.wait_for_idle = cik_common_wait_for_idle,
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
index 9d0e342a2f81..a1af5c90f79a 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
@@ -40,7 +40,6 @@ MODULE_FIRMWARE("amdgpu/gc_12_0_1_mes1.bin");
MODULE_FIRMWARE("amdgpu/gc_12_0_1_uni_mes.bin");
static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block);
-static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block);
static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev);
static int mes_v12_0_kiq_hw_fini(struct amdgpu_device *adev);
@@ -1516,7 +1515,6 @@ static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev)
return r;
failure:
- mes_v12_0_hw_fini(ip_block);
return r;
}
@@ -1600,15 +1598,9 @@ static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block)
return 0;
failure:
- mes_v12_0_hw_fini(ip_block);
return r;
}
-static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
@@ -1617,7 +1609,7 @@ static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
if (r)
return r;
- return mes_v12_0_hw_fini(ip_block);
+ return 0;
}
static int mes_v12_0_resume(struct amdgpu_ip_block *ip_block)
@@ -1663,7 +1655,6 @@ static const struct amd_ip_funcs mes_v12_0_ip_funcs = {
.sw_init = mes_v12_0_sw_init,
.sw_fini = mes_v12_0_sw_fini,
.hw_init = mes_v12_0_hw_init,
- .hw_fini = mes_v12_0_hw_fini,
.suspend = mes_v12_0_suspend,
.resume = mes_v12_0_resume,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 66ccb76eb72a..e1b3bef6992a 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2634,11 +2634,6 @@ static int si_common_hw_init(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int si_common_hw_fini(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int si_common_resume(struct amdgpu_ip_block *ip_block)
{
return si_common_hw_init(ip_block);
@@ -2676,7 +2671,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.early_init = si_common_early_init,
.late_init = NULL,
.hw_init = si_common_hw_init,
- .hw_fini = si_common_hw_fini,
.resume = si_common_resume,
.is_idle = si_common_is_idle,
.wait_for_idle = si_common_wait_for_idle,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 12/15] drm/amdgpu: clean the dummy wait_for_idle functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (10 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 13/15] drm/amdgpu: clean the dummy soft_reset functions Sunil Khatri
` (3 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy wait_for_idle functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 ------
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 5 -----
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 ------
drivers/gpu/drm/amd/amdgpu/cik.c | 6 +-----
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/nv.c | 6 ------
drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc15.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ------
drivers/gpu/drm/amd/amdgpu/vi.c | 6 ------
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 7 -------
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 6 ------
16 files changed, 1 insertion(+), 95 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index 8e0725198dae..1a9b7e8947d8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -584,11 +584,6 @@ static bool acp_is_idle(void *handle)
return true;
}
-static int acp_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int acp_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -622,7 +617,6 @@ static const struct amd_ip_funcs acp_ip_funcs = {
.suspend = acp_suspend,
.resume = acp_resume,
.is_idle = acp_is_idle,
- .wait_for_idle = acp_wait_for_idle,
.soft_reset = acp_soft_reset,
.set_clockgating_state = acp_set_clockgating_state,
.set_powergating_state = acp_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index 4d82e8fec0f5..f220f3819ba6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -128,11 +128,6 @@ static bool isp_is_idle(void *handle)
return true;
}
-static int isp_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int isp_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index e3a399bfab61..e9585fdb53e3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -627,11 +627,6 @@ static bool amdgpu_vkms_is_idle(void *handle)
return true;
}
-static int amdgpu_vkms_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int amdgpu_vkms_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -659,7 +654,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
.suspend = amdgpu_vkms_suspend,
.resume = amdgpu_vkms_resume,
.is_idle = amdgpu_vkms_is_idle,
- .wait_for_idle = amdgpu_vkms_wait_for_idle,
.soft_reset = amdgpu_vkms_soft_reset,
.set_clockgating_state = amdgpu_vkms_set_clockgating_state,
.set_powergating_state = amdgpu_vkms_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 9cb25d0d1051..d7a843280059 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2148,10 +2148,7 @@ static bool cik_common_is_idle(void *handle)
return true;
}
-static int cik_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
+
static int cik_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
@@ -2178,7 +2175,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
.hw_init = cik_common_hw_init,
.resume = cik_common_resume,
.is_idle = cik_common_is_idle,
- .wait_for_idle = cik_common_wait_for_idle,
.soft_reset = cik_common_soft_reset,
.set_clockgating_state = cik_common_set_clockgating_state,
.set_powergating_state = cik_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index 2d0a24a343f7..a5985663a867 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -2948,11 +2948,6 @@ static bool dce_v10_0_is_idle(void *handle)
return true;
}
-static int dce_v10_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static bool dce_v10_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
@@ -3330,7 +3325,6 @@ static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
.suspend = dce_v10_0_suspend,
.resume = dce_v10_0_resume,
.is_idle = dce_v10_0_is_idle,
- .wait_for_idle = dce_v10_0_wait_for_idle,
.check_soft_reset = dce_v10_0_check_soft_reset,
.soft_reset = dce_v10_0_soft_reset,
.set_clockgating_state = dce_v10_0_set_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 386ece7bc389..5c907a1a4778 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -3086,11 +3086,6 @@ static bool dce_v11_0_is_idle(void *handle)
return true;
}
-static int dce_v11_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int dce_v11_0_soft_reset(struct amdgpu_ip_block *ip_block)
{
u32 srbm_soft_reset = 0, tmp;
@@ -3462,7 +3457,6 @@ static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
.suspend = dce_v11_0_suspend,
.resume = dce_v11_0_resume,
.is_idle = dce_v11_0_is_idle,
- .wait_for_idle = dce_v11_0_wait_for_idle,
.soft_reset = dce_v11_0_soft_reset,
.set_clockgating_state = dce_v11_0_set_clockgating_state,
.set_powergating_state = dce_v11_0_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index cd3e0118988d..a53e4fac89dc 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -2843,11 +2843,6 @@ static bool dce_v6_0_is_idle(void *handle)
return true;
}
-static int dce_v6_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int dce_v6_0_soft_reset(struct amdgpu_ip_block *ip_block)
{
DRM_INFO("xxxx: dce_v6_0_soft_reset --- no impl!!\n");
@@ -3152,7 +3147,6 @@ static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
.suspend = dce_v6_0_suspend,
.resume = dce_v6_0_resume,
.is_idle = dce_v6_0_is_idle,
- .wait_for_idle = dce_v6_0_wait_for_idle,
.soft_reset = dce_v6_0_soft_reset,
.set_clockgating_state = dce_v6_0_set_clockgating_state,
.set_powergating_state = dce_v6_0_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 295bc1d47095..9278e0d8d00c 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -2866,11 +2866,6 @@ static bool dce_v8_0_is_idle(void *handle)
return true;
}
-static int dce_v8_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int dce_v8_0_soft_reset(struct amdgpu_ip_block *ip_block)
{
u32 srbm_soft_reset = 0, tmp;
@@ -3240,7 +3235,6 @@ static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
.suspend = dce_v8_0_suspend,
.resume = dce_v8_0_resume,
.is_idle = dce_v8_0_is_idle,
- .wait_for_idle = dce_v8_0_wait_for_idle,
.soft_reset = dce_v8_0_soft_reset,
.set_clockgating_state = dce_v8_0_set_clockgating_state,
.set_powergating_state = dce_v8_0_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 95c6461aab6f..38f5a2cbc3fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1039,11 +1039,6 @@ static bool nv_common_is_idle(void *handle)
return true;
}
-static int nv_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int nv_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -1111,7 +1106,6 @@ static const struct amd_ip_funcs nv_common_ip_funcs = {
.suspend = nv_common_suspend,
.resume = nv_common_resume,
.is_idle = nv_common_is_idle,
- .wait_for_idle = nv_common_wait_for_idle,
.soft_reset = nv_common_soft_reset,
.set_clockgating_state = nv_common_set_clockgating_state,
.set_powergating_state = nv_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index e1b3bef6992a..cac01f77f4d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2644,11 +2644,6 @@ static bool si_common_is_idle(void *handle)
return true;
}
-static int si_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int si_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -2673,7 +2668,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.hw_init = si_common_hw_init,
.resume = si_common_resume,
.is_idle = si_common_is_idle,
- .wait_for_idle = si_common_wait_for_idle,
.soft_reset = si_common_soft_reset,
.set_clockgating_state = si_common_set_clockgating_state,
.set_powergating_state = si_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index dd1c1aacdd8e..d974c0b5a909 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1341,11 +1341,6 @@ static bool soc15_common_is_idle(void *handle)
return true;
}
-static int soc15_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc15_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -1501,7 +1496,6 @@ static const struct amd_ip_funcs soc15_common_ip_funcs = {
.suspend = soc15_common_suspend,
.resume = soc15_common_resume,
.is_idle = soc15_common_is_idle,
- .wait_for_idle = soc15_common_wait_for_idle,
.soft_reset = soc15_common_soft_reset,
.set_clockgating_state = soc15_common_set_clockgating_state,
.set_powergating_state = soc15_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index cdcc5c09a6b3..78550a965579 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -927,11 +927,6 @@ static bool soc21_common_is_idle(void *handle)
return true;
}
-static int soc21_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc21_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -1000,7 +995,6 @@ static const struct amd_ip_funcs soc21_common_ip_funcs = {
.suspend = soc21_common_suspend,
.resume = soc21_common_resume,
.is_idle = soc21_common_is_idle,
- .wait_for_idle = soc21_common_wait_for_idle,
.soft_reset = soc21_common_soft_reset,
.set_clockgating_state = soc21_common_set_clockgating_state,
.set_powergating_state = soc21_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 34ed064a6a64..216a45556cf4 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -522,11 +522,6 @@ static bool soc24_common_is_idle(void *handle)
return true;
}
-static int soc24_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc24_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -591,7 +586,6 @@ static const struct amd_ip_funcs soc24_common_ip_funcs = {
.suspend = soc24_common_suspend,
.resume = soc24_common_resume,
.is_idle = soc24_common_is_idle,
- .wait_for_idle = soc24_common_wait_for_idle,
.soft_reset = soc24_common_soft_reset,
.set_clockgating_state = soc24_common_set_clockgating_state,
.set_powergating_state = soc24_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 7a19b4f5b09f..a40c789dc3c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1741,11 +1741,6 @@ static bool vi_common_is_idle(void *handle)
return true;
}
-static int vi_common_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int vi_common_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -2043,7 +2038,6 @@ static const struct amd_ip_funcs vi_common_ip_funcs = {
.suspend = vi_common_suspend,
.resume = vi_common_resume,
.is_idle = vi_common_is_idle,
- .wait_for_idle = vi_common_wait_for_idle,
.soft_reset = vi_common_soft_reset,
.set_clockgating_state = vi_common_set_clockgating_state,
.set_powergating_state = vi_common_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index 2cd6cb991f29..fbea169460f2 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -3099,12 +3099,6 @@ static bool kv_dpm_is_idle(void *handle)
return true;
}
-static int kv_dpm_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
-
static int kv_dpm_soft_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -3313,7 +3307,6 @@ static const struct amd_ip_funcs kv_dpm_ip_funcs = {
.suspend = kv_dpm_suspend,
.resume = kv_dpm_resume,
.is_idle = kv_dpm_is_idle,
- .wait_for_idle = kv_dpm_wait_for_idle,
.soft_reset = kv_dpm_soft_reset,
.set_clockgating_state = kv_dpm_set_clockgating_state,
.set_powergating_state = kv_dpm_set_powergating_state,
diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
index f193c77cc141..7eacf4dd1b60 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
@@ -244,11 +244,6 @@ static bool pp_is_idle(void *handle)
return false;
}
-static int pp_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int pp_sw_reset(struct amdgpu_ip_block *ip_block)
{
return 0;
@@ -295,7 +290,6 @@ static const struct amd_ip_funcs pp_ip_funcs = {
.suspend = pp_suspend,
.resume = pp_resume,
.is_idle = pp_is_idle,
- .wait_for_idle = pp_wait_for_idle,
.soft_reset = pp_sw_reset,
.set_clockgating_state = pp_set_clockgating_state,
.set_powergating_state = pp_set_powergating_state,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 13/15] drm/amdgpu: clean the dummy soft_reset functions
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (11 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 12/15] drm/amdgpu: clean the dummy wait_for_idle functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs Sunil Khatri
` (2 subsequent siblings)
15 siblings, 0 replies; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the dummy soft_reset functions for all
ip blocks.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 6 ------
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 5 -----
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 ------
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 6 ------
drivers/gpu/drm/amd/amdgpu/nv.c | 6 ------
drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc15.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ------
drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ------
drivers/gpu/drm/amd/amdgpu/vi.c | 6 ------
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 6 ------
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 6 ------
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 6 ------
16 files changed, 95 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index 1a9b7e8947d8..8b7e056a7355 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -584,11 +584,6 @@ static bool acp_is_idle(void *handle)
return true;
}
-static int acp_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int acp_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -617,7 +612,6 @@ static const struct amd_ip_funcs acp_ip_funcs = {
.suspend = acp_suspend,
.resume = acp_resume,
.is_idle = acp_is_idle,
- .soft_reset = acp_soft_reset,
.set_clockgating_state = acp_set_clockgating_state,
.set_powergating_state = acp_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index f220f3819ba6..acc8a4b2732b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -128,11 +128,6 @@ static bool isp_is_idle(void *handle)
return true;
}
-static int isp_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int isp_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index e9585fdb53e3..6850a27f724f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -627,11 +627,6 @@ static bool amdgpu_vkms_is_idle(void *handle)
return true;
}
-static int amdgpu_vkms_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int amdgpu_vkms_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -654,7 +649,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
.suspend = amdgpu_vkms_suspend,
.resume = amdgpu_vkms_resume,
.is_idle = amdgpu_vkms_is_idle,
- .soft_reset = amdgpu_vkms_soft_reset,
.set_clockgating_state = amdgpu_vkms_set_clockgating_state,
.set_powergating_state = amdgpu_vkms_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index 6ac6d4dfa49f..5769055909bc 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -3186,11 +3186,6 @@ static int gfx_v6_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
return -ETIMEDOUT;
}
-static int gfx_v6_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static void gfx_v6_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
enum amdgpu_interrupt_state state)
{
@@ -3449,7 +3444,6 @@ static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
.resume = gfx_v6_0_resume,
.is_idle = gfx_v6_0_is_idle,
.wait_for_idle = gfx_v6_0_wait_for_idle,
- .soft_reset = gfx_v6_0_soft_reset,
.set_clockgating_state = gfx_v6_0_set_clockgating_state,
.set_powergating_state = gfx_v6_0_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
index 5cf2002fcba8..3c9b7f88a6cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
@@ -1085,11 +1085,6 @@ static int gmc_v10_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int gmc_v10_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int gmc_v10_0_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -1151,7 +1146,6 @@ const struct amd_ip_funcs gmc_v10_0_ip_funcs = {
.resume = gmc_v10_0_resume,
.is_idle = gmc_v10_0_is_idle,
.wait_for_idle = gmc_v10_0_wait_for_idle,
- .soft_reset = gmc_v10_0_soft_reset,
.set_clockgating_state = gmc_v10_0_set_clockgating_state,
.set_powergating_state = gmc_v10_0_set_powergating_state,
.get_clockgating_state = gmc_v10_0_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
index 4df4d73038f8..6e7cf551fe16 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
@@ -993,11 +993,6 @@ static int gmc_v11_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int gmc_v11_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int gmc_v11_0_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -1038,7 +1033,6 @@ const struct amd_ip_funcs gmc_v11_0_ip_funcs = {
.resume = gmc_v11_0_resume,
.is_idle = gmc_v11_0_is_idle,
.wait_for_idle = gmc_v11_0_wait_for_idle,
- .soft_reset = gmc_v11_0_soft_reset,
.set_clockgating_state = gmc_v11_0_set_clockgating_state,
.set_powergating_state = gmc_v11_0_set_powergating_state,
.get_clockgating_state = gmc_v11_0_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
index e33f9e9058cc..d4a9a03e5fd0 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c
@@ -977,11 +977,6 @@ static int gmc_v12_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int gmc_v12_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int gmc_v12_0_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -1022,7 +1017,6 @@ const struct amd_ip_funcs gmc_v12_0_ip_funcs = {
.resume = gmc_v12_0_resume,
.is_idle = gmc_v12_0_is_idle,
.wait_for_idle = gmc_v12_0_wait_for_idle,
- .soft_reset = gmc_v12_0_soft_reset,
.set_clockgating_state = gmc_v12_0_set_clockgating_state,
.set_powergating_state = gmc_v12_0_set_powergating_state,
.get_clockgating_state = gmc_v12_0_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 38f5a2cbc3fe..c16f724384cd 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1039,11 +1039,6 @@ static bool nv_common_is_idle(void *handle)
return true;
}
-static int nv_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int nv_common_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -1106,7 +1101,6 @@ static const struct amd_ip_funcs nv_common_ip_funcs = {
.suspend = nv_common_suspend,
.resume = nv_common_resume,
.is_idle = nv_common_is_idle,
- .soft_reset = nv_common_soft_reset,
.set_clockgating_state = nv_common_set_clockgating_state,
.set_powergating_state = nv_common_set_powergating_state,
.get_clockgating_state = nv_common_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index cac01f77f4d4..6d8d5547d18b 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2644,11 +2644,6 @@ static bool si_common_is_idle(void *handle)
return true;
}
-static int si_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int si_common_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -2668,7 +2663,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
.hw_init = si_common_hw_init,
.resume = si_common_resume,
.is_idle = si_common_is_idle,
- .soft_reset = si_common_soft_reset,
.set_clockgating_state = si_common_set_clockgating_state,
.set_powergating_state = si_common_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index d974c0b5a909..19391cbc1474 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1341,11 +1341,6 @@ static bool soc15_common_is_idle(void *handle)
return true;
}
-static int soc15_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static void soc15_update_drm_clock_gating(struct amdgpu_device *adev, bool enable)
{
uint32_t def, data;
@@ -1496,7 +1491,6 @@ static const struct amd_ip_funcs soc15_common_ip_funcs = {
.suspend = soc15_common_suspend,
.resume = soc15_common_resume,
.is_idle = soc15_common_is_idle,
- .soft_reset = soc15_common_soft_reset,
.set_clockgating_state = soc15_common_set_clockgating_state,
.set_powergating_state = soc15_common_set_powergating_state,
.get_clockgating_state= soc15_common_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 78550a965579..078f25b5f09b 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -927,11 +927,6 @@ static bool soc21_common_is_idle(void *handle)
return true;
}
-static int soc21_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc21_common_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -995,7 +990,6 @@ static const struct amd_ip_funcs soc21_common_ip_funcs = {
.suspend = soc21_common_suspend,
.resume = soc21_common_resume,
.is_idle = soc21_common_is_idle,
- .soft_reset = soc21_common_soft_reset,
.set_clockgating_state = soc21_common_set_clockgating_state,
.set_powergating_state = soc21_common_set_powergating_state,
.get_clockgating_state = soc21_common_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 216a45556cf4..3af10ef4b793 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -522,11 +522,6 @@ static bool soc24_common_is_idle(void *handle)
return true;
}
-static int soc24_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int soc24_common_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -586,7 +581,6 @@ static const struct amd_ip_funcs soc24_common_ip_funcs = {
.suspend = soc24_common_suspend,
.resume = soc24_common_resume,
.is_idle = soc24_common_is_idle,
- .soft_reset = soc24_common_soft_reset,
.set_clockgating_state = soc24_common_set_clockgating_state,
.set_powergating_state = soc24_common_set_powergating_state,
.get_clockgating_state = soc24_common_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index a40c789dc3c4..607b48a2d5eb 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -1741,11 +1741,6 @@ static bool vi_common_is_idle(void *handle)
return true;
}
-static int vi_common_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static void vi_update_bif_medium_grain_light_sleep(struct amdgpu_device *adev,
bool enable)
{
@@ -2038,7 +2033,6 @@ static const struct amd_ip_funcs vi_common_ip_funcs = {
.suspend = vi_common_suspend,
.resume = vi_common_resume,
.is_idle = vi_common_is_idle,
- .soft_reset = vi_common_soft_reset,
.set_clockgating_state = vi_common_set_clockgating_state,
.set_powergating_state = vi_common_set_powergating_state,
.get_clockgating_state = vi_common_get_clockgating_state,
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index fbea169460f2..785cb20e64b6 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -3099,11 +3099,6 @@ static bool kv_dpm_is_idle(void *handle)
return true;
}
-static int kv_dpm_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int kv_dpm_set_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *src,
unsigned type,
@@ -3307,7 +3302,6 @@ static const struct amd_ip_funcs kv_dpm_ip_funcs = {
.suspend = kv_dpm_suspend,
.resume = kv_dpm_resume,
.is_idle = kv_dpm_is_idle,
- .soft_reset = kv_dpm_soft_reset,
.set_clockgating_state = kv_dpm_set_clockgating_state,
.set_powergating_state = kv_dpm_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index a4908f0402f1..7b0ded50251a 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -7849,11 +7849,6 @@ static int si_dpm_wait_for_idle(struct amdgpu_ip_block *ip_block)
return 0;
}
-static int si_dpm_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int si_dpm_set_clockgating_state(void *handle,
enum amd_clockgating_state state)
{
@@ -8049,7 +8044,6 @@ static const struct amd_ip_funcs si_dpm_ip_funcs = {
.resume = si_dpm_resume,
.is_idle = si_dpm_is_idle,
.wait_for_idle = si_dpm_wait_for_idle,
- .soft_reset = si_dpm_soft_reset,
.set_clockgating_state = si_dpm_set_clockgating_state,
.set_powergating_state = si_dpm_set_powergating_state,
.dump_ip_state = NULL,
diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
index 7eacf4dd1b60..5aadb6061c22 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
@@ -244,11 +244,6 @@ static bool pp_is_idle(void *handle)
return false;
}
-static int pp_sw_reset(struct amdgpu_ip_block *ip_block)
-{
- return 0;
-}
-
static int pp_set_powergating_state(void *handle,
enum amd_powergating_state state)
{
@@ -290,7 +285,6 @@ static const struct amd_ip_funcs pp_ip_funcs = {
.suspend = pp_suspend,
.resume = pp_resume,
.is_idle = pp_is_idle,
- .soft_reset = pp_sw_reset,
.set_clockgating_state = pp_set_clockgating_state,
.set_powergating_state = pp_set_powergating_state,
.dump_ip_state = NULL,
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (12 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 13/15] drm/amdgpu: clean the dummy soft_reset functions Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 12:18 ` Christian König
2024-10-17 10:06 ` [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use Sunil Khatri
2024-10-17 12:23 ` [PATCH v4 00/15] validate/clean the functions of ip funcs Christian König
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Remove the unused and commented out code for vcn/uvd IP's.
Also remove the functions which are set to NULL as these are
global structures and all members are set to 0 or NULL during
initialization.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 -
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 1 -
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 -
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
drivers/gpu/drm/amd/amdgpu/cik.c | 3 -
drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/nv.c | 2 -
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/si.c | 3 -
drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/soc15.c | 2 -
drivers/gpu/drm/amd/amdgpu/soc21.c | 2 -
drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
drivers/gpu/drm/amd/amdgpu/vi.c | 2 -
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 2 -
drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 2 -
.../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 2 -
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
70 files changed, 790 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index 8b7e056a7355..ec5e0dcf8613 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -603,8 +603,6 @@ static int acp_set_powergating_state(void *handle,
static const struct amd_ip_funcs acp_ip_funcs = {
.name = "acp_ip",
- .early_init = NULL,
- .late_init = NULL,
.sw_init = acp_sw_init,
.sw_fini = acp_sw_fini,
.hw_init = acp_hw_init,
@@ -614,8 +612,6 @@ static const struct amd_ip_funcs acp_ip_funcs = {
.is_idle = acp_is_idle,
.set_clockgating_state = acp_set_clockgating_state,
.set_powergating_state = acp_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version acp_ip_block = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
index acc8a4b2732b..b6e4a8226832 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
@@ -143,7 +143,6 @@ static int isp_set_powergating_state(void *handle,
static const struct amd_ip_funcs isp_ip_funcs = {
.name = "isp_ip",
.early_init = isp_early_init,
- .late_init = NULL,
.hw_init = isp_hw_init,
.hw_fini = isp_hw_fini,
.is_idle = isp_is_idle,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index cad153e333d8..abd5e980c9c7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -4095,17 +4095,12 @@ const struct attribute_group amdgpu_flash_attr_group = {
const struct amd_ip_funcs psp_ip_funcs = {
.name = "psp",
.early_init = psp_early_init,
- .late_init = NULL,
.sw_init = psp_sw_init,
.sw_fini = psp_sw_fini,
.hw_init = psp_hw_init,
.hw_fini = psp_hw_fini,
.suspend = psp_suspend,
.resume = psp_resume,
- .is_idle = NULL,
- .check_soft_reset = NULL,
- .wait_for_idle = NULL,
- .soft_reset = NULL,
.set_clockgating_state = psp_set_clockgating_state,
.set_powergating_state = psp_set_powergating_state,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
index 3ef75f1a47f6..bd2d3863c3ed 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
@@ -993,8 +993,6 @@ static const struct amd_ip_funcs umsch_mm_v4_0_ip_funcs = {
.hw_fini = umsch_mm_hw_fini,
.suspend = umsch_mm_suspend,
.resume = umsch_mm_resume,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version umsch_mm_v4_0_ip_block = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
index 6850a27f724f..52e01e09a1b3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
@@ -641,8 +641,6 @@ static int amdgpu_vkms_set_powergating_state(void *handle,
static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
.name = "amdgpu_vkms",
- .early_init = NULL,
- .late_init = NULL,
.sw_init = amdgpu_vkms_sw_init,
.sw_fini = amdgpu_vkms_sw_fini,
.hw_init = amdgpu_vkms_hw_init,
@@ -651,8 +649,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
.is_idle = amdgpu_vkms_is_idle,
.set_clockgating_state = amdgpu_vkms_set_clockgating_state,
.set_powergating_state = amdgpu_vkms_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version amdgpu_vkms_ip_block = {
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
index 6d96e1f21e20..46713a158d90 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
@@ -906,14 +906,12 @@ static void vpe_set_ring_funcs(struct amdgpu_device *adev)
const struct amd_ip_funcs vpe_ip_funcs = {
.name = "vpe_v6_1",
.early_init = vpe_early_init,
- .late_init = NULL,
.sw_init = vpe_sw_init,
.sw_fini = vpe_sw_fini,
.hw_init = vpe_hw_init,
.hw_fini = vpe_hw_fini,
.suspend = vpe_suspend,
.resume = vpe_resume,
- .soft_reset = NULL,
.set_clockgating_state = vpe_set_clockgating_state,
.set_powergating_state = vpe_set_powergating_state,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index d7a843280059..23b712fda53d 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -2171,15 +2171,12 @@ static int cik_common_set_powergating_state(void *handle,
static const struct amd_ip_funcs cik_common_ip_funcs = {
.name = "cik_common",
.early_init = cik_common_early_init,
- .late_init = NULL,
.hw_init = cik_common_hw_init,
.resume = cik_common_resume,
.is_idle = cik_common_is_idle,
.soft_reset = cik_common_soft_reset,
.set_clockgating_state = cik_common_set_clockgating_state,
.set_powergating_state = cik_common_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ip_block_version cik_common_ip_block =
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
index 9e9a58fd86ce..1da17755ad53 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
@@ -417,7 +417,6 @@ static int cik_ih_set_powergating_state(void *handle,
static const struct amd_ip_funcs cik_ih_ip_funcs = {
.name = "cik_ih",
.early_init = cik_ih_early_init,
- .late_init = NULL,
.sw_init = cik_ih_sw_init,
.sw_fini = cik_ih_sw_fini,
.hw_init = cik_ih_hw_init,
@@ -429,8 +428,6 @@ static const struct amd_ip_funcs cik_ih_ip_funcs = {
.soft_reset = cik_ih_soft_reset,
.set_clockgating_state = cik_ih_set_clockgating_state,
.set_powergating_state = cik_ih_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs cik_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
index df3f429e003e..ede1a028d48d 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
@@ -1213,7 +1213,6 @@ static int cik_sdma_set_powergating_state(void *handle,
static const struct amd_ip_funcs cik_sdma_ip_funcs = {
.name = "cik_sdma",
.early_init = cik_sdma_early_init,
- .late_init = NULL,
.sw_init = cik_sdma_sw_init,
.sw_fini = cik_sdma_sw_fini,
.hw_init = cik_sdma_hw_init,
@@ -1225,8 +1224,6 @@ static const struct amd_ip_funcs cik_sdma_ip_funcs = {
.soft_reset = cik_sdma_soft_reset,
.set_clockgating_state = cik_sdma_set_clockgating_state,
.set_powergating_state = cik_sdma_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
index cadd69a243af..d72973bd570d 100644
--- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
@@ -415,7 +415,6 @@ static int cz_ih_set_powergating_state(void *handle,
static const struct amd_ip_funcs cz_ih_ip_funcs = {
.name = "cz_ih",
.early_init = cz_ih_early_init,
- .late_init = NULL,
.sw_init = cz_ih_sw_init,
.sw_fini = cz_ih_sw_fini,
.hw_init = cz_ih_hw_init,
@@ -427,8 +426,6 @@ static const struct amd_ip_funcs cz_ih_ip_funcs = {
.soft_reset = cz_ih_soft_reset,
.set_clockgating_state = cz_ih_set_clockgating_state,
.set_powergating_state = cz_ih_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs cz_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
index a5985663a867..5098c50d54c8 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
@@ -3317,7 +3317,6 @@ static int dce_v10_0_set_powergating_state(void *handle,
static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
.name = "dce_v10_0",
.early_init = dce_v10_0_early_init,
- .late_init = NULL,
.sw_init = dce_v10_0_sw_init,
.sw_fini = dce_v10_0_sw_fini,
.hw_init = dce_v10_0_hw_init,
@@ -3329,8 +3328,6 @@ static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
.soft_reset = dce_v10_0_soft_reset,
.set_clockgating_state = dce_v10_0_set_clockgating_state,
.set_powergating_state = dce_v10_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static void
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
index 5c907a1a4778..c5680ff4ab9f 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
@@ -3449,7 +3449,6 @@ static int dce_v11_0_set_powergating_state(void *handle,
static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
.name = "dce_v11_0",
.early_init = dce_v11_0_early_init,
- .late_init = NULL,
.sw_init = dce_v11_0_sw_init,
.sw_fini = dce_v11_0_sw_fini,
.hw_init = dce_v11_0_hw_init,
@@ -3460,8 +3459,6 @@ static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
.soft_reset = dce_v11_0_soft_reset,
.set_clockgating_state = dce_v11_0_set_clockgating_state,
.set_powergating_state = dce_v11_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static void
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
index a53e4fac89dc..eb7de9122d99 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
@@ -3139,7 +3139,6 @@ static int dce_v6_0_set_powergating_state(void *handle,
static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
.name = "dce_v6_0",
.early_init = dce_v6_0_early_init,
- .late_init = NULL,
.sw_init = dce_v6_0_sw_init,
.sw_fini = dce_v6_0_sw_fini,
.hw_init = dce_v6_0_hw_init,
@@ -3150,8 +3149,6 @@ static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
.soft_reset = dce_v6_0_soft_reset,
.set_clockgating_state = dce_v6_0_set_clockgating_state,
.set_powergating_state = dce_v6_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static void
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
index 9278e0d8d00c..04b79ff87f75 100644
--- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
@@ -3227,7 +3227,6 @@ static int dce_v8_0_set_powergating_state(void *handle,
static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
.name = "dce_v8_0",
.early_init = dce_v8_0_early_init,
- .late_init = NULL,
.sw_init = dce_v8_0_sw_init,
.sw_fini = dce_v8_0_sw_fini,
.hw_init = dce_v8_0_hw_init,
@@ -3238,8 +3237,6 @@ static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
.soft_reset = dce_v8_0_soft_reset,
.set_clockgating_state = dce_v8_0_set_clockgating_state,
.set_powergating_state = dce_v8_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static void
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
index 5769055909bc..41f50bf380c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
@@ -3435,7 +3435,6 @@ static void gfx_v6_0_emit_mem_sync(struct amdgpu_ring *ring)
static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
.name = "gfx_v6_0",
.early_init = gfx_v6_0_early_init,
- .late_init = NULL,
.sw_init = gfx_v6_0_sw_init,
.sw_fini = gfx_v6_0_sw_fini,
.hw_init = gfx_v6_0_hw_init,
@@ -3446,8 +3445,6 @@ static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
.wait_for_idle = gfx_v6_0_wait_for_idle,
.set_clockgating_state = gfx_v6_0_set_clockgating_state,
.set_powergating_state = gfx_v6_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_gfx = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
index a683d2bfb8de..824d5913103b 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
@@ -5005,8 +5005,6 @@ static const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
.soft_reset = gfx_v7_0_soft_reset,
.set_clockgating_state = gfx_v7_0_set_clockgating_state,
.set_powergating_state = gfx_v7_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 8b72463fd5c0..480c41ee947e 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -6948,8 +6948,6 @@ static const struct amd_ip_funcs gfx_v8_0_ip_funcs = {
.set_clockgating_state = gfx_v8_0_set_clockgating_state,
.set_powergating_state = gfx_v8_0_set_powergating_state,
.get_clockgating_state = gfx_v8_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index c1e2f1d79e74..ca000b3d1afc 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -1121,8 +1121,6 @@ static const struct amd_ip_funcs gmc_v6_0_ip_funcs = {
.soft_reset = gmc_v6_0_soft_reset,
.set_clockgating_state = gmc_v6_0_set_clockgating_state,
.set_powergating_state = gmc_v6_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_gmc_funcs gmc_v6_0_gmc_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
index 54a48662f3b5..07f45f1a503a 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
@@ -1348,8 +1348,6 @@ static const struct amd_ip_funcs gmc_v7_0_ip_funcs = {
.soft_reset = gmc_v7_0_soft_reset,
.set_clockgating_state = gmc_v7_0_set_clockgating_state,
.set_powergating_state = gmc_v7_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_gmc_funcs gmc_v7_0_gmc_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
index c4f2ad32c078..12d5967ecd45 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
@@ -1722,8 +1722,6 @@ static const struct amd_ip_funcs gmc_v8_0_ip_funcs = {
.set_clockgating_state = gmc_v8_0_set_clockgating_state,
.set_powergating_state = gmc_v8_0_set_powergating_state,
.get_clockgating_state = gmc_v8_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_gmc_funcs gmc_v8_0_gmc_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
index a3fb01f905d4..7f45e93c0397 100644
--- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
@@ -407,7 +407,6 @@ static int iceland_ih_set_powergating_state(void *handle,
static const struct amd_ip_funcs iceland_ih_ip_funcs = {
.name = "iceland_ih",
.early_init = iceland_ih_early_init,
- .late_init = NULL,
.sw_init = iceland_ih_sw_init,
.sw_fini = iceland_ih_sw_fini,
.hw_init = iceland_ih_hw_init,
@@ -419,8 +418,6 @@ static const struct amd_ip_funcs iceland_ih_ip_funcs = {
.soft_reset = iceland_ih_soft_reset,
.set_clockgating_state = iceland_ih_set_clockgating_state,
.set_powergating_state = iceland_ih_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs iceland_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
index 09403eac483b..38f953fd65d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
@@ -779,7 +779,6 @@ static void ih_v6_0_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
.name = "ih_v6_0",
.early_init = ih_v6_0_early_init,
- .late_init = NULL,
.sw_init = ih_v6_0_sw_init,
.sw_fini = ih_v6_0_sw_fini,
.hw_init = ih_v6_0_hw_init,
@@ -792,8 +791,6 @@ static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
.set_clockgating_state = ih_v6_0_set_clockgating_state,
.set_powergating_state = ih_v6_0_set_powergating_state,
.get_clockgating_state = ih_v6_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs ih_v6_0_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
index 9706d7593d26..61381e0c3795 100644
--- a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
@@ -762,7 +762,6 @@ static void ih_v6_1_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs ih_v6_1_ip_funcs = {
.name = "ih_v6_1",
.early_init = ih_v6_1_early_init,
- .late_init = NULL,
.sw_init = ih_v6_1_sw_init,
.sw_fini = ih_v6_1_sw_fini,
.hw_init = ih_v6_1_hw_init,
@@ -775,8 +774,6 @@ static const struct amd_ip_funcs ih_v6_1_ip_funcs = {
.set_clockgating_state = ih_v6_1_set_clockgating_state,
.set_powergating_state = ih_v6_1_set_powergating_state,
.get_clockgating_state = ih_v6_1_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs ih_v6_1_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
index 9657145d7cce..d2428cf5d385 100644
--- a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
@@ -752,7 +752,6 @@ static void ih_v7_0_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs ih_v7_0_ip_funcs = {
.name = "ih_v7_0",
.early_init = ih_v7_0_early_init,
- .late_init = NULL,
.sw_init = ih_v7_0_sw_init,
.sw_fini = ih_v7_0_sw_fini,
.hw_init = ih_v7_0_hw_init,
@@ -765,8 +764,6 @@ static const struct amd_ip_funcs ih_v7_0_ip_funcs = {
.set_clockgating_state = ih_v7_0_set_clockgating_state,
.set_powergating_state = ih_v7_0_set_powergating_state,
.get_clockgating_state = ih_v7_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs ih_v7_0_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
index 6762b5c64ccb..d6823fb45d32 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
@@ -742,7 +742,6 @@ static int jpeg_v2_0_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = {
.name = "jpeg_v2_0",
.early_init = jpeg_v2_0_early_init,
- .late_init = NULL,
.sw_init = jpeg_v2_0_sw_init,
.sw_fini = jpeg_v2_0_sw_fini,
.hw_init = jpeg_v2_0_hw_init,
@@ -751,14 +750,8 @@ static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = {
.resume = jpeg_v2_0_resume,
.is_idle = jpeg_v2_0_is_idle,
.wait_for_idle = jpeg_v2_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v2_0_set_clockgating_state,
.set_powergating_state = jpeg_v2_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v2_0_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
index 4b8c801f204d..5063a38801d6 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
@@ -613,7 +613,6 @@ static int jpeg_v2_5_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v2_5_ip_funcs = {
.name = "jpeg_v2_5",
.early_init = jpeg_v2_5_early_init,
- .late_init = NULL,
.sw_init = jpeg_v2_5_sw_init,
.sw_fini = jpeg_v2_5_sw_fini,
.hw_init = jpeg_v2_5_hw_init,
@@ -622,20 +621,13 @@ static const struct amd_ip_funcs jpeg_v2_5_ip_funcs = {
.resume = jpeg_v2_5_resume,
.is_idle = jpeg_v2_5_is_idle,
.wait_for_idle = jpeg_v2_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v2_5_set_clockgating_state,
.set_powergating_state = jpeg_v2_5_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = {
.name = "jpeg_v2_6",
.early_init = jpeg_v2_5_early_init,
- .late_init = NULL,
.sw_init = jpeg_v2_5_sw_init,
.sw_fini = jpeg_v2_5_sw_fini,
.hw_init = jpeg_v2_5_hw_init,
@@ -644,14 +636,8 @@ static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = {
.resume = jpeg_v2_5_resume,
.is_idle = jpeg_v2_5_is_idle,
.wait_for_idle = jpeg_v2_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v2_5_set_clockgating_state,
.set_powergating_state = jpeg_v2_5_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v2_5_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
index 7996209818b6..10adbb7cbf53 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
@@ -533,7 +533,6 @@ static int jpeg_v3_0_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = {
.name = "jpeg_v3_0",
.early_init = jpeg_v3_0_early_init,
- .late_init = NULL,
.sw_init = jpeg_v3_0_sw_init,
.sw_fini = jpeg_v3_0_sw_fini,
.hw_init = jpeg_v3_0_hw_init,
@@ -542,14 +541,8 @@ static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = {
.resume = jpeg_v3_0_resume,
.is_idle = jpeg_v3_0_is_idle,
.wait_for_idle = jpeg_v3_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v3_0_set_clockgating_state,
.set_powergating_state = jpeg_v3_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v3_0_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
index 20e1fe89c463..89953c0f5f1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
@@ -700,7 +700,6 @@ static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
.name = "jpeg_v4_0",
.early_init = jpeg_v4_0_early_init,
- .late_init = NULL,
.sw_init = jpeg_v4_0_sw_init,
.sw_fini = jpeg_v4_0_sw_fini,
.hw_init = jpeg_v4_0_hw_init,
@@ -709,14 +708,8 @@ static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
.resume = jpeg_v4_0_resume,
.is_idle = jpeg_v4_0_is_idle,
.wait_for_idle = jpeg_v4_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v4_0_set_clockgating_state,
.set_powergating_state = jpeg_v4_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v4_0_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 2a53537db135..6917e4a8e96a 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -1050,7 +1050,6 @@ static int jpeg_v4_0_3_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = {
.name = "jpeg_v4_0_3",
.early_init = jpeg_v4_0_3_early_init,
- .late_init = NULL,
.sw_init = jpeg_v4_0_3_sw_init,
.sw_fini = jpeg_v4_0_3_sw_fini,
.hw_init = jpeg_v4_0_3_hw_init,
@@ -1059,14 +1058,8 @@ static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = {
.resume = jpeg_v4_0_3_resume,
.is_idle = jpeg_v4_0_3_is_idle,
.wait_for_idle = jpeg_v4_0_3_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v4_0_3_set_clockgating_state,
.set_powergating_state = jpeg_v4_0_3_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
index ef2d4237925b..f3cce523f3cb 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
@@ -741,7 +741,6 @@ static int jpeg_v4_0_5_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
.name = "jpeg_v4_0_5",
.early_init = jpeg_v4_0_5_early_init,
- .late_init = NULL,
.sw_init = jpeg_v4_0_5_sw_init,
.sw_fini = jpeg_v4_0_5_sw_fini,
.hw_init = jpeg_v4_0_5_hw_init,
@@ -750,14 +749,8 @@ static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
.resume = jpeg_v4_0_5_resume,
.is_idle = jpeg_v4_0_5_is_idle,
.wait_for_idle = jpeg_v4_0_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v4_0_5_set_clockgating_state,
.set_powergating_state = jpeg_v4_0_5_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v4_0_5_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
index 7954a6fae464..06840d1dae79 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
@@ -620,7 +620,6 @@ static int jpeg_v5_0_0_process_interrupt(struct amdgpu_device *adev,
static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = {
.name = "jpeg_v5_0_0",
.early_init = jpeg_v5_0_0_early_init,
- .late_init = NULL,
.sw_init = jpeg_v5_0_0_sw_init,
.sw_fini = jpeg_v5_0_0_sw_fini,
.hw_init = jpeg_v5_0_0_hw_init,
@@ -629,14 +628,8 @@ static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = {
.resume = jpeg_v5_0_0_resume,
.is_idle = jpeg_v5_0_0_is_idle,
.wait_for_idle = jpeg_v5_0_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = jpeg_v5_0_0_set_clockgating_state,
.set_powergating_state = jpeg_v5_0_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs jpeg_v5_0_0_dec_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
index 2edfe86a866b..8ca137313961 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
@@ -1707,8 +1707,6 @@ static const struct amd_ip_funcs mes_v11_0_ip_funcs = {
.hw_fini = mes_v11_0_hw_fini,
.suspend = mes_v11_0_suspend,
.resume = mes_v11_0_resume,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version mes_v11_0_ip_block = {
diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
index 93da900b7ee2..0820ed62e2e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
@@ -694,7 +694,6 @@ static void navi10_ih_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs navi10_ih_ip_funcs = {
.name = "navi10_ih",
.early_init = navi10_ih_early_init,
- .late_init = NULL,
.sw_init = navi10_ih_sw_init,
.sw_fini = navi10_ih_sw_fini,
.hw_init = navi10_ih_hw_init,
@@ -707,8 +706,6 @@ static const struct amd_ip_funcs navi10_ih_ip_funcs = {
.set_clockgating_state = navi10_ih_set_clockgating_state,
.set_powergating_state = navi10_ih_set_powergating_state,
.get_clockgating_state = navi10_ih_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs navi10_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index c16f724384cd..6b72169be8f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1104,6 +1104,4 @@ static const struct amd_ip_funcs nv_common_ip_funcs = {
.set_clockgating_state = nv_common_set_clockgating_state,
.set_powergating_state = nv_common_set_powergating_state,
.get_clockgating_state = nv_common_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index 10fd772cb80f..7948d74f8722 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -1096,7 +1096,6 @@ static int sdma_v2_4_set_powergating_state(void *handle,
static const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
.name = "sdma_v2_4",
.early_init = sdma_v2_4_early_init,
- .late_init = NULL,
.sw_init = sdma_v2_4_sw_init,
.sw_fini = sdma_v2_4_sw_fini,
.hw_init = sdma_v2_4_hw_init,
@@ -1108,8 +1107,6 @@ static const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
.soft_reset = sdma_v2_4_soft_reset,
.set_clockgating_state = sdma_v2_4_set_clockgating_state,
.set_powergating_state = sdma_v2_4_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 69fba087e09c..9a3d729545a7 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -1534,7 +1534,6 @@ static void sdma_v3_0_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
.name = "sdma_v3_0",
.early_init = sdma_v3_0_early_init,
- .late_init = NULL,
.sw_init = sdma_v3_0_sw_init,
.sw_fini = sdma_v3_0_sw_fini,
.hw_init = sdma_v3_0_hw_init,
@@ -1550,8 +1549,6 @@ static const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
.set_clockgating_state = sdma_v3_0_set_clockgating_state,
.set_powergating_state = sdma_v3_0_set_powergating_state,
.get_clockgating_state = sdma_v3_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
index 6a675daf5620..d31c4860933f 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
@@ -1929,7 +1929,6 @@ static void sdma_v5_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs sdma_v5_0_ip_funcs = {
.name = "sdma_v5_0",
.early_init = sdma_v5_0_early_init,
- .late_init = NULL,
.sw_init = sdma_v5_0_sw_init,
.sw_fini = sdma_v5_0_sw_fini,
.hw_init = sdma_v5_0_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
index e1413ccaf7e4..ffa8c62ac101 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
@@ -1918,7 +1918,6 @@ static void sdma_v5_2_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs sdma_v5_2_ip_funcs = {
.name = "sdma_v5_2",
.early_init = sdma_v5_2_early_init,
- .late_init = NULL,
.sw_init = sdma_v5_2_sw_init,
.sw_fini = sdma_v5_2_sw_fini,
.hw_init = sdma_v5_2_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
index 4856a093e23f..449d515e6b67 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
@@ -1649,7 +1649,6 @@ static void sdma_v6_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
const struct amd_ip_funcs sdma_v6_0_ip_funcs = {
.name = "sdma_v6_0",
.early_init = sdma_v6_0_early_init,
- .late_init = NULL,
.sw_init = sdma_v6_0_sw_init,
.sw_fini = sdma_v6_0_sw_fini,
.hw_init = sdma_v6_0_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
index 24f24974ac1d..dfd4b08e4b47 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
@@ -1579,7 +1579,6 @@ static void sdma_v7_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
const struct amd_ip_funcs sdma_v7_0_ip_funcs = {
.name = "sdma_v7_0",
.early_init = sdma_v7_0_early_init,
- .late_init = NULL,
.sw_init = sdma_v7_0_sw_init,
.sw_fini = sdma_v7_0_sw_fini,
.hw_init = sdma_v7_0_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 6d8d5547d18b..82d6f5aabb1d 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -2659,14 +2659,11 @@ static int si_common_set_powergating_state(void *handle,
static const struct amd_ip_funcs si_common_ip_funcs = {
.name = "si_common",
.early_init = si_common_early_init,
- .late_init = NULL,
.hw_init = si_common_hw_init,
.resume = si_common_resume,
.is_idle = si_common_is_idle,
.set_clockgating_state = si_common_set_clockgating_state,
.set_powergating_state = si_common_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ip_block_version si_common_ip_block =
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
index d44483ed3363..47647a6083e8 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
@@ -691,7 +691,6 @@ static int si_dma_set_powergating_state(void *handle,
static const struct amd_ip_funcs si_dma_ip_funcs = {
.name = "si_dma",
.early_init = si_dma_early_init,
- .late_init = NULL,
.sw_init = si_dma_sw_init,
.sw_fini = si_dma_sw_fini,
.hw_init = si_dma_hw_init,
@@ -703,8 +702,6 @@ static const struct amd_ip_funcs si_dma_ip_funcs = {
.soft_reset = si_dma_soft_reset,
.set_clockgating_state = si_dma_set_clockgating_state,
.set_powergating_state = si_dma_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs si_dma_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c b/drivers/gpu/drm/amd/amdgpu/si_ih.c
index b018a3b90401..2ec1ebe4db11 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c
@@ -278,7 +278,6 @@ static int si_ih_set_powergating_state(void *handle,
static const struct amd_ip_funcs si_ih_ip_funcs = {
.name = "si_ih",
.early_init = si_ih_early_init,
- .late_init = NULL,
.sw_init = si_ih_sw_init,
.sw_fini = si_ih_sw_fini,
.hw_init = si_ih_hw_init,
@@ -290,8 +289,6 @@ static const struct amd_ip_funcs si_ih_ip_funcs = {
.soft_reset = si_ih_soft_reset,
.set_clockgating_state = si_ih_set_clockgating_state,
.set_powergating_state = si_ih_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs si_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 19391cbc1474..93e44e7ee3fa 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1494,6 +1494,4 @@ static const struct amd_ip_funcs soc15_common_ip_funcs = {
.set_clockgating_state = soc15_common_set_clockgating_state,
.set_powergating_state = soc15_common_set_powergating_state,
.get_clockgating_state= soc15_common_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 078f25b5f09b..1c07ebdc0d1f 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -993,6 +993,4 @@ static const struct amd_ip_funcs soc21_common_ip_funcs = {
.set_clockgating_state = soc21_common_set_clockgating_state,
.set_powergating_state = soc21_common_set_powergating_state,
.get_clockgating_state = soc21_common_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
index 45fb5140c8b7..5a04a6770138 100644
--- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
@@ -463,7 +463,6 @@ static int tonga_ih_set_powergating_state(void *handle,
static const struct amd_ip_funcs tonga_ih_ip_funcs = {
.name = "tonga_ih",
.early_init = tonga_ih_early_init,
- .late_init = NULL,
.sw_init = tonga_ih_sw_init,
.sw_fini = tonga_ih_sw_fini,
.hw_init = tonga_ih_hw_init,
@@ -478,8 +477,6 @@ static const struct amd_ip_funcs tonga_ih_ip_funcs = {
.post_soft_reset = tonga_ih_post_soft_reset,
.set_clockgating_state = tonga_ih_set_clockgating_state,
.set_powergating_state = tonga_ih_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ih_funcs tonga_ih_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
index 3011b5853fb4..bdbca25d80c4 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
@@ -805,7 +805,6 @@ static int uvd_v3_1_set_powergating_state(void *handle,
static const struct amd_ip_funcs uvd_v3_1_ip_funcs = {
.name = "uvd_v3_1",
.early_init = uvd_v3_1_early_init,
- .late_init = NULL,
.sw_init = uvd_v3_1_sw_init,
.sw_fini = uvd_v3_1_sw_fini,
.hw_init = uvd_v3_1_hw_init,
@@ -818,8 +817,6 @@ static const struct amd_ip_funcs uvd_v3_1_ip_funcs = {
.soft_reset = uvd_v3_1_soft_reset,
.set_clockgating_state = uvd_v3_1_set_clockgating_state,
.set_powergating_state = uvd_v3_1_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version uvd_v3_1_ip_block = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
index 4852a2ab128f..a836dc9cfcad 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
@@ -755,7 +755,6 @@ static int uvd_v4_2_set_powergating_state(void *handle,
static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
.name = "uvd_v4_2",
.early_init = uvd_v4_2_early_init,
- .late_init = NULL,
.sw_init = uvd_v4_2_sw_init,
.sw_fini = uvd_v4_2_sw_fini,
.hw_init = uvd_v4_2_hw_init,
@@ -768,8 +767,6 @@ static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
.soft_reset = uvd_v4_2_soft_reset,
.set_clockgating_state = uvd_v4_2_set_clockgating_state,
.set_powergating_state = uvd_v4_2_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
index a24b210c79ac..ab55fae3569e 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
@@ -867,7 +867,6 @@ static void uvd_v5_0_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
.name = "uvd_v5_0",
.early_init = uvd_v5_0_early_init,
- .late_init = NULL,
.sw_init = uvd_v5_0_sw_init,
.sw_fini = uvd_v5_0_sw_fini,
.hw_init = uvd_v5_0_hw_init,
@@ -881,8 +880,6 @@ static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
.set_clockgating_state = uvd_v5_0_set_clockgating_state,
.set_powergating_state = uvd_v5_0_set_powergating_state,
.get_clockgating_state = uvd_v5_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
index b4eeeebfe095..39f8c3d3a135 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
@@ -1532,7 +1532,6 @@ static void uvd_v6_0_get_clockgating_state(void *handle, u64 *flags)
static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
.name = "uvd_v6_0",
.early_init = uvd_v6_0_early_init,
- .late_init = NULL,
.sw_init = uvd_v6_0_sw_init,
.sw_fini = uvd_v6_0_sw_fini,
.hw_init = uvd_v6_0_hw_init,
@@ -1549,8 +1548,6 @@ static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
.set_clockgating_state = uvd_v6_0_set_clockgating_state,
.set_powergating_state = uvd_v6_0_set_powergating_state,
.get_clockgating_state = uvd_v6_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
index 55fa858328f6..f909a60a8853 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
@@ -1462,104 +1462,6 @@ static void uvd_v7_0_enc_ring_emit_wreg(struct amdgpu_ring *ring,
amdgpu_ring_write(ring, val);
}
-#if 0
-static bool uvd_v7_0_is_idle(void *handle)
-{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- return !(RREG32(mmSRBM_STATUS) & SRBM_STATUS__UVD_BUSY_MASK);
-}
-
-static int uvd_v7_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- unsigned i;
- struct amdgpu_device *adev = ip_block->adev;
-
- for (i = 0; i < adev->usec_timeout; i++) {
- if (uvd_v7_0_is_idle(handle))
- return 0;
- }
- return -ETIMEDOUT;
-}
-
-#define AMDGPU_UVD_STATUS_BUSY_MASK 0xfd
-static bool uvd_v7_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
- u32 srbm_soft_reset = 0;
- u32 tmp = RREG32(mmSRBM_STATUS);
-
- if (REG_GET_FIELD(tmp, SRBM_STATUS, UVD_RQ_PENDING) ||
- REG_GET_FIELD(tmp, SRBM_STATUS, UVD_BUSY) ||
- (RREG32_SOC15(UVD, ring->me, mmUVD_STATUS) &
- AMDGPU_UVD_STATUS_BUSY_MASK))
- srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
- SRBM_SOFT_RESET, SOFT_RESET_UVD, 1);
-
- if (srbm_soft_reset) {
- adev->uvd.inst[ring->me].srbm_soft_reset = srbm_soft_reset;
- return true;
- } else {
- adev->uvd.inst[ring->me].srbm_soft_reset = 0;
- return false;
- }
-}
-
-static int uvd_v7_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
-
- if (!adev->uvd.inst[ring->me].srbm_soft_reset)
- return 0;
-
- uvd_v7_0_stop(adev);
- return 0;
-}
-
-static int uvd_v7_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
- u32 srbm_soft_reset;
-
- if (!adev->uvd.inst[ring->me].srbm_soft_reset)
- return 0;
- srbm_soft_reset = adev->uvd.inst[ring->me].srbm_soft_reset;
-
- if (srbm_soft_reset) {
- u32 tmp;
-
- tmp = RREG32(mmSRBM_SOFT_RESET);
- tmp |= srbm_soft_reset;
- dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
- WREG32(mmSRBM_SOFT_RESET, tmp);
- tmp = RREG32(mmSRBM_SOFT_RESET);
-
- udelay(50);
-
- tmp &= ~srbm_soft_reset;
- WREG32(mmSRBM_SOFT_RESET, tmp);
- tmp = RREG32(mmSRBM_SOFT_RESET);
-
- /* Wait a little for things to settle down */
- udelay(50);
- }
-
- return 0;
-}
-
-static int uvd_v7_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
-
- if (!adev->uvd.inst[ring->me].srbm_soft_reset)
- return 0;
-
- mdelay(5);
-
- return uvd_v7_0_start(adev);
-}
-#endif
-
static int uvd_v7_0_set_interrupt_state(struct amdgpu_device *adev,
struct amdgpu_irq_src *source,
unsigned type,
@@ -1609,187 +1511,9 @@ static int uvd_v7_0_process_interrupt(struct amdgpu_device *adev,
return 0;
}
-#if 0
-static void uvd_v7_0_set_sw_clock_gating(struct amdgpu_device *adev)
-{
- uint32_t data, data1, data2, suvd_flags;
-
- data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL);
- data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
- data2 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL);
-
- data &= ~(UVD_CGC_CTRL__CLK_OFF_DELAY_MASK |
- UVD_CGC_CTRL__CLK_GATE_DLY_TIMER_MASK);
-
- suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
- UVD_SUVD_CGC_GATE__SIT_MASK |
- UVD_SUVD_CGC_GATE__SMP_MASK |
- UVD_SUVD_CGC_GATE__SCM_MASK |
- UVD_SUVD_CGC_GATE__SDB_MASK;
-
- data |= UVD_CGC_CTRL__DYN_CLOCK_MODE_MASK |
- (1 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_GATE_DLY_TIMER)) |
- (4 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_OFF_DELAY));
-
- data &= ~(UVD_CGC_CTRL__UDEC_RE_MODE_MASK |
- UVD_CGC_CTRL__UDEC_CM_MODE_MASK |
- UVD_CGC_CTRL__UDEC_IT_MODE_MASK |
- UVD_CGC_CTRL__UDEC_DB_MODE_MASK |
- UVD_CGC_CTRL__UDEC_MP_MODE_MASK |
- UVD_CGC_CTRL__SYS_MODE_MASK |
- UVD_CGC_CTRL__UDEC_MODE_MASK |
- UVD_CGC_CTRL__MPEG2_MODE_MASK |
- UVD_CGC_CTRL__REGS_MODE_MASK |
- UVD_CGC_CTRL__RBC_MODE_MASK |
- UVD_CGC_CTRL__LMI_MC_MODE_MASK |
- UVD_CGC_CTRL__LMI_UMC_MODE_MASK |
- UVD_CGC_CTRL__IDCT_MODE_MASK |
- UVD_CGC_CTRL__MPRD_MODE_MASK |
- UVD_CGC_CTRL__MPC_MODE_MASK |
- UVD_CGC_CTRL__LBSI_MODE_MASK |
- UVD_CGC_CTRL__LRBBM_MODE_MASK |
- UVD_CGC_CTRL__WCB_MODE_MASK |
- UVD_CGC_CTRL__VCPU_MODE_MASK |
- UVD_CGC_CTRL__JPEG_MODE_MASK |
- UVD_CGC_CTRL__JPEG2_MODE_MASK |
- UVD_CGC_CTRL__SCPU_MODE_MASK);
- data2 &= ~(UVD_SUVD_CGC_CTRL__SRE_MODE_MASK |
- UVD_SUVD_CGC_CTRL__SIT_MODE_MASK |
- UVD_SUVD_CGC_CTRL__SMP_MODE_MASK |
- UVD_SUVD_CGC_CTRL__SCM_MODE_MASK |
- UVD_SUVD_CGC_CTRL__SDB_MODE_MASK);
- data1 |= suvd_flags;
-
- WREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL, data);
- WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, 0);
- WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
- WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL, data2);
-}
-
-static void uvd_v7_0_set_hw_clock_gating(struct amdgpu_device *adev)
-{
- uint32_t data, data1, cgc_flags, suvd_flags;
-
- data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE);
- data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
-
- cgc_flags = UVD_CGC_GATE__SYS_MASK |
- UVD_CGC_GATE__UDEC_MASK |
- UVD_CGC_GATE__MPEG2_MASK |
- UVD_CGC_GATE__RBC_MASK |
- UVD_CGC_GATE__LMI_MC_MASK |
- UVD_CGC_GATE__IDCT_MASK |
- UVD_CGC_GATE__MPRD_MASK |
- UVD_CGC_GATE__MPC_MASK |
- UVD_CGC_GATE__LBSI_MASK |
- UVD_CGC_GATE__LRBBM_MASK |
- UVD_CGC_GATE__UDEC_RE_MASK |
- UVD_CGC_GATE__UDEC_CM_MASK |
- UVD_CGC_GATE__UDEC_IT_MASK |
- UVD_CGC_GATE__UDEC_DB_MASK |
- UVD_CGC_GATE__UDEC_MP_MASK |
- UVD_CGC_GATE__WCB_MASK |
- UVD_CGC_GATE__VCPU_MASK |
- UVD_CGC_GATE__SCPU_MASK |
- UVD_CGC_GATE__JPEG_MASK |
- UVD_CGC_GATE__JPEG2_MASK;
-
- suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
- UVD_SUVD_CGC_GATE__SIT_MASK |
- UVD_SUVD_CGC_GATE__SMP_MASK |
- UVD_SUVD_CGC_GATE__SCM_MASK |
- UVD_SUVD_CGC_GATE__SDB_MASK;
-
- data |= cgc_flags;
- data1 |= suvd_flags;
-
- WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, data);
- WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
-}
-
-static void uvd_v7_0_set_bypass_mode(struct amdgpu_device *adev, bool enable)
-{
- u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
-
- if (enable)
- tmp |= (GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
- GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
- else
- tmp &= ~(GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
- GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
-
- WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
-}
-
-
-static int uvd_v7_0_set_clockgating_state(void *handle,
- enum amd_clockgating_state state)
-{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- bool enable = (state == AMD_CG_STATE_GATE);
- struct amdgpu_ip_block *ip_block;
-
- ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_UVD);
- if (!ip_block)
- return -EINVAL;
-
- uvd_v7_0_set_bypass_mode(adev, enable);
-
- if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
- return 0;
-
- if (enable) {
- /* disable HW gating and enable Sw gating */
- uvd_v7_0_set_sw_clock_gating(adev);
- } else {
- /* wait for STATUS to clear */
- if (uvd_v7_0_wait_for_idle(ip_block))
- return -EBUSY;
-
- /* enable HW gates because UVD is idle */
- /* uvd_v7_0_set_hw_clock_gating(adev); */
- }
-
- return 0;
-}
-
-static int uvd_v7_0_set_powergating_state(void *handle,
- enum amd_powergating_state state)
-{
- /* This doesn't actually powergate the UVD block.
- * That's done in the dpm code via the SMC. This
- * just re-inits the block as necessary. The actual
- * gating still happens in the dpm code. We should
- * revisit this when there is a cleaner line between
- * the smc and the hw blocks
- */
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
-
- if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
- return 0;
-
- WREG32_SOC15(UVD, ring->me, mmUVD_POWER_STATUS, UVD_POWER_STATUS__UVD_PG_EN_MASK);
-
- if (state == AMD_PG_STATE_GATE) {
- uvd_v7_0_stop(adev);
- return 0;
- } else {
- return uvd_v7_0_start(adev);
- }
-}
-#endif
-
-static int uvd_v7_0_set_clockgating_state(void *handle,
- enum amd_clockgating_state state)
-{
- /* needed for driver unload*/
- return 0;
-}
-
const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
.name = "uvd_v7_0",
.early_init = uvd_v7_0_early_init,
- .late_init = NULL,
.sw_init = uvd_v7_0_sw_init,
.sw_fini = uvd_v7_0_sw_fini,
.hw_init = uvd_v7_0_hw_init,
@@ -1797,14 +1521,6 @@ const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
.prepare_suspend = uvd_v7_0_prepare_suspend,
.suspend = uvd_v7_0_suspend,
.resume = uvd_v7_0_resume,
- .is_idle = NULL /* uvd_v7_0_is_idle */,
- .wait_for_idle = NULL /* uvd_v7_0_wait_for_idle */,
- .check_soft_reset = NULL /* uvd_v7_0_check_soft_reset */,
- .pre_soft_reset = NULL /* uvd_v7_0_pre_soft_reset */,
- .soft_reset = NULL /* uvd_v7_0_soft_reset */,
- .post_soft_reset = NULL /* uvd_v7_0_post_soft_reset */,
- .set_clockgating_state = uvd_v7_0_set_clockgating_state,
- .set_powergating_state = NULL /* uvd_v7_0_set_powergating_state */,
};
static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
index a4531000ec0b..c1ed91b39415 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
@@ -617,7 +617,6 @@ static int vce_v2_0_set_powergating_state(void *handle,
static const struct amd_ip_funcs vce_v2_0_ip_funcs = {
.name = "vce_v2_0",
.early_init = vce_v2_0_early_init,
- .late_init = NULL,
.sw_init = vce_v2_0_sw_init,
.sw_fini = vce_v2_0_sw_fini,
.hw_init = vce_v2_0_hw_init,
@@ -629,8 +628,6 @@ static const struct amd_ip_funcs vce_v2_0_ip_funcs = {
.soft_reset = vce_v2_0_soft_reset,
.set_clockgating_state = vce_v2_0_set_clockgating_state,
.set_powergating_state = vce_v2_0_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs vce_v2_0_ring_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
index 9f9a9d89bcdc..6bb318a06f19 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
@@ -896,7 +896,6 @@ static void vce_v3_0_emit_pipeline_sync(struct amdgpu_ring *ring)
static const struct amd_ip_funcs vce_v3_0_ip_funcs = {
.name = "vce_v3_0",
.early_init = vce_v3_0_early_init,
- .late_init = NULL,
.sw_init = vce_v3_0_sw_init,
.sw_fini = vce_v3_0_sw_fini,
.hw_init = vce_v3_0_hw_init,
@@ -912,8 +911,6 @@ static const struct amd_ip_funcs vce_v3_0_ip_funcs = {
.set_clockgating_state = vce_v3_0_set_clockgating_state,
.set_powergating_state = vce_v3_0_set_powergating_state,
.get_clockgating_state = vce_v3_0_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
index f4d2650e6b7a..da78f69da724 100644
--- a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
@@ -543,7 +543,6 @@ static int vce_v4_0_hw_fini(struct amdgpu_ip_block *ip_block)
cancel_delayed_work_sync(&adev->vce.idle_work);
if (!amdgpu_sriov_vf(adev)) {
- /* vce_v4_0_wait_for_idle(ip_block); */
vce_v4_0_stop(adev);
} else {
/* full access mode, so don't touch any VCE register */
@@ -691,273 +690,6 @@ static int vce_v4_0_set_clockgating_state(void *handle,
return 0;
}
-#if 0
-static bool vce_v4_0_is_idle(void *handle)
-{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- u32 mask = 0;
-
- mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE0) ? 0 : SRBM_STATUS2__VCE0_BUSY_MASK;
- mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE1) ? 0 : SRBM_STATUS2__VCE1_BUSY_MASK;
-
- return !(RREG32(mmSRBM_STATUS2) & mask);
-}
-
-static int vce_v4_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
-{
- unsigned i;
- struct amdgpu_device *adev = ip_block->adev;
-
- for (i = 0; i < adev->usec_timeout; i++)
- if (vce_v4_0_is_idle(handle))
- return 0;
-
- return -ETIMEDOUT;
-}
-
-#define VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK 0x00000008L /* AUTO_BUSY */
-#define VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK 0x00000010L /* RB0_BUSY */
-#define VCE_STATUS_VCPU_REPORT_RB1_BUSY_MASK 0x00000020L /* RB1_BUSY */
-#define AMDGPU_VCE_STATUS_BUSY_MASK (VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK | \
- VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK)
-
-static bool vce_v4_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
- u32 srbm_soft_reset = 0;
-
- /* According to VCE team , we should use VCE_STATUS instead
- * SRBM_STATUS.VCE_BUSY bit for busy status checking.
- * GRBM_GFX_INDEX.INSTANCE_INDEX is used to specify which VCE
- * instance's registers are accessed
- * (0 for 1st instance, 10 for 2nd instance).
- *
- *VCE_STATUS
- *|UENC|ACPI|AUTO ACTIVE|RB1 |RB0 |RB2 | |FW_LOADED|JOB |
- *|----+----+-----------+----+----+----+----------+---------+----|
- *|bit8|bit7| bit6 |bit5|bit4|bit3| bit2 | bit1 |bit0|
- *
- * VCE team suggest use bit 3--bit 6 for busy status check
- */
- mutex_lock(&adev->grbm_idx_mutex);
- WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
- if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
- srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
- srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
- }
- WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0x10);
- if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
- srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
- srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
- }
- WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
- mutex_unlock(&adev->grbm_idx_mutex);
-
- if (srbm_soft_reset) {
- adev->vce.srbm_soft_reset = srbm_soft_reset;
- return true;
- } else {
- adev->vce.srbm_soft_reset = 0;
- return false;
- }
-}
-
-static int vce_v4_0_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
- u32 srbm_soft_reset;
-
- if (!adev->vce.srbm_soft_reset)
- return 0;
- srbm_soft_reset = adev->vce.srbm_soft_reset;
-
- if (srbm_soft_reset) {
- u32 tmp;
-
- tmp = RREG32(mmSRBM_SOFT_RESET);
- tmp |= srbm_soft_reset;
- dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
- WREG32(mmSRBM_SOFT_RESET, tmp);
- tmp = RREG32(mmSRBM_SOFT_RESET);
-
- udelay(50);
-
- tmp &= ~srbm_soft_reset;
- WREG32(mmSRBM_SOFT_RESET, tmp);
- tmp = RREG32(mmSRBM_SOFT_RESET);
-
- /* Wait a little for things to settle down */
- udelay(50);
- }
-
- return 0;
-}
-
-static int vce_v4_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
-
- if (!adev->vce.srbm_soft_reset)
- return 0;
-
- mdelay(5);
-
- return vce_v4_0_suspend(adev);
-}
-
-
-static int vce_v4_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
-{
- struct amdgpu_device *adev = ip_block->adev;
-
- if (!adev->vce.srbm_soft_reset)
- return 0;
-
- mdelay(5);
-
- return vce_v4_0_resume(adev);
-}
-
-static void vce_v4_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override)
-{
- u32 tmp, data;
-
- tmp = data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL));
- if (override)
- data |= VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
- else
- data &= ~VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
-
- if (tmp != data)
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL), data);
-}
-
-static void vce_v4_0_set_vce_sw_clock_gating(struct amdgpu_device *adev,
- bool gated)
-{
- u32 data;
-
- /* Set Override to disable Clock Gating */
- vce_v4_0_override_vce_clock_gating(adev, true);
-
- /* This function enables MGCG which is controlled by firmware.
- With the clocks in the gated state the core is still
- accessible but the firmware will throttle the clocks on the
- fly as necessary.
- */
- if (gated) {
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
- data |= 0x1ff;
- data &= ~0xef0000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING));
- data |= 0x3ff000;
- data &= ~0xffc00000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2));
- data |= 0x2;
- data &= ~0x00010000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING));
- data |= 0x37f;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL));
- data |= VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
- VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
- VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
- 0x8;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL), data);
- } else {
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
- data &= ~0x80010;
- data |= 0xe70008;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING));
- data |= 0xffc00000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2));
- data |= 0x10000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING));
- data &= ~0xffc00000;
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING), data);
-
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL));
- data &= ~(VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
- VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
- VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
- 0x8);
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL), data);
- }
- vce_v4_0_override_vce_clock_gating(adev, false);
-}
-
-static void vce_v4_0_set_bypass_mode(struct amdgpu_device *adev, bool enable)
-{
- u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
-
- if (enable)
- tmp |= GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
- else
- tmp &= ~GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
-
- WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
-}
-
-static int vce_v4_0_set_clockgating_state(void *handle,
- enum amd_clockgating_state state)
-{
- struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- bool enable = (state == AMD_CG_STATE_GATE);
- int i;
-
- if ((adev->asic_type == CHIP_POLARIS10) ||
- (adev->asic_type == CHIP_TONGA) ||
- (adev->asic_type == CHIP_FIJI))
- vce_v4_0_set_bypass_mode(adev, enable);
-
- if (!(adev->cg_flags & AMD_CG_SUPPORT_VCE_MGCG))
- return 0;
-
- mutex_lock(&adev->grbm_idx_mutex);
- for (i = 0; i < 2; i++) {
- /* Program VCE Instance 0 or 1 if not harvested */
- if (adev->vce.harvest_config & (1 << i))
- continue;
-
- WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, i);
-
- if (enable) {
- /* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */
- uint32_t data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_A);
- data &= ~(0xf | 0xff0);
- data |= ((0x0 << 0) | (0x04 << 4));
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_A, data);
-
- /* initialize VCE_UENC_CLOCK_GATING: Clock ON/OFF delay */
- data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING);
- data &= ~(0xf | 0xff0);
- data |= ((0x0 << 0) | (0x04 << 4));
- WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING, data);
- }
-
- vce_v4_0_set_vce_sw_clock_gating(adev, enable);
- }
-
- WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
- mutex_unlock(&adev->grbm_idx_mutex);
-
- return 0;
-}
-#endif
-
static int vce_v4_0_set_powergating_state(void *handle,
enum amd_powergating_state state)
{
@@ -1076,19 +808,12 @@ static int vce_v4_0_process_interrupt(struct amdgpu_device *adev,
const struct amd_ip_funcs vce_v4_0_ip_funcs = {
.name = "vce_v4_0",
.early_init = vce_v4_0_early_init,
- .late_init = NULL,
.sw_init = vce_v4_0_sw_init,
.sw_fini = vce_v4_0_sw_fini,
.hw_init = vce_v4_0_hw_init,
.hw_fini = vce_v4_0_hw_fini,
.suspend = vce_v4_0_suspend,
.resume = vce_v4_0_resume,
- .is_idle = NULL /* vce_v4_0_is_idle */,
- .wait_for_idle = NULL /* vce_v4_0_wait_for_idle */,
- .check_soft_reset = NULL /* vce_v4_0_check_soft_reset */,
- .pre_soft_reset = NULL /* vce_v4_0_pre_soft_reset */,
- .soft_reset = NULL /* vce_v4_0_soft_reset */,
- .post_soft_reset = NULL /* vce_v4_0_post_soft_reset */,
.set_clockgating_state = vce_v4_0_set_clockgating_state,
.set_powergating_state = vce_v4_0_set_powergating_state,
};
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 129c759772c2..497b5d93a58b 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -1987,7 +1987,6 @@ static void vcn_v1_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
.name = "vcn_v1_0",
.early_init = vcn_v1_0_early_init,
- .late_init = NULL,
.sw_init = vcn_v1_0_sw_init,
.sw_fini = vcn_v1_0_sw_fini,
.hw_init = vcn_v1_0_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
index 19bbd49f760e..e0322cbca3ec 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
@@ -2095,7 +2095,6 @@ static void vcn_v2_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v2_0_ip_funcs = {
.name = "vcn_v2_0",
.early_init = vcn_v2_0_early_init,
- .late_init = NULL,
.sw_init = vcn_v2_0_sw_init,
.sw_fini = vcn_v2_0_sw_fini,
.hw_init = vcn_v2_0_hw_init,
@@ -2104,10 +2103,6 @@ static const struct amd_ip_funcs vcn_v2_0_ip_funcs = {
.resume = vcn_v2_0_resume,
.is_idle = vcn_v2_0_is_idle,
.wait_for_idle = vcn_v2_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v2_0_set_clockgating_state,
.set_powergating_state = vcn_v2_0_set_powergating_state,
.dump_ip_state = vcn_v2_0_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
index 30420ead7fc4..6aa08281d094 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
@@ -1987,7 +1987,6 @@ static void vcn_v2_5_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
.name = "vcn_v2_5",
.early_init = vcn_v2_5_early_init,
- .late_init = NULL,
.sw_init = vcn_v2_5_sw_init,
.sw_fini = vcn_v2_5_sw_fini,
.hw_init = vcn_v2_5_hw_init,
@@ -1996,10 +1995,6 @@ static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
.resume = vcn_v2_5_resume,
.is_idle = vcn_v2_5_is_idle,
.wait_for_idle = vcn_v2_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v2_5_set_clockgating_state,
.set_powergating_state = vcn_v2_5_set_powergating_state,
.dump_ip_state = vcn_v2_5_dump_ip_state,
@@ -2009,7 +2004,6 @@ static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
static const struct amd_ip_funcs vcn_v2_6_ip_funcs = {
.name = "vcn_v2_6",
.early_init = vcn_v2_5_early_init,
- .late_init = NULL,
.sw_init = vcn_v2_5_sw_init,
.sw_fini = vcn_v2_5_sw_fini,
.hw_init = vcn_v2_5_hw_init,
@@ -2018,10 +2012,6 @@ static const struct amd_ip_funcs vcn_v2_6_ip_funcs = {
.resume = vcn_v2_5_resume,
.is_idle = vcn_v2_5_is_idle,
.wait_for_idle = vcn_v2_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v2_5_set_clockgating_state,
.set_powergating_state = vcn_v2_5_set_powergating_state,
.dump_ip_state = vcn_v2_5_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
index 13632c22d2f9..6732ad7f16f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
@@ -2313,7 +2313,6 @@ static void vcn_v3_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v3_0_ip_funcs = {
.name = "vcn_v3_0",
.early_init = vcn_v3_0_early_init,
- .late_init = NULL,
.sw_init = vcn_v3_0_sw_init,
.sw_fini = vcn_v3_0_sw_fini,
.hw_init = vcn_v3_0_hw_init,
@@ -2322,10 +2321,6 @@ static const struct amd_ip_funcs vcn_v3_0_ip_funcs = {
.resume = vcn_v3_0_resume,
.is_idle = vcn_v3_0_is_idle,
.wait_for_idle = vcn_v3_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v3_0_set_clockgating_state,
.set_powergating_state = vcn_v3_0_set_powergating_state,
.dump_ip_state = vcn_v3_0_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index e7b7a8150ea7..5512259cac79 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -2220,7 +2220,6 @@ static void vcn_v4_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
.name = "vcn_v4_0",
.early_init = vcn_v4_0_early_init,
- .late_init = NULL,
.sw_init = vcn_v4_0_sw_init,
.sw_fini = vcn_v4_0_sw_fini,
.hw_init = vcn_v4_0_hw_init,
@@ -2229,10 +2228,6 @@ static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
.resume = vcn_v4_0_resume,
.is_idle = vcn_v4_0_is_idle,
.wait_for_idle = vcn_v4_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v4_0_set_clockgating_state,
.set_powergating_state = vcn_v4_0_set_powergating_state,
.dump_ip_state = vcn_v4_0_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index 6dcae398b2dc..0d5c94bfc0ef 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -1796,7 +1796,6 @@ static void vcn_v4_0_3_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v4_0_3_ip_funcs = {
.name = "vcn_v4_0_3",
.early_init = vcn_v4_0_3_early_init,
- .late_init = NULL,
.sw_init = vcn_v4_0_3_sw_init,
.sw_fini = vcn_v4_0_3_sw_fini,
.hw_init = vcn_v4_0_3_hw_init,
@@ -1805,10 +1804,6 @@ static const struct amd_ip_funcs vcn_v4_0_3_ip_funcs = {
.resume = vcn_v4_0_3_resume,
.is_idle = vcn_v4_0_3_is_idle,
.wait_for_idle = vcn_v4_0_3_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v4_0_3_set_clockgating_state,
.set_powergating_state = vcn_v4_0_3_set_powergating_state,
.dump_ip_state = vcn_v4_0_3_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
index edb9cd8390b6..71961fb3f7ff 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
@@ -1678,7 +1678,6 @@ static void vcn_v4_0_5_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v4_0_5_ip_funcs = {
.name = "vcn_v4_0_5",
.early_init = vcn_v4_0_5_early_init,
- .late_init = NULL,
.sw_init = vcn_v4_0_5_sw_init,
.sw_fini = vcn_v4_0_5_sw_fini,
.hw_init = vcn_v4_0_5_hw_init,
@@ -1687,10 +1686,6 @@ static const struct amd_ip_funcs vcn_v4_0_5_ip_funcs = {
.resume = vcn_v4_0_5_resume,
.is_idle = vcn_v4_0_5_is_idle,
.wait_for_idle = vcn_v4_0_5_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v4_0_5_set_clockgating_state,
.set_powergating_state = vcn_v4_0_5_set_powergating_state,
.dump_ip_state = vcn_v4_0_5_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
index 89bf29fa6f8d..fe2cc1a80c13 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
@@ -1404,7 +1404,6 @@ static void vcn_v5_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
static const struct amd_ip_funcs vcn_v5_0_0_ip_funcs = {
.name = "vcn_v5_0_0",
.early_init = vcn_v5_0_0_early_init,
- .late_init = NULL,
.sw_init = vcn_v5_0_0_sw_init,
.sw_fini = vcn_v5_0_0_sw_fini,
.hw_init = vcn_v5_0_0_hw_init,
@@ -1413,10 +1412,6 @@ static const struct amd_ip_funcs vcn_v5_0_0_ip_funcs = {
.resume = vcn_v5_0_0_resume,
.is_idle = vcn_v5_0_0_is_idle,
.wait_for_idle = vcn_v5_0_0_wait_for_idle,
- .check_soft_reset = NULL,
- .pre_soft_reset = NULL,
- .soft_reset = NULL,
- .post_soft_reset = NULL,
.set_clockgating_state = vcn_v5_0_0_set_clockgating_state,
.set_powergating_state = vcn_v5_0_0_set_powergating_state,
.dump_ip_state = vcn_v5_0_dump_ip_state,
diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
index 73de5909f655..0fedadd0a6a4 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
@@ -625,7 +625,6 @@ static int vega10_ih_set_powergating_state(void *handle,
const struct amd_ip_funcs vega10_ih_ip_funcs = {
.name = "vega10_ih",
.early_init = vega10_ih_early_init,
- .late_init = NULL,
.sw_init = vega10_ih_sw_init,
.sw_fini = vega10_ih_sw_fini,
.hw_init = vega10_ih_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
index a42404a58015..b7e3fb4628b2 100644
--- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
+++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
@@ -690,7 +690,6 @@ static int vega20_ih_set_powergating_state(void *handle,
const struct amd_ip_funcs vega20_ih_ip_funcs = {
.name = "vega20_ih",
.early_init = vega20_ih_early_init,
- .late_init = NULL,
.sw_init = vega20_ih_sw_init,
.sw_fini = vega20_ih_sw_fini,
.hw_init = vega20_ih_hw_init,
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 607b48a2d5eb..b3fa54c0514e 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -2036,8 +2036,6 @@ static const struct amd_ip_funcs vi_common_ip_funcs = {
.set_clockgating_state = vi_common_set_clockgating_state,
.set_powergating_state = vi_common_set_powergating_state,
.get_clockgating_state = vi_common_get_clockgating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
static const struct amdgpu_ip_block_version vi_common_ip_block =
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a4882b16ace2..5e9854f5d276 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -3407,8 +3407,6 @@ static const struct amd_ip_funcs amdgpu_dm_funcs = {
.soft_reset = dm_soft_reset,
.set_clockgating_state = dm_set_clockgating_state,
.set_powergating_state = dm_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version dm_ip_block = {
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index 785cb20e64b6..8908646ad620 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -3304,8 +3304,6 @@ static const struct amd_ip_funcs kv_dpm_ip_funcs = {
.is_idle = kv_dpm_is_idle,
.set_clockgating_state = kv_dpm_set_clockgating_state,
.set_powergating_state = kv_dpm_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version kv_smu_ip_block = {
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
index 7b0ded50251a..ee23a0f897c5 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
@@ -8046,8 +8046,6 @@ static const struct amd_ip_funcs si_dpm_ip_funcs = {
.wait_for_idle = si_dpm_wait_for_idle,
.set_clockgating_state = si_dpm_set_clockgating_state,
.set_powergating_state = si_dpm_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version si_smu_ip_block =
diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
index 5aadb6061c22..26624a716fc6 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
@@ -287,8 +287,6 @@ static const struct amd_ip_funcs pp_ip_funcs = {
.is_idle = pp_is_idle,
.set_clockgating_state = pp_set_clockgating_state,
.set_powergating_state = pp_set_powergating_state,
- .dump_ip_state = NULL,
- .print_ip_state = NULL,
};
const struct amdgpu_ip_block_version pp_smu_ip_block =
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index accc96a03bd9..277169c2f711 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -2580,10 +2580,6 @@ const struct amd_ip_funcs smu_ip_funcs = {
.late_fini = smu_late_fini,
.suspend = smu_suspend,
.resume = smu_resume,
- .is_idle = NULL,
- .check_soft_reset = NULL,
- .wait_for_idle = NULL,
- .soft_reset = NULL,
.set_clockgating_state = smu_set_clockgating_state,
.set_powergating_state = smu_set_powergating_state,
};
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (13 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs Sunil Khatri
@ 2024-10-17 10:06 ` Sunil Khatri
2024-10-17 12:20 ` Christian König
2024-10-17 12:23 ` [PATCH v4 00/15] validate/clean the functions of ip funcs Christian König
15 siblings, 1 reply; 31+ messages in thread
From: Sunil Khatri @ 2024-10-17 10:06 UTC (permalink / raw)
To: Alex Deucher, Christian König; +Cc: amd-gfx, Sunil Khatri
Validate the function pointer for get_clockgating_state
before making a function call.
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
---
drivers/gpu/drm/amd/amdgpu/nv.c | 9 ++++++---
drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++++--
drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ++++--
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 6b72169be8f8..40c720b32c59 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -1084,11 +1084,14 @@ static void nv_common_get_clockgating_state(void *handle, u64 *flags)
if (amdgpu_sriov_vf(adev))
*flags = 0;
- adev->nbio.funcs->get_clockgating_state(adev, flags);
+ if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
+ adev->nbio.funcs->get_clockgating_state(adev, flags);
- adev->hdp.funcs->get_clock_gating_state(adev, flags);
+ if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
+ adev->hdp.funcs->get_clock_gating_state(adev, flags);
- adev->smuio.funcs->get_clock_gating_state(adev, flags);
+ if (adev->smuio.funcs && adev->smuio.funcs->get_clock_gating_state)
+ adev->smuio.funcs->get_clock_gating_state(adev, flags);
}
static const struct amd_ip_funcs nv_common_ip_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 1c07ebdc0d1f..196286be35b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -975,9 +975,11 @@ static void soc21_common_get_clockgating_state(void *handle, u64 *flags)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- adev->nbio.funcs->get_clockgating_state(adev, flags);
+ if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
+ adev->nbio.funcs->get_clockgating_state(adev, flags);
- adev->hdp.funcs->get_clock_gating_state(adev, flags);
+ if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
+ adev->hdp.funcs->get_clock_gating_state(adev, flags);
}
static const struct amd_ip_funcs soc21_common_ip_funcs = {
diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
index 3af10ef4b793..f4278a0fa8f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc24.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
@@ -564,9 +564,11 @@ static void soc24_common_get_clockgating_state(void *handle, u64 *flags)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- adev->nbio.funcs->get_clockgating_state(adev, flags);
+ if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
+ adev->nbio.funcs->get_clockgating_state(adev, flags);
- adev->hdp.funcs->get_clock_gating_state(adev, flags);
+ if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
+ adev->hdp.funcs->get_clock_gating_state(adev, flags);
return;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 31+ messages in thread
* Re: [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call
2024-10-17 10:06 ` [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call Sunil Khatri
@ 2024-10-17 11:52 ` Christian König
2024-10-17 12:44 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 11:52 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Before making a function call to hw_fini, validate
> the function pointer like we do in sw_init.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 33 ++++++++++++++--------
> 1 file changed, 22 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index cf84b50f2355..96cecd4a636b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3287,11 +3287,17 @@ static void amdgpu_device_smu_fini_early(struct amdgpu_device *adev)
> if (!adev->ip_blocks[i].status.hw)
> continue;
> if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
> - r = adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
> - /* XXX handle errors */
> - if (r) {
> - DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> + if (!adev->ip_blocks[i].version->funcs->hw_fini) {
> + DRM_ERROR("hw_fini of IP block <%s> not defined\n",
> + adev->ip_blocks[i].version->funcs->name);
> + } else {
> + r = adev->ip_blocks[i].version->funcs->hw_fini(
> + &adev->ip_blocks[i]);
> + /* XXX handle errors */
> + if (r) {
> + DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + }
> }
> adev->ip_blocks[i].status.hw = false;
> break;
> @@ -3325,12 +3331,17 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
> for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
> if (!adev->ip_blocks[i].status.hw)
> continue;
> -
> - r = adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
> - /* XXX handle errors */
> - if (r) {
> - DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> + if (!adev->ip_blocks[i].version->funcs->hw_fini) {
> + DRM_ERROR("hw_fini of IP block <%s> not defined\n",
> + adev->ip_blocks[i].version->funcs->name);
> + } else {
> + r = adev->ip_blocks[i].version->funcs->hw_fini(
> + &adev->ip_blocks[i]);
> + /* XXX handle errors */
> + if (r) {
> + DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + }
I strongly suggest to make this a separate function, e.g. something like
amdgpu_ip_block_hw_fini() and then call it twice.
Regards,
Christian.
> }
>
> adev->ip_blocks[i].status.hw = false;
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 06/15] drm/amdgpu: validate suspend before function call
2024-10-17 10:06 ` [PATCH v4 06/15] drm/amdgpu: validate suspend " Sunil Khatri
@ 2024-10-17 11:54 ` Christian König
2024-10-17 12:45 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 11:54 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Before making a function call to suspend, validate
> the function pointer like we do in sw_init.
Same comment as on patch #5, please add an amdgpu_ip_block_suspend()
function and just call it multiple times.
Regards,
Christian.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 15 ++++++------
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 ++++++++++++---------
> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 ++++++----
> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 15 ++++++------
> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 15 ++++++------
> 5 files changed, 46 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> index c1ff24335a0c..e55d680d95ce 100644
> --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> @@ -85,13 +85,14 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
> AMD_IP_BLOCK_TYPE_SDMA))
> continue;
>
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> -
> - if (r) {
> - dev_err(adev->dev,
> - "suspend of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "suspend of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = false;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 96cecd4a636b..fda89aeb4d1b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -3478,12 +3478,14 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
> continue;
>
> /* XXX handle errors */
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> - /* XXX handle errors */
> - if (r) {
> - DRM_ERROR("suspend of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + /* XXX handle errors */
> + if (r) {
> + DRM_ERROR("suspend of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = false;
> @@ -3560,11 +3562,13 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
> continue;
>
> /* XXX handle errors */
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> - /* XXX handle errors */
> - if (r) {
> - DRM_ERROR("suspend of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + /* XXX handle errors */
> + if (r) {
> + DRM_ERROR("suspend of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + }
> }
> adev->ip_blocks[i].status.hw = false;
> /* handle putting the SMC in the appropriate state */
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> index 3e2724590dbf..6bc75aa1c3b1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
> @@ -40,11 +40,13 @@ static int amdgpu_reset_xgmi_reset_on_init_suspend(struct amdgpu_device *adev)
> continue;
>
> /* XXX handle errors */
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> - /* XXX handle errors */
> - if (r) {
> - dev_err(adev->dev, "suspend of IP block <%s> failed %d",
> - adev->ip_blocks[i].version->funcs->name, r);
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + /* XXX handle errors */
> + if (r) {
> + dev_err(adev->dev, "suspend of IP block <%s> failed %d",
> + adev->ip_blocks[i].version->funcs->name, r);
> + }
> }
> adev->ip_blocks[i].status.hw = false;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> index 475b7df3a908..10dece12509f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> @@ -81,13 +81,14 @@ static int sienna_cichlid_mode2_suspend_ip(struct amdgpu_device *adev)
> AMD_IP_BLOCK_TYPE_SDMA))
> continue;
>
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> -
> - if (r) {
> - dev_err(adev->dev,
> - "suspend of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "suspend of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
> adev->ip_blocks[i].status.hw = false;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> index 5ea9090b5040..ab049f0b4d39 100644
> --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> @@ -80,13 +80,14 @@ static int smu_v13_0_10_mode2_suspend_ip(struct amdgpu_device *adev)
> AMD_IP_BLOCK_TYPE_MES))
> continue;
>
> - r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> -
> - if (r) {
> - dev_err(adev->dev,
> - "suspend of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->suspend) {
> + r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "suspend of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
> adev->ip_blocks[i].status.hw = false;
> }
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 07/15] drm/amdgpu: validate resume before function call
2024-10-17 10:06 ` [PATCH v4 07/15] drm/amdgpu: validate resume " Sunil Khatri
@ 2024-10-17 11:55 ` Christian König
2024-10-17 12:46 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 11:55 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Same comment as patch #5, please add an amdgpu_ip_block_resume() function.
Regards,
Christian.
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Before making a function call to resume, validate
> the function pointer like we do in sw_init.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 23 ++++++----
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 ++++++++++++---------
> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 28 ++++++------
> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 14 +++---
> 4 files changed, 66 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> index e55d680d95ce..4dd9af51210d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
> @@ -247,9 +247,11 @@ static int aldebaran_mode2_restore_ip(struct amdgpu_device *adev)
> dev_err(adev->dev, "Failed to get BIF handle\n");
> return -EINVAL;
> }
> - r = cmn_block->version->funcs->resume(cmn_block);
> - if (r)
> - return r;
> + if (cmn_block->version->funcs->resume) {
> + r = cmn_block->version->funcs->resume(cmn_block);
> + if (r)
> + return r;
> + }
>
> /* Reinit GFXHUB */
> adev->gfxhub.funcs->init(adev);
> @@ -283,12 +285,15 @@ static int aldebaran_mode2_restore_ip(struct amdgpu_device *adev)
> adev->ip_blocks[i].version->type ==
> AMD_IP_BLOCK_TYPE_SDMA))
> continue;
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - dev_err(adev->dev,
> - "resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> +
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = true;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index fda89aeb4d1b..aa7314c14db8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -2744,11 +2744,15 @@ static int amdgpu_device_fw_loading(struct amdgpu_device *adev)
> break;
>
> if (amdgpu_in_reset(adev) || adev->in_suspend) {
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - DRM_ERROR("resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(
> + &adev->ip_blocks[i]);
> + if (r) {
> + DRM_ERROR("resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs
> + ->name, r);
> + return r;
> + }
> }
> } else {
> r = adev->ip_blocks[i].version->funcs->hw_init(&adev->ip_blocks[i]);
> @@ -3683,10 +3687,12 @@ static int amdgpu_device_ip_reinit_late_sriov(struct amdgpu_device *adev)
> block->status.hw)
> continue;
>
> - if (block->version->type == AMD_IP_BLOCK_TYPE_SMC)
> - r = block->version->funcs->resume(&adev->ip_blocks[i]);
> - else
> + if (block->version->type == AMD_IP_BLOCK_TYPE_SMC) {
> + if (adev->ip_blocks[i].version->funcs->resume)
> + r = block->version->funcs->resume(&adev->ip_blocks[i]);
> + } else {
> r = block->version->funcs->hw_init(&adev->ip_blocks[i]);
> + }
>
> DRM_INFO("RE-INIT-late: %s %s\n", block->version->funcs->name, r?"failed":"succeeded");
> if (r)
> @@ -3721,12 +3727,13 @@ static int amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
> adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC ||
> adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
> (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP && amdgpu_sriov_vf(adev))) {
> -
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - DRM_ERROR("resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + DRM_ERROR("resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
> adev->ip_blocks[i].status.hw = true;
> }
> @@ -3760,11 +3767,13 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
> adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH ||
> adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
> continue;
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - DRM_ERROR("resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + DRM_ERROR("resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
> adev->ip_blocks[i].status.hw = true;
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> index 10dece12509f..082a69babe62 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
> @@ -176,12 +176,14 @@ static int sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
>
> for (i = 0; i < adev->num_ip_blocks; i++) {
> if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_IH) {
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - dev_err(adev->dev,
> - "resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = true;
> @@ -194,12 +196,14 @@ static int sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
> adev->ip_blocks[i].version->type ==
> AMD_IP_BLOCK_TYPE_SDMA))
> continue;
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - dev_err(adev->dev,
> - "resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = true;
> diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> index ab049f0b4d39..2e041424ef9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
> @@ -187,12 +187,14 @@ static int smu_v13_0_10_mode2_restore_ip(struct amdgpu_device *adev)
> adev->ip_blocks[i].version->type ==
> AMD_IP_BLOCK_TYPE_SDMA))
> continue;
> - r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> - if (r) {
> - dev_err(adev->dev,
> - "resume of IP block <%s> failed %d\n",
> - adev->ip_blocks[i].version->funcs->name, r);
> - return r;
> + if (adev->ip_blocks[i].version->funcs->resume) {
> + r = adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
> + if (r) {
> + dev_err(adev->dev,
> + "resume of IP block <%s> failed %d\n",
> + adev->ip_blocks[i].version->funcs->name, r);
> + return r;
> + }
> }
>
> adev->ip_blocks[i].status.hw = true;
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions
2024-10-17 10:06 ` [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions Sunil Khatri
@ 2024-10-17 11:58 ` Christian König
2024-10-17 12:47 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 11:58 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Remove the dummy hw_fini functions for all
> ip blocks.
As discussed on the call hw_init() and hw_fini() are the only two
functions I consider mandatory.
So please drop this patch here and as a follow up task maybe look into
why vkms and mes_v12 don't have a hw_fini function.
For SI and CIK we probably don't care any more since those are to old.
Regards,
Christian.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 ------
> drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
> drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +----------
> drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
> 4 files changed, 1 insertion(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> index ed8015313827..e3a399bfab61 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> @@ -600,11 +600,6 @@ static int amdgpu_vkms_hw_init(struct amdgpu_ip_block *ip_block)
> return 0;
> }
>
> -static int amdgpu_vkms_hw_fini(struct amdgpu_ip_block *ip_block)
> -{
> - return 0;
> -}
> -
> static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
> {
> struct amdgpu_device *adev = ip_block->adev;
> @@ -661,7 +656,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
> .sw_init = amdgpu_vkms_sw_init,
> .sw_fini = amdgpu_vkms_sw_fini,
> .hw_init = amdgpu_vkms_hw_init,
> - .hw_fini = amdgpu_vkms_hw_fini,
> .suspend = amdgpu_vkms_suspend,
> .resume = amdgpu_vkms_resume,
> .is_idle = amdgpu_vkms_is_idle,
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> index c8fb592f13df..9cb25d0d1051 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> @@ -2138,11 +2138,6 @@ static int cik_common_hw_init(struct amdgpu_ip_block *ip_block)
> return 0;
> }
>
> -static int cik_common_hw_fini(struct amdgpu_ip_block *ip_block)
> -{
> - return 0;
> -}
> -
> static int cik_common_resume(struct amdgpu_ip_block *ip_block)
> {
> return cik_common_hw_init(ip_block);
> @@ -2181,7 +2176,6 @@ static const struct amd_ip_funcs cik_common_ip_funcs = {
> .early_init = cik_common_early_init,
> .late_init = NULL,
> .hw_init = cik_common_hw_init,
> - .hw_fini = cik_common_hw_fini,
> .resume = cik_common_resume,
> .is_idle = cik_common_is_idle,
> .wait_for_idle = cik_common_wait_for_idle,
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> index 9d0e342a2f81..a1af5c90f79a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
> @@ -40,7 +40,6 @@ MODULE_FIRMWARE("amdgpu/gc_12_0_1_mes1.bin");
> MODULE_FIRMWARE("amdgpu/gc_12_0_1_uni_mes.bin");
>
> static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block);
> -static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block);
> static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev);
> static int mes_v12_0_kiq_hw_fini(struct amdgpu_device *adev);
>
> @@ -1516,7 +1515,6 @@ static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev)
> return r;
>
> failure:
> - mes_v12_0_hw_fini(ip_block);
> return r;
> }
>
> @@ -1600,15 +1598,9 @@ static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block)
> return 0;
>
> failure:
> - mes_v12_0_hw_fini(ip_block);
> return r;
> }
>
> -static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block)
> -{
> - return 0;
> -}
> -
> static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
> {
> int r;
> @@ -1617,7 +1609,7 @@ static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
> if (r)
> return r;
>
> - return mes_v12_0_hw_fini(ip_block);
> + return 0;
> }
>
> static int mes_v12_0_resume(struct amdgpu_ip_block *ip_block)
> @@ -1663,7 +1655,6 @@ static const struct amd_ip_funcs mes_v12_0_ip_funcs = {
> .sw_init = mes_v12_0_sw_init,
> .sw_fini = mes_v12_0_sw_fini,
> .hw_init = mes_v12_0_hw_init,
> - .hw_fini = mes_v12_0_hw_fini,
> .suspend = mes_v12_0_suspend,
> .resume = mes_v12_0_resume,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
> index 66ccb76eb72a..e1b3bef6992a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
> @@ -2634,11 +2634,6 @@ static int si_common_hw_init(struct amdgpu_ip_block *ip_block)
> return 0;
> }
>
> -static int si_common_hw_fini(struct amdgpu_ip_block *ip_block)
> -{
> - return 0;
> -}
> -
> static int si_common_resume(struct amdgpu_ip_block *ip_block)
> {
> return si_common_hw_init(ip_block);
> @@ -2676,7 +2671,6 @@ static const struct amd_ip_funcs si_common_ip_funcs = {
> .early_init = si_common_early_init,
> .late_init = NULL,
> .hw_init = si_common_hw_init,
> - .hw_fini = si_common_hw_fini,
> .resume = si_common_resume,
> .is_idle = si_common_is_idle,
> .wait_for_idle = si_common_wait_for_idle,
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs
2024-10-17 10:06 ` [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs Sunil Khatri
@ 2024-10-17 12:18 ` Christian König
2024-10-17 12:49 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 12:18 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Remove the unused and commented out code for vcn/uvd IP's.
> Also remove the functions which are set to NULL as these are
> global structures and all members are set to 0 or NULL during
> initialization.
Please separate that into two patches, one for the vcn/uvd stuff and one
for the rest.
Leo needs to take a look at the VCN/UVD stuff, but I think it is ok to
remove that.
Regards,
Christian.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 1 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
> drivers/gpu/drm/amd/amdgpu/cik.c | 3 -
> drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
> drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/nv.c | 2 -
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/si.c | 3 -
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
> drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/soc15.c | 2 -
> drivers/gpu/drm/amd/amdgpu/soc21.c | 2 -
> drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
> drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
> drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vi.c | 2 -
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
> drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 2 -
> drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 2 -
> .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 2 -
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
> 70 files changed, 790 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> index 8b7e056a7355..ec5e0dcf8613 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
> @@ -603,8 +603,6 @@ static int acp_set_powergating_state(void *handle,
>
> static const struct amd_ip_funcs acp_ip_funcs = {
> .name = "acp_ip",
> - .early_init = NULL,
> - .late_init = NULL,
> .sw_init = acp_sw_init,
> .sw_fini = acp_sw_fini,
> .hw_init = acp_hw_init,
> @@ -614,8 +612,6 @@ static const struct amd_ip_funcs acp_ip_funcs = {
> .is_idle = acp_is_idle,
> .set_clockgating_state = acp_set_clockgating_state,
> .set_powergating_state = acp_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version acp_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
> index acc8a4b2732b..b6e4a8226832 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
> @@ -143,7 +143,6 @@ static int isp_set_powergating_state(void *handle,
> static const struct amd_ip_funcs isp_ip_funcs = {
> .name = "isp_ip",
> .early_init = isp_early_init,
> - .late_init = NULL,
> .hw_init = isp_hw_init,
> .hw_fini = isp_hw_fini,
> .is_idle = isp_is_idle,
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> index cad153e333d8..abd5e980c9c7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
> @@ -4095,17 +4095,12 @@ const struct attribute_group amdgpu_flash_attr_group = {
> const struct amd_ip_funcs psp_ip_funcs = {
> .name = "psp",
> .early_init = psp_early_init,
> - .late_init = NULL,
> .sw_init = psp_sw_init,
> .sw_fini = psp_sw_fini,
> .hw_init = psp_hw_init,
> .hw_fini = psp_hw_fini,
> .suspend = psp_suspend,
> .resume = psp_resume,
> - .is_idle = NULL,
> - .check_soft_reset = NULL,
> - .wait_for_idle = NULL,
> - .soft_reset = NULL,
> .set_clockgating_state = psp_set_clockgating_state,
> .set_powergating_state = psp_set_powergating_state,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
> index 3ef75f1a47f6..bd2d3863c3ed 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
> @@ -993,8 +993,6 @@ static const struct amd_ip_funcs umsch_mm_v4_0_ip_funcs = {
> .hw_fini = umsch_mm_hw_fini,
> .suspend = umsch_mm_suspend,
> .resume = umsch_mm_resume,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version umsch_mm_v4_0_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> index 6850a27f724f..52e01e09a1b3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
> @@ -641,8 +641,6 @@ static int amdgpu_vkms_set_powergating_state(void *handle,
>
> static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
> .name = "amdgpu_vkms",
> - .early_init = NULL,
> - .late_init = NULL,
> .sw_init = amdgpu_vkms_sw_init,
> .sw_fini = amdgpu_vkms_sw_fini,
> .hw_init = amdgpu_vkms_hw_init,
> @@ -651,8 +649,6 @@ static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
> .is_idle = amdgpu_vkms_is_idle,
> .set_clockgating_state = amdgpu_vkms_set_clockgating_state,
> .set_powergating_state = amdgpu_vkms_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version amdgpu_vkms_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> index 6d96e1f21e20..46713a158d90 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
> @@ -906,14 +906,12 @@ static void vpe_set_ring_funcs(struct amdgpu_device *adev)
> const struct amd_ip_funcs vpe_ip_funcs = {
> .name = "vpe_v6_1",
> .early_init = vpe_early_init,
> - .late_init = NULL,
> .sw_init = vpe_sw_init,
> .sw_fini = vpe_sw_fini,
> .hw_init = vpe_hw_init,
> .hw_fini = vpe_hw_fini,
> .suspend = vpe_suspend,
> .resume = vpe_resume,
> - .soft_reset = NULL,
> .set_clockgating_state = vpe_set_clockgating_state,
> .set_powergating_state = vpe_set_powergating_state,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
> index d7a843280059..23b712fda53d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
> @@ -2171,15 +2171,12 @@ static int cik_common_set_powergating_state(void *handle,
> static const struct amd_ip_funcs cik_common_ip_funcs = {
> .name = "cik_common",
> .early_init = cik_common_early_init,
> - .late_init = NULL,
> .hw_init = cik_common_hw_init,
> .resume = cik_common_resume,
> .is_idle = cik_common_is_idle,
> .soft_reset = cik_common_soft_reset,
> .set_clockgating_state = cik_common_set_clockgating_state,
> .set_powergating_state = cik_common_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ip_block_version cik_common_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> index 9e9a58fd86ce..1da17755ad53 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
> @@ -417,7 +417,6 @@ static int cik_ih_set_powergating_state(void *handle,
> static const struct amd_ip_funcs cik_ih_ip_funcs = {
> .name = "cik_ih",
> .early_init = cik_ih_early_init,
> - .late_init = NULL,
> .sw_init = cik_ih_sw_init,
> .sw_fini = cik_ih_sw_fini,
> .hw_init = cik_ih_hw_init,
> @@ -429,8 +428,6 @@ static const struct amd_ip_funcs cik_ih_ip_funcs = {
> .soft_reset = cik_ih_soft_reset,
> .set_clockgating_state = cik_ih_set_clockgating_state,
> .set_powergating_state = cik_ih_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs cik_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> index df3f429e003e..ede1a028d48d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
> @@ -1213,7 +1213,6 @@ static int cik_sdma_set_powergating_state(void *handle,
> static const struct amd_ip_funcs cik_sdma_ip_funcs = {
> .name = "cik_sdma",
> .early_init = cik_sdma_early_init,
> - .late_init = NULL,
> .sw_init = cik_sdma_sw_init,
> .sw_fini = cik_sdma_sw_fini,
> .hw_init = cik_sdma_hw_init,
> @@ -1225,8 +1224,6 @@ static const struct amd_ip_funcs cik_sdma_ip_funcs = {
> .soft_reset = cik_sdma_soft_reset,
> .set_clockgating_state = cik_sdma_set_clockgating_state,
> .set_powergating_state = cik_sdma_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> index cadd69a243af..d72973bd570d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
> @@ -415,7 +415,6 @@ static int cz_ih_set_powergating_state(void *handle,
> static const struct amd_ip_funcs cz_ih_ip_funcs = {
> .name = "cz_ih",
> .early_init = cz_ih_early_init,
> - .late_init = NULL,
> .sw_init = cz_ih_sw_init,
> .sw_fini = cz_ih_sw_fini,
> .hw_init = cz_ih_hw_init,
> @@ -427,8 +426,6 @@ static const struct amd_ip_funcs cz_ih_ip_funcs = {
> .soft_reset = cz_ih_soft_reset,
> .set_clockgating_state = cz_ih_set_clockgating_state,
> .set_powergating_state = cz_ih_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs cz_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> index a5985663a867..5098c50d54c8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
> @@ -3317,7 +3317,6 @@ static int dce_v10_0_set_powergating_state(void *handle,
> static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
> .name = "dce_v10_0",
> .early_init = dce_v10_0_early_init,
> - .late_init = NULL,
> .sw_init = dce_v10_0_sw_init,
> .sw_fini = dce_v10_0_sw_fini,
> .hw_init = dce_v10_0_hw_init,
> @@ -3329,8 +3328,6 @@ static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
> .soft_reset = dce_v10_0_soft_reset,
> .set_clockgating_state = dce_v10_0_set_clockgating_state,
> .set_powergating_state = dce_v10_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static void
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> index 5c907a1a4778..c5680ff4ab9f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
> @@ -3449,7 +3449,6 @@ static int dce_v11_0_set_powergating_state(void *handle,
> static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
> .name = "dce_v11_0",
> .early_init = dce_v11_0_early_init,
> - .late_init = NULL,
> .sw_init = dce_v11_0_sw_init,
> .sw_fini = dce_v11_0_sw_fini,
> .hw_init = dce_v11_0_hw_init,
> @@ -3460,8 +3459,6 @@ static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
> .soft_reset = dce_v11_0_soft_reset,
> .set_clockgating_state = dce_v11_0_set_clockgating_state,
> .set_powergating_state = dce_v11_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static void
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> index a53e4fac89dc..eb7de9122d99 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
> @@ -3139,7 +3139,6 @@ static int dce_v6_0_set_powergating_state(void *handle,
> static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
> .name = "dce_v6_0",
> .early_init = dce_v6_0_early_init,
> - .late_init = NULL,
> .sw_init = dce_v6_0_sw_init,
> .sw_fini = dce_v6_0_sw_fini,
> .hw_init = dce_v6_0_hw_init,
> @@ -3150,8 +3149,6 @@ static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
> .soft_reset = dce_v6_0_soft_reset,
> .set_clockgating_state = dce_v6_0_set_clockgating_state,
> .set_powergating_state = dce_v6_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static void
> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> index 9278e0d8d00c..04b79ff87f75 100644
> --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
> @@ -3227,7 +3227,6 @@ static int dce_v8_0_set_powergating_state(void *handle,
> static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
> .name = "dce_v8_0",
> .early_init = dce_v8_0_early_init,
> - .late_init = NULL,
> .sw_init = dce_v8_0_sw_init,
> .sw_fini = dce_v8_0_sw_fini,
> .hw_init = dce_v8_0_hw_init,
> @@ -3238,8 +3237,6 @@ static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
> .soft_reset = dce_v8_0_soft_reset,
> .set_clockgating_state = dce_v8_0_set_clockgating_state,
> .set_powergating_state = dce_v8_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static void
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> index 5769055909bc..41f50bf380c4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
> @@ -3435,7 +3435,6 @@ static void gfx_v6_0_emit_mem_sync(struct amdgpu_ring *ring)
> static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
> .name = "gfx_v6_0",
> .early_init = gfx_v6_0_early_init,
> - .late_init = NULL,
> .sw_init = gfx_v6_0_sw_init,
> .sw_fini = gfx_v6_0_sw_fini,
> .hw_init = gfx_v6_0_hw_init,
> @@ -3446,8 +3445,6 @@ static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
> .wait_for_idle = gfx_v6_0_wait_for_idle,
> .set_clockgating_state = gfx_v6_0_set_clockgating_state,
> .set_powergating_state = gfx_v6_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_gfx = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> index a683d2bfb8de..824d5913103b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> @@ -5005,8 +5005,6 @@ static const struct amd_ip_funcs gfx_v7_0_ip_funcs = {
> .soft_reset = gfx_v7_0_soft_reset,
> .set_clockgating_state = gfx_v7_0_set_clockgating_state,
> .set_powergating_state = gfx_v7_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> index 8b72463fd5c0..480c41ee947e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -6948,8 +6948,6 @@ static const struct amd_ip_funcs gfx_v8_0_ip_funcs = {
> .set_clockgating_state = gfx_v8_0_set_clockgating_state,
> .set_powergating_state = gfx_v8_0_set_powergating_state,
> .get_clockgating_state = gfx_v8_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> index c1e2f1d79e74..ca000b3d1afc 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
> @@ -1121,8 +1121,6 @@ static const struct amd_ip_funcs gmc_v6_0_ip_funcs = {
> .soft_reset = gmc_v6_0_soft_reset,
> .set_clockgating_state = gmc_v6_0_set_clockgating_state,
> .set_powergating_state = gmc_v6_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_gmc_funcs gmc_v6_0_gmc_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> index 54a48662f3b5..07f45f1a503a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
> @@ -1348,8 +1348,6 @@ static const struct amd_ip_funcs gmc_v7_0_ip_funcs = {
> .soft_reset = gmc_v7_0_soft_reset,
> .set_clockgating_state = gmc_v7_0_set_clockgating_state,
> .set_powergating_state = gmc_v7_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_gmc_funcs gmc_v7_0_gmc_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index c4f2ad32c078..12d5967ecd45 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -1722,8 +1722,6 @@ static const struct amd_ip_funcs gmc_v8_0_ip_funcs = {
> .set_clockgating_state = gmc_v8_0_set_clockgating_state,
> .set_powergating_state = gmc_v8_0_set_powergating_state,
> .get_clockgating_state = gmc_v8_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_gmc_funcs gmc_v8_0_gmc_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> index a3fb01f905d4..7f45e93c0397 100644
> --- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
> @@ -407,7 +407,6 @@ static int iceland_ih_set_powergating_state(void *handle,
> static const struct amd_ip_funcs iceland_ih_ip_funcs = {
> .name = "iceland_ih",
> .early_init = iceland_ih_early_init,
> - .late_init = NULL,
> .sw_init = iceland_ih_sw_init,
> .sw_fini = iceland_ih_sw_fini,
> .hw_init = iceland_ih_hw_init,
> @@ -419,8 +418,6 @@ static const struct amd_ip_funcs iceland_ih_ip_funcs = {
> .soft_reset = iceland_ih_soft_reset,
> .set_clockgating_state = iceland_ih_set_clockgating_state,
> .set_powergating_state = iceland_ih_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs iceland_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
> index 09403eac483b..38f953fd65d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
> @@ -779,7 +779,6 @@ static void ih_v6_0_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
> .name = "ih_v6_0",
> .early_init = ih_v6_0_early_init,
> - .late_init = NULL,
> .sw_init = ih_v6_0_sw_init,
> .sw_fini = ih_v6_0_sw_fini,
> .hw_init = ih_v6_0_hw_init,
> @@ -792,8 +791,6 @@ static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
> .set_clockgating_state = ih_v6_0_set_clockgating_state,
> .set_powergating_state = ih_v6_0_set_powergating_state,
> .get_clockgating_state = ih_v6_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs ih_v6_0_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
> index 9706d7593d26..61381e0c3795 100644
> --- a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
> @@ -762,7 +762,6 @@ static void ih_v6_1_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs ih_v6_1_ip_funcs = {
> .name = "ih_v6_1",
> .early_init = ih_v6_1_early_init,
> - .late_init = NULL,
> .sw_init = ih_v6_1_sw_init,
> .sw_fini = ih_v6_1_sw_fini,
> .hw_init = ih_v6_1_hw_init,
> @@ -775,8 +774,6 @@ static const struct amd_ip_funcs ih_v6_1_ip_funcs = {
> .set_clockgating_state = ih_v6_1_set_clockgating_state,
> .set_powergating_state = ih_v6_1_set_powergating_state,
> .get_clockgating_state = ih_v6_1_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs ih_v6_1_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> index 9657145d7cce..d2428cf5d385 100644
> --- a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> @@ -752,7 +752,6 @@ static void ih_v7_0_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs ih_v7_0_ip_funcs = {
> .name = "ih_v7_0",
> .early_init = ih_v7_0_early_init,
> - .late_init = NULL,
> .sw_init = ih_v7_0_sw_init,
> .sw_fini = ih_v7_0_sw_fini,
> .hw_init = ih_v7_0_hw_init,
> @@ -765,8 +764,6 @@ static const struct amd_ip_funcs ih_v7_0_ip_funcs = {
> .set_clockgating_state = ih_v7_0_set_clockgating_state,
> .set_powergating_state = ih_v7_0_set_powergating_state,
> .get_clockgating_state = ih_v7_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs ih_v7_0_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> index 6762b5c64ccb..d6823fb45d32 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
> @@ -742,7 +742,6 @@ static int jpeg_v2_0_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = {
> .name = "jpeg_v2_0",
> .early_init = jpeg_v2_0_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v2_0_sw_init,
> .sw_fini = jpeg_v2_0_sw_fini,
> .hw_init = jpeg_v2_0_hw_init,
> @@ -751,14 +750,8 @@ static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = {
> .resume = jpeg_v2_0_resume,
> .is_idle = jpeg_v2_0_is_idle,
> .wait_for_idle = jpeg_v2_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v2_0_set_clockgating_state,
> .set_powergating_state = jpeg_v2_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v2_0_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> index 4b8c801f204d..5063a38801d6 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
> @@ -613,7 +613,6 @@ static int jpeg_v2_5_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v2_5_ip_funcs = {
> .name = "jpeg_v2_5",
> .early_init = jpeg_v2_5_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v2_5_sw_init,
> .sw_fini = jpeg_v2_5_sw_fini,
> .hw_init = jpeg_v2_5_hw_init,
> @@ -622,20 +621,13 @@ static const struct amd_ip_funcs jpeg_v2_5_ip_funcs = {
> .resume = jpeg_v2_5_resume,
> .is_idle = jpeg_v2_5_is_idle,
> .wait_for_idle = jpeg_v2_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v2_5_set_clockgating_state,
> .set_powergating_state = jpeg_v2_5_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = {
> .name = "jpeg_v2_6",
> .early_init = jpeg_v2_5_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v2_5_sw_init,
> .sw_fini = jpeg_v2_5_sw_fini,
> .hw_init = jpeg_v2_5_hw_init,
> @@ -644,14 +636,8 @@ static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = {
> .resume = jpeg_v2_5_resume,
> .is_idle = jpeg_v2_5_is_idle,
> .wait_for_idle = jpeg_v2_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v2_5_set_clockgating_state,
> .set_powergating_state = jpeg_v2_5_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v2_5_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> index 7996209818b6..10adbb7cbf53 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
> @@ -533,7 +533,6 @@ static int jpeg_v3_0_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = {
> .name = "jpeg_v3_0",
> .early_init = jpeg_v3_0_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v3_0_sw_init,
> .sw_fini = jpeg_v3_0_sw_fini,
> .hw_init = jpeg_v3_0_hw_init,
> @@ -542,14 +541,8 @@ static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = {
> .resume = jpeg_v3_0_resume,
> .is_idle = jpeg_v3_0_is_idle,
> .wait_for_idle = jpeg_v3_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v3_0_set_clockgating_state,
> .set_powergating_state = jpeg_v3_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v3_0_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> index 20e1fe89c463..89953c0f5f1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
> @@ -700,7 +700,6 @@ static int jpeg_v4_0_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
> .name = "jpeg_v4_0",
> .early_init = jpeg_v4_0_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v4_0_sw_init,
> .sw_fini = jpeg_v4_0_sw_fini,
> .hw_init = jpeg_v4_0_hw_init,
> @@ -709,14 +708,8 @@ static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
> .resume = jpeg_v4_0_resume,
> .is_idle = jpeg_v4_0_is_idle,
> .wait_for_idle = jpeg_v4_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v4_0_set_clockgating_state,
> .set_powergating_state = jpeg_v4_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v4_0_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> index 2a53537db135..6917e4a8e96a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
> @@ -1050,7 +1050,6 @@ static int jpeg_v4_0_3_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = {
> .name = "jpeg_v4_0_3",
> .early_init = jpeg_v4_0_3_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v4_0_3_sw_init,
> .sw_fini = jpeg_v4_0_3_sw_fini,
> .hw_init = jpeg_v4_0_3_hw_init,
> @@ -1059,14 +1058,8 @@ static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = {
> .resume = jpeg_v4_0_3_resume,
> .is_idle = jpeg_v4_0_3_is_idle,
> .wait_for_idle = jpeg_v4_0_3_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v4_0_3_set_clockgating_state,
> .set_powergating_state = jpeg_v4_0_3_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v4_0_3_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> index ef2d4237925b..f3cce523f3cb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
> @@ -741,7 +741,6 @@ static int jpeg_v4_0_5_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
> .name = "jpeg_v4_0_5",
> .early_init = jpeg_v4_0_5_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v4_0_5_sw_init,
> .sw_fini = jpeg_v4_0_5_sw_fini,
> .hw_init = jpeg_v4_0_5_hw_init,
> @@ -750,14 +749,8 @@ static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
> .resume = jpeg_v4_0_5_resume,
> .is_idle = jpeg_v4_0_5_is_idle,
> .wait_for_idle = jpeg_v4_0_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v4_0_5_set_clockgating_state,
> .set_powergating_state = jpeg_v4_0_5_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v4_0_5_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
> index 7954a6fae464..06840d1dae79 100644
> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
> @@ -620,7 +620,6 @@ static int jpeg_v5_0_0_process_interrupt(struct amdgpu_device *adev,
> static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = {
> .name = "jpeg_v5_0_0",
> .early_init = jpeg_v5_0_0_early_init,
> - .late_init = NULL,
> .sw_init = jpeg_v5_0_0_sw_init,
> .sw_fini = jpeg_v5_0_0_sw_fini,
> .hw_init = jpeg_v5_0_0_hw_init,
> @@ -629,14 +628,8 @@ static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = {
> .resume = jpeg_v5_0_0_resume,
> .is_idle = jpeg_v5_0_0_is_idle,
> .wait_for_idle = jpeg_v5_0_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = jpeg_v5_0_0_set_clockgating_state,
> .set_powergating_state = jpeg_v5_0_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs jpeg_v5_0_0_dec_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> index 2edfe86a866b..8ca137313961 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
> @@ -1707,8 +1707,6 @@ static const struct amd_ip_funcs mes_v11_0_ip_funcs = {
> .hw_fini = mes_v11_0_hw_fini,
> .suspend = mes_v11_0_suspend,
> .resume = mes_v11_0_resume,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version mes_v11_0_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> index 93da900b7ee2..0820ed62e2e8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
> @@ -694,7 +694,6 @@ static void navi10_ih_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs navi10_ih_ip_funcs = {
> .name = "navi10_ih",
> .early_init = navi10_ih_early_init,
> - .late_init = NULL,
> .sw_init = navi10_ih_sw_init,
> .sw_fini = navi10_ih_sw_fini,
> .hw_init = navi10_ih_hw_init,
> @@ -707,8 +706,6 @@ static const struct amd_ip_funcs navi10_ih_ip_funcs = {
> .set_clockgating_state = navi10_ih_set_clockgating_state,
> .set_powergating_state = navi10_ih_set_powergating_state,
> .get_clockgating_state = navi10_ih_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs navi10_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index c16f724384cd..6b72169be8f8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -1104,6 +1104,4 @@ static const struct amd_ip_funcs nv_common_ip_funcs = {
> .set_clockgating_state = nv_common_set_clockgating_state,
> .set_powergating_state = nv_common_set_powergating_state,
> .get_clockgating_state = nv_common_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> index 10fd772cb80f..7948d74f8722 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
> @@ -1096,7 +1096,6 @@ static int sdma_v2_4_set_powergating_state(void *handle,
> static const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
> .name = "sdma_v2_4",
> .early_init = sdma_v2_4_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v2_4_sw_init,
> .sw_fini = sdma_v2_4_sw_fini,
> .hw_init = sdma_v2_4_hw_init,
> @@ -1108,8 +1107,6 @@ static const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
> .soft_reset = sdma_v2_4_soft_reset,
> .set_clockgating_state = sdma_v2_4_set_clockgating_state,
> .set_powergating_state = sdma_v2_4_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> index 69fba087e09c..9a3d729545a7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
> @@ -1534,7 +1534,6 @@ static void sdma_v3_0_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
> .name = "sdma_v3_0",
> .early_init = sdma_v3_0_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v3_0_sw_init,
> .sw_fini = sdma_v3_0_sw_fini,
> .hw_init = sdma_v3_0_hw_init,
> @@ -1550,8 +1549,6 @@ static const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
> .set_clockgating_state = sdma_v3_0_set_clockgating_state,
> .set_powergating_state = sdma_v3_0_set_powergating_state,
> .get_clockgating_state = sdma_v3_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> index 6a675daf5620..d31c4860933f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
> @@ -1929,7 +1929,6 @@ static void sdma_v5_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs sdma_v5_0_ip_funcs = {
> .name = "sdma_v5_0",
> .early_init = sdma_v5_0_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v5_0_sw_init,
> .sw_fini = sdma_v5_0_sw_fini,
> .hw_init = sdma_v5_0_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> index e1413ccaf7e4..ffa8c62ac101 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
> @@ -1918,7 +1918,6 @@ static void sdma_v5_2_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs sdma_v5_2_ip_funcs = {
> .name = "sdma_v5_2",
> .early_init = sdma_v5_2_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v5_2_sw_init,
> .sw_fini = sdma_v5_2_sw_fini,
> .hw_init = sdma_v5_2_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> index 4856a093e23f..449d515e6b67 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
> @@ -1649,7 +1649,6 @@ static void sdma_v6_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> const struct amd_ip_funcs sdma_v6_0_ip_funcs = {
> .name = "sdma_v6_0",
> .early_init = sdma_v6_0_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v6_0_sw_init,
> .sw_fini = sdma_v6_0_sw_fini,
> .hw_init = sdma_v6_0_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> index 24f24974ac1d..dfd4b08e4b47 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
> @@ -1579,7 +1579,6 @@ static void sdma_v7_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> const struct amd_ip_funcs sdma_v7_0_ip_funcs = {
> .name = "sdma_v7_0",
> .early_init = sdma_v7_0_early_init,
> - .late_init = NULL,
> .sw_init = sdma_v7_0_sw_init,
> .sw_fini = sdma_v7_0_sw_fini,
> .hw_init = sdma_v7_0_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
> index 6d8d5547d18b..82d6f5aabb1d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
> @@ -2659,14 +2659,11 @@ static int si_common_set_powergating_state(void *handle,
> static const struct amd_ip_funcs si_common_ip_funcs = {
> .name = "si_common",
> .early_init = si_common_early_init,
> - .late_init = NULL,
> .hw_init = si_common_hw_init,
> .resume = si_common_resume,
> .is_idle = si_common_is_idle,
> .set_clockgating_state = si_common_set_clockgating_state,
> .set_powergating_state = si_common_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ip_block_version si_common_ip_block =
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> index d44483ed3363..47647a6083e8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
> @@ -691,7 +691,6 @@ static int si_dma_set_powergating_state(void *handle,
> static const struct amd_ip_funcs si_dma_ip_funcs = {
> .name = "si_dma",
> .early_init = si_dma_early_init,
> - .late_init = NULL,
> .sw_init = si_dma_sw_init,
> .sw_fini = si_dma_sw_fini,
> .hw_init = si_dma_hw_init,
> @@ -703,8 +702,6 @@ static const struct amd_ip_funcs si_dma_ip_funcs = {
> .soft_reset = si_dma_soft_reset,
> .set_clockgating_state = si_dma_set_clockgating_state,
> .set_powergating_state = si_dma_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs si_dma_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c b/drivers/gpu/drm/amd/amdgpu/si_ih.c
> index b018a3b90401..2ec1ebe4db11 100644
> --- a/drivers/gpu/drm/amd/amdgpu/si_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c
> @@ -278,7 +278,6 @@ static int si_ih_set_powergating_state(void *handle,
> static const struct amd_ip_funcs si_ih_ip_funcs = {
> .name = "si_ih",
> .early_init = si_ih_early_init,
> - .late_init = NULL,
> .sw_init = si_ih_sw_init,
> .sw_fini = si_ih_sw_fini,
> .hw_init = si_ih_hw_init,
> @@ -290,8 +289,6 @@ static const struct amd_ip_funcs si_ih_ip_funcs = {
> .soft_reset = si_ih_soft_reset,
> .set_clockgating_state = si_ih_set_clockgating_state,
> .set_powergating_state = si_ih_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs si_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 19391cbc1474..93e44e7ee3fa 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -1494,6 +1494,4 @@ static const struct amd_ip_funcs soc15_common_ip_funcs = {
> .set_clockgating_state = soc15_common_set_clockgating_state,
> .set_powergating_state = soc15_common_set_powergating_state,
> .get_clockgating_state= soc15_common_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
> index 078f25b5f09b..1c07ebdc0d1f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
> @@ -993,6 +993,4 @@ static const struct amd_ip_funcs soc21_common_ip_funcs = {
> .set_clockgating_state = soc21_common_set_clockgating_state,
> .set_powergating_state = soc21_common_set_powergating_state,
> .get_clockgating_state = soc21_common_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> index 45fb5140c8b7..5a04a6770138 100644
> --- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
> @@ -463,7 +463,6 @@ static int tonga_ih_set_powergating_state(void *handle,
> static const struct amd_ip_funcs tonga_ih_ip_funcs = {
> .name = "tonga_ih",
> .early_init = tonga_ih_early_init,
> - .late_init = NULL,
> .sw_init = tonga_ih_sw_init,
> .sw_fini = tonga_ih_sw_fini,
> .hw_init = tonga_ih_hw_init,
> @@ -478,8 +477,6 @@ static const struct amd_ip_funcs tonga_ih_ip_funcs = {
> .post_soft_reset = tonga_ih_post_soft_reset,
> .set_clockgating_state = tonga_ih_set_clockgating_state,
> .set_powergating_state = tonga_ih_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ih_funcs tonga_ih_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> index 3011b5853fb4..bdbca25d80c4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> @@ -805,7 +805,6 @@ static int uvd_v3_1_set_powergating_state(void *handle,
> static const struct amd_ip_funcs uvd_v3_1_ip_funcs = {
> .name = "uvd_v3_1",
> .early_init = uvd_v3_1_early_init,
> - .late_init = NULL,
> .sw_init = uvd_v3_1_sw_init,
> .sw_fini = uvd_v3_1_sw_fini,
> .hw_init = uvd_v3_1_hw_init,
> @@ -818,8 +817,6 @@ static const struct amd_ip_funcs uvd_v3_1_ip_funcs = {
> .soft_reset = uvd_v3_1_soft_reset,
> .set_clockgating_state = uvd_v3_1_set_clockgating_state,
> .set_powergating_state = uvd_v3_1_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version uvd_v3_1_ip_block = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
> index 4852a2ab128f..a836dc9cfcad 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
> @@ -755,7 +755,6 @@ static int uvd_v4_2_set_powergating_state(void *handle,
> static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
> .name = "uvd_v4_2",
> .early_init = uvd_v4_2_early_init,
> - .late_init = NULL,
> .sw_init = uvd_v4_2_sw_init,
> .sw_fini = uvd_v4_2_sw_fini,
> .hw_init = uvd_v4_2_hw_init,
> @@ -768,8 +767,6 @@ static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
> .soft_reset = uvd_v4_2_soft_reset,
> .set_clockgating_state = uvd_v4_2_set_clockgating_state,
> .set_powergating_state = uvd_v4_2_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> index a24b210c79ac..ab55fae3569e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
> @@ -867,7 +867,6 @@ static void uvd_v5_0_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
> .name = "uvd_v5_0",
> .early_init = uvd_v5_0_early_init,
> - .late_init = NULL,
> .sw_init = uvd_v5_0_sw_init,
> .sw_fini = uvd_v5_0_sw_fini,
> .hw_init = uvd_v5_0_hw_init,
> @@ -881,8 +880,6 @@ static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
> .set_clockgating_state = uvd_v5_0_set_clockgating_state,
> .set_powergating_state = uvd_v5_0_set_powergating_state,
> .get_clockgating_state = uvd_v5_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> index b4eeeebfe095..39f8c3d3a135 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
> @@ -1532,7 +1532,6 @@ static void uvd_v6_0_get_clockgating_state(void *handle, u64 *flags)
> static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
> .name = "uvd_v6_0",
> .early_init = uvd_v6_0_early_init,
> - .late_init = NULL,
> .sw_init = uvd_v6_0_sw_init,
> .sw_fini = uvd_v6_0_sw_fini,
> .hw_init = uvd_v6_0_hw_init,
> @@ -1549,8 +1548,6 @@ static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
> .set_clockgating_state = uvd_v6_0_set_clockgating_state,
> .set_powergating_state = uvd_v6_0_set_powergating_state,
> .get_clockgating_state = uvd_v6_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> index 55fa858328f6..f909a60a8853 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
> @@ -1462,104 +1462,6 @@ static void uvd_v7_0_enc_ring_emit_wreg(struct amdgpu_ring *ring,
> amdgpu_ring_write(ring, val);
> }
>
> -#if 0
> -static bool uvd_v7_0_is_idle(void *handle)
> -{
> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -
> - return !(RREG32(mmSRBM_STATUS) & SRBM_STATUS__UVD_BUSY_MASK);
> -}
> -
> -static int uvd_v7_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
> -{
> - unsigned i;
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - for (i = 0; i < adev->usec_timeout; i++) {
> - if (uvd_v7_0_is_idle(handle))
> - return 0;
> - }
> - return -ETIMEDOUT;
> -}
> -
> -#define AMDGPU_UVD_STATUS_BUSY_MASK 0xfd
> -static bool uvd_v7_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> - u32 srbm_soft_reset = 0;
> - u32 tmp = RREG32(mmSRBM_STATUS);
> -
> - if (REG_GET_FIELD(tmp, SRBM_STATUS, UVD_RQ_PENDING) ||
> - REG_GET_FIELD(tmp, SRBM_STATUS, UVD_BUSY) ||
> - (RREG32_SOC15(UVD, ring->me, mmUVD_STATUS) &
> - AMDGPU_UVD_STATUS_BUSY_MASK))
> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
> - SRBM_SOFT_RESET, SOFT_RESET_UVD, 1);
> -
> - if (srbm_soft_reset) {
> - adev->uvd.inst[ring->me].srbm_soft_reset = srbm_soft_reset;
> - return true;
> - } else {
> - adev->uvd.inst[ring->me].srbm_soft_reset = 0;
> - return false;
> - }
> -}
> -
> -static int uvd_v7_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
> - return 0;
> -
> - uvd_v7_0_stop(adev);
> - return 0;
> -}
> -
> -static int uvd_v7_0_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> - u32 srbm_soft_reset;
> -
> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
> - return 0;
> - srbm_soft_reset = adev->uvd.inst[ring->me].srbm_soft_reset;
> -
> - if (srbm_soft_reset) {
> - u32 tmp;
> -
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> - tmp |= srbm_soft_reset;
> - dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
> - WREG32(mmSRBM_SOFT_RESET, tmp);
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> -
> - udelay(50);
> -
> - tmp &= ~srbm_soft_reset;
> - WREG32(mmSRBM_SOFT_RESET, tmp);
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> -
> - /* Wait a little for things to settle down */
> - udelay(50);
> - }
> -
> - return 0;
> -}
> -
> -static int uvd_v7_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
> - return 0;
> -
> - mdelay(5);
> -
> - return uvd_v7_0_start(adev);
> -}
> -#endif
> -
> static int uvd_v7_0_set_interrupt_state(struct amdgpu_device *adev,
> struct amdgpu_irq_src *source,
> unsigned type,
> @@ -1609,187 +1511,9 @@ static int uvd_v7_0_process_interrupt(struct amdgpu_device *adev,
> return 0;
> }
>
> -#if 0
> -static void uvd_v7_0_set_sw_clock_gating(struct amdgpu_device *adev)
> -{
> - uint32_t data, data1, data2, suvd_flags;
> -
> - data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL);
> - data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
> - data2 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL);
> -
> - data &= ~(UVD_CGC_CTRL__CLK_OFF_DELAY_MASK |
> - UVD_CGC_CTRL__CLK_GATE_DLY_TIMER_MASK);
> -
> - suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
> - UVD_SUVD_CGC_GATE__SIT_MASK |
> - UVD_SUVD_CGC_GATE__SMP_MASK |
> - UVD_SUVD_CGC_GATE__SCM_MASK |
> - UVD_SUVD_CGC_GATE__SDB_MASK;
> -
> - data |= UVD_CGC_CTRL__DYN_CLOCK_MODE_MASK |
> - (1 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_GATE_DLY_TIMER)) |
> - (4 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_OFF_DELAY));
> -
> - data &= ~(UVD_CGC_CTRL__UDEC_RE_MODE_MASK |
> - UVD_CGC_CTRL__UDEC_CM_MODE_MASK |
> - UVD_CGC_CTRL__UDEC_IT_MODE_MASK |
> - UVD_CGC_CTRL__UDEC_DB_MODE_MASK |
> - UVD_CGC_CTRL__UDEC_MP_MODE_MASK |
> - UVD_CGC_CTRL__SYS_MODE_MASK |
> - UVD_CGC_CTRL__UDEC_MODE_MASK |
> - UVD_CGC_CTRL__MPEG2_MODE_MASK |
> - UVD_CGC_CTRL__REGS_MODE_MASK |
> - UVD_CGC_CTRL__RBC_MODE_MASK |
> - UVD_CGC_CTRL__LMI_MC_MODE_MASK |
> - UVD_CGC_CTRL__LMI_UMC_MODE_MASK |
> - UVD_CGC_CTRL__IDCT_MODE_MASK |
> - UVD_CGC_CTRL__MPRD_MODE_MASK |
> - UVD_CGC_CTRL__MPC_MODE_MASK |
> - UVD_CGC_CTRL__LBSI_MODE_MASK |
> - UVD_CGC_CTRL__LRBBM_MODE_MASK |
> - UVD_CGC_CTRL__WCB_MODE_MASK |
> - UVD_CGC_CTRL__VCPU_MODE_MASK |
> - UVD_CGC_CTRL__JPEG_MODE_MASK |
> - UVD_CGC_CTRL__JPEG2_MODE_MASK |
> - UVD_CGC_CTRL__SCPU_MODE_MASK);
> - data2 &= ~(UVD_SUVD_CGC_CTRL__SRE_MODE_MASK |
> - UVD_SUVD_CGC_CTRL__SIT_MODE_MASK |
> - UVD_SUVD_CGC_CTRL__SMP_MODE_MASK |
> - UVD_SUVD_CGC_CTRL__SCM_MODE_MASK |
> - UVD_SUVD_CGC_CTRL__SDB_MODE_MASK);
> - data1 |= suvd_flags;
> -
> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL, data);
> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, 0);
> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL, data2);
> -}
> -
> -static void uvd_v7_0_set_hw_clock_gating(struct amdgpu_device *adev)
> -{
> - uint32_t data, data1, cgc_flags, suvd_flags;
> -
> - data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE);
> - data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
> -
> - cgc_flags = UVD_CGC_GATE__SYS_MASK |
> - UVD_CGC_GATE__UDEC_MASK |
> - UVD_CGC_GATE__MPEG2_MASK |
> - UVD_CGC_GATE__RBC_MASK |
> - UVD_CGC_GATE__LMI_MC_MASK |
> - UVD_CGC_GATE__IDCT_MASK |
> - UVD_CGC_GATE__MPRD_MASK |
> - UVD_CGC_GATE__MPC_MASK |
> - UVD_CGC_GATE__LBSI_MASK |
> - UVD_CGC_GATE__LRBBM_MASK |
> - UVD_CGC_GATE__UDEC_RE_MASK |
> - UVD_CGC_GATE__UDEC_CM_MASK |
> - UVD_CGC_GATE__UDEC_IT_MASK |
> - UVD_CGC_GATE__UDEC_DB_MASK |
> - UVD_CGC_GATE__UDEC_MP_MASK |
> - UVD_CGC_GATE__WCB_MASK |
> - UVD_CGC_GATE__VCPU_MASK |
> - UVD_CGC_GATE__SCPU_MASK |
> - UVD_CGC_GATE__JPEG_MASK |
> - UVD_CGC_GATE__JPEG2_MASK;
> -
> - suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
> - UVD_SUVD_CGC_GATE__SIT_MASK |
> - UVD_SUVD_CGC_GATE__SMP_MASK |
> - UVD_SUVD_CGC_GATE__SCM_MASK |
> - UVD_SUVD_CGC_GATE__SDB_MASK;
> -
> - data |= cgc_flags;
> - data1 |= suvd_flags;
> -
> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, data);
> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
> -}
> -
> -static void uvd_v7_0_set_bypass_mode(struct amdgpu_device *adev, bool enable)
> -{
> - u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
> -
> - if (enable)
> - tmp |= (GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
> - GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
> - else
> - tmp &= ~(GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
> - GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
> -
> - WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
> -}
> -
> -
> -static int uvd_v7_0_set_clockgating_state(void *handle,
> - enum amd_clockgating_state state)
> -{
> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> - bool enable = (state == AMD_CG_STATE_GATE);
> - struct amdgpu_ip_block *ip_block;
> -
> - ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_UVD);
> - if (!ip_block)
> - return -EINVAL;
> -
> - uvd_v7_0_set_bypass_mode(adev, enable);
> -
> - if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
> - return 0;
> -
> - if (enable) {
> - /* disable HW gating and enable Sw gating */
> - uvd_v7_0_set_sw_clock_gating(adev);
> - } else {
> - /* wait for STATUS to clear */
> - if (uvd_v7_0_wait_for_idle(ip_block))
> - return -EBUSY;
> -
> - /* enable HW gates because UVD is idle */
> - /* uvd_v7_0_set_hw_clock_gating(adev); */
> - }
> -
> - return 0;
> -}
> -
> -static int uvd_v7_0_set_powergating_state(void *handle,
> - enum amd_powergating_state state)
> -{
> - /* This doesn't actually powergate the UVD block.
> - * That's done in the dpm code via the SMC. This
> - * just re-inits the block as necessary. The actual
> - * gating still happens in the dpm code. We should
> - * revisit this when there is a cleaner line between
> - * the smc and the hw blocks
> - */
> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> -
> - if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
> - return 0;
> -
> - WREG32_SOC15(UVD, ring->me, mmUVD_POWER_STATUS, UVD_POWER_STATUS__UVD_PG_EN_MASK);
> -
> - if (state == AMD_PG_STATE_GATE) {
> - uvd_v7_0_stop(adev);
> - return 0;
> - } else {
> - return uvd_v7_0_start(adev);
> - }
> -}
> -#endif
> -
> -static int uvd_v7_0_set_clockgating_state(void *handle,
> - enum amd_clockgating_state state)
> -{
> - /* needed for driver unload*/
> - return 0;
> -}
> -
> const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
> .name = "uvd_v7_0",
> .early_init = uvd_v7_0_early_init,
> - .late_init = NULL,
> .sw_init = uvd_v7_0_sw_init,
> .sw_fini = uvd_v7_0_sw_fini,
> .hw_init = uvd_v7_0_hw_init,
> @@ -1797,14 +1521,6 @@ const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
> .prepare_suspend = uvd_v7_0_prepare_suspend,
> .suspend = uvd_v7_0_suspend,
> .resume = uvd_v7_0_resume,
> - .is_idle = NULL /* uvd_v7_0_is_idle */,
> - .wait_for_idle = NULL /* uvd_v7_0_wait_for_idle */,
> - .check_soft_reset = NULL /* uvd_v7_0_check_soft_reset */,
> - .pre_soft_reset = NULL /* uvd_v7_0_pre_soft_reset */,
> - .soft_reset = NULL /* uvd_v7_0_soft_reset */,
> - .post_soft_reset = NULL /* uvd_v7_0_post_soft_reset */,
> - .set_clockgating_state = uvd_v7_0_set_clockgating_state,
> - .set_powergating_state = NULL /* uvd_v7_0_set_powergating_state */,
> };
>
> static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
> index a4531000ec0b..c1ed91b39415 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
> @@ -617,7 +617,6 @@ static int vce_v2_0_set_powergating_state(void *handle,
> static const struct amd_ip_funcs vce_v2_0_ip_funcs = {
> .name = "vce_v2_0",
> .early_init = vce_v2_0_early_init,
> - .late_init = NULL,
> .sw_init = vce_v2_0_sw_init,
> .sw_fini = vce_v2_0_sw_fini,
> .hw_init = vce_v2_0_hw_init,
> @@ -629,8 +628,6 @@ static const struct amd_ip_funcs vce_v2_0_ip_funcs = {
> .soft_reset = vce_v2_0_soft_reset,
> .set_clockgating_state = vce_v2_0_set_clockgating_state,
> .set_powergating_state = vce_v2_0_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs vce_v2_0_ring_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
> index 9f9a9d89bcdc..6bb318a06f19 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
> @@ -896,7 +896,6 @@ static void vce_v3_0_emit_pipeline_sync(struct amdgpu_ring *ring)
> static const struct amd_ip_funcs vce_v3_0_ip_funcs = {
> .name = "vce_v3_0",
> .early_init = vce_v3_0_early_init,
> - .late_init = NULL,
> .sw_init = vce_v3_0_sw_init,
> .sw_fini = vce_v3_0_sw_fini,
> .hw_init = vce_v3_0_hw_init,
> @@ -912,8 +911,6 @@ static const struct amd_ip_funcs vce_v3_0_ip_funcs = {
> .set_clockgating_state = vce_v3_0_set_clockgating_state,
> .set_powergating_state = vce_v3_0_set_powergating_state,
> .get_clockgating_state = vce_v3_0_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
> index f4d2650e6b7a..da78f69da724 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
> @@ -543,7 +543,6 @@ static int vce_v4_0_hw_fini(struct amdgpu_ip_block *ip_block)
> cancel_delayed_work_sync(&adev->vce.idle_work);
>
> if (!amdgpu_sriov_vf(adev)) {
> - /* vce_v4_0_wait_for_idle(ip_block); */
> vce_v4_0_stop(adev);
> } else {
> /* full access mode, so don't touch any VCE register */
> @@ -691,273 +690,6 @@ static int vce_v4_0_set_clockgating_state(void *handle,
> return 0;
> }
>
> -#if 0
> -static bool vce_v4_0_is_idle(void *handle)
> -{
> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> - u32 mask = 0;
> -
> - mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE0) ? 0 : SRBM_STATUS2__VCE0_BUSY_MASK;
> - mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE1) ? 0 : SRBM_STATUS2__VCE1_BUSY_MASK;
> -
> - return !(RREG32(mmSRBM_STATUS2) & mask);
> -}
> -
> -static int vce_v4_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
> -{
> - unsigned i;
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - for (i = 0; i < adev->usec_timeout; i++)
> - if (vce_v4_0_is_idle(handle))
> - return 0;
> -
> - return -ETIMEDOUT;
> -}
> -
> -#define VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK 0x00000008L /* AUTO_BUSY */
> -#define VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK 0x00000010L /* RB0_BUSY */
> -#define VCE_STATUS_VCPU_REPORT_RB1_BUSY_MASK 0x00000020L /* RB1_BUSY */
> -#define AMDGPU_VCE_STATUS_BUSY_MASK (VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK | \
> - VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK)
> -
> -static bool vce_v4_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> - u32 srbm_soft_reset = 0;
> -
> - /* According to VCE team , we should use VCE_STATUS instead
> - * SRBM_STATUS.VCE_BUSY bit for busy status checking.
> - * GRBM_GFX_INDEX.INSTANCE_INDEX is used to specify which VCE
> - * instance's registers are accessed
> - * (0 for 1st instance, 10 for 2nd instance).
> - *
> - *VCE_STATUS
> - *|UENC|ACPI|AUTO ACTIVE|RB1 |RB0 |RB2 | |FW_LOADED|JOB |
> - *|----+----+-----------+----+----+----+----------+---------+----|
> - *|bit8|bit7| bit6 |bit5|bit4|bit3| bit2 | bit1 |bit0|
> - *
> - * VCE team suggest use bit 3--bit 6 for busy status check
> - */
> - mutex_lock(&adev->grbm_idx_mutex);
> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
> - if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
> - }
> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0x10);
> - if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) & AMDGPU_VCE_STATUS_BUSY_MASK) {
> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset, SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
> - }
> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
> - mutex_unlock(&adev->grbm_idx_mutex);
> -
> - if (srbm_soft_reset) {
> - adev->vce.srbm_soft_reset = srbm_soft_reset;
> - return true;
> - } else {
> - adev->vce.srbm_soft_reset = 0;
> - return false;
> - }
> -}
> -
> -static int vce_v4_0_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> - u32 srbm_soft_reset;
> -
> - if (!adev->vce.srbm_soft_reset)
> - return 0;
> - srbm_soft_reset = adev->vce.srbm_soft_reset;
> -
> - if (srbm_soft_reset) {
> - u32 tmp;
> -
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> - tmp |= srbm_soft_reset;
> - dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
> - WREG32(mmSRBM_SOFT_RESET, tmp);
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> -
> - udelay(50);
> -
> - tmp &= ~srbm_soft_reset;
> - WREG32(mmSRBM_SOFT_RESET, tmp);
> - tmp = RREG32(mmSRBM_SOFT_RESET);
> -
> - /* Wait a little for things to settle down */
> - udelay(50);
> - }
> -
> - return 0;
> -}
> -
> -static int vce_v4_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - if (!adev->vce.srbm_soft_reset)
> - return 0;
> -
> - mdelay(5);
> -
> - return vce_v4_0_suspend(adev);
> -}
> -
> -
> -static int vce_v4_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
> -{
> - struct amdgpu_device *adev = ip_block->adev;
> -
> - if (!adev->vce.srbm_soft_reset)
> - return 0;
> -
> - mdelay(5);
> -
> - return vce_v4_0_resume(adev);
> -}
> -
> -static void vce_v4_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override)
> -{
> - u32 tmp, data;
> -
> - tmp = data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL));
> - if (override)
> - data |= VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
> - else
> - data &= ~VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
> -
> - if (tmp != data)
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL), data);
> -}
> -
> -static void vce_v4_0_set_vce_sw_clock_gating(struct amdgpu_device *adev,
> - bool gated)
> -{
> - u32 data;
> -
> - /* Set Override to disable Clock Gating */
> - vce_v4_0_override_vce_clock_gating(adev, true);
> -
> - /* This function enables MGCG which is controlled by firmware.
> - With the clocks in the gated state the core is still
> - accessible but the firmware will throttle the clocks on the
> - fly as necessary.
> - */
> - if (gated) {
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
> - data |= 0x1ff;
> - data &= ~0xef0000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING));
> - data |= 0x3ff000;
> - data &= ~0xffc00000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2));
> - data |= 0x2;
> - data &= ~0x00010000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING));
> - data |= 0x37f;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL));
> - data |= VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
> - VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
> - VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
> - 0x8;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL), data);
> - } else {
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
> - data &= ~0x80010;
> - data |= 0xe70008;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING));
> - data |= 0xffc00000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2));
> - data |= 0x10000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING));
> - data &= ~0xffc00000;
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_REG_CLOCK_GATING), data);
> -
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL));
> - data &= ~(VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
> - VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
> - VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
> - 0x8);
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL), data);
> - }
> - vce_v4_0_override_vce_clock_gating(adev, false);
> -}
> -
> -static void vce_v4_0_set_bypass_mode(struct amdgpu_device *adev, bool enable)
> -{
> - u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
> -
> - if (enable)
> - tmp |= GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
> - else
> - tmp &= ~GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
> -
> - WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
> -}
> -
> -static int vce_v4_0_set_clockgating_state(void *handle,
> - enum amd_clockgating_state state)
> -{
> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> - bool enable = (state == AMD_CG_STATE_GATE);
> - int i;
> -
> - if ((adev->asic_type == CHIP_POLARIS10) ||
> - (adev->asic_type == CHIP_TONGA) ||
> - (adev->asic_type == CHIP_FIJI))
> - vce_v4_0_set_bypass_mode(adev, enable);
> -
> - if (!(adev->cg_flags & AMD_CG_SUPPORT_VCE_MGCG))
> - return 0;
> -
> - mutex_lock(&adev->grbm_idx_mutex);
> - for (i = 0; i < 2; i++) {
> - /* Program VCE Instance 0 or 1 if not harvested */
> - if (adev->vce.harvest_config & (1 << i))
> - continue;
> -
> - WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, i);
> -
> - if (enable) {
> - /* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */
> - uint32_t data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_A);
> - data &= ~(0xf | 0xff0);
> - data |= ((0x0 << 0) | (0x04 << 4));
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_A, data);
> -
> - /* initialize VCE_UENC_CLOCK_GATING: Clock ON/OFF delay */
> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING);
> - data &= ~(0xf | 0xff0);
> - data |= ((0x0 << 0) | (0x04 << 4));
> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING, data);
> - }
> -
> - vce_v4_0_set_vce_sw_clock_gating(adev, enable);
> - }
> -
> - WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
> - mutex_unlock(&adev->grbm_idx_mutex);
> -
> - return 0;
> -}
> -#endif
> -
> static int vce_v4_0_set_powergating_state(void *handle,
> enum amd_powergating_state state)
> {
> @@ -1076,19 +808,12 @@ static int vce_v4_0_process_interrupt(struct amdgpu_device *adev,
> const struct amd_ip_funcs vce_v4_0_ip_funcs = {
> .name = "vce_v4_0",
> .early_init = vce_v4_0_early_init,
> - .late_init = NULL,
> .sw_init = vce_v4_0_sw_init,
> .sw_fini = vce_v4_0_sw_fini,
> .hw_init = vce_v4_0_hw_init,
> .hw_fini = vce_v4_0_hw_fini,
> .suspend = vce_v4_0_suspend,
> .resume = vce_v4_0_resume,
> - .is_idle = NULL /* vce_v4_0_is_idle */,
> - .wait_for_idle = NULL /* vce_v4_0_wait_for_idle */,
> - .check_soft_reset = NULL /* vce_v4_0_check_soft_reset */,
> - .pre_soft_reset = NULL /* vce_v4_0_pre_soft_reset */,
> - .soft_reset = NULL /* vce_v4_0_soft_reset */,
> - .post_soft_reset = NULL /* vce_v4_0_post_soft_reset */,
> .set_clockgating_state = vce_v4_0_set_clockgating_state,
> .set_powergating_state = vce_v4_0_set_powergating_state,
> };
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> index 129c759772c2..497b5d93a58b 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> @@ -1987,7 +1987,6 @@ static void vcn_v1_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
> .name = "vcn_v1_0",
> .early_init = vcn_v1_0_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v1_0_sw_init,
> .sw_fini = vcn_v1_0_sw_fini,
> .hw_init = vcn_v1_0_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> index 19bbd49f760e..e0322cbca3ec 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
> @@ -2095,7 +2095,6 @@ static void vcn_v2_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v2_0_ip_funcs = {
> .name = "vcn_v2_0",
> .early_init = vcn_v2_0_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v2_0_sw_init,
> .sw_fini = vcn_v2_0_sw_fini,
> .hw_init = vcn_v2_0_hw_init,
> @@ -2104,10 +2103,6 @@ static const struct amd_ip_funcs vcn_v2_0_ip_funcs = {
> .resume = vcn_v2_0_resume,
> .is_idle = vcn_v2_0_is_idle,
> .wait_for_idle = vcn_v2_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v2_0_set_clockgating_state,
> .set_powergating_state = vcn_v2_0_set_powergating_state,
> .dump_ip_state = vcn_v2_0_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> index 30420ead7fc4..6aa08281d094 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
> @@ -1987,7 +1987,6 @@ static void vcn_v2_5_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
> .name = "vcn_v2_5",
> .early_init = vcn_v2_5_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v2_5_sw_init,
> .sw_fini = vcn_v2_5_sw_fini,
> .hw_init = vcn_v2_5_hw_init,
> @@ -1996,10 +1995,6 @@ static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
> .resume = vcn_v2_5_resume,
> .is_idle = vcn_v2_5_is_idle,
> .wait_for_idle = vcn_v2_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v2_5_set_clockgating_state,
> .set_powergating_state = vcn_v2_5_set_powergating_state,
> .dump_ip_state = vcn_v2_5_dump_ip_state,
> @@ -2009,7 +2004,6 @@ static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
> static const struct amd_ip_funcs vcn_v2_6_ip_funcs = {
> .name = "vcn_v2_6",
> .early_init = vcn_v2_5_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v2_5_sw_init,
> .sw_fini = vcn_v2_5_sw_fini,
> .hw_init = vcn_v2_5_hw_init,
> @@ -2018,10 +2012,6 @@ static const struct amd_ip_funcs vcn_v2_6_ip_funcs = {
> .resume = vcn_v2_5_resume,
> .is_idle = vcn_v2_5_is_idle,
> .wait_for_idle = vcn_v2_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v2_5_set_clockgating_state,
> .set_powergating_state = vcn_v2_5_set_powergating_state,
> .dump_ip_state = vcn_v2_5_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> index 13632c22d2f9..6732ad7f16f5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
> @@ -2313,7 +2313,6 @@ static void vcn_v3_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v3_0_ip_funcs = {
> .name = "vcn_v3_0",
> .early_init = vcn_v3_0_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v3_0_sw_init,
> .sw_fini = vcn_v3_0_sw_fini,
> .hw_init = vcn_v3_0_hw_init,
> @@ -2322,10 +2321,6 @@ static const struct amd_ip_funcs vcn_v3_0_ip_funcs = {
> .resume = vcn_v3_0_resume,
> .is_idle = vcn_v3_0_is_idle,
> .wait_for_idle = vcn_v3_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v3_0_set_clockgating_state,
> .set_powergating_state = vcn_v3_0_set_powergating_state,
> .dump_ip_state = vcn_v3_0_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> index e7b7a8150ea7..5512259cac79 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
> @@ -2220,7 +2220,6 @@ static void vcn_v4_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
> .name = "vcn_v4_0",
> .early_init = vcn_v4_0_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v4_0_sw_init,
> .sw_fini = vcn_v4_0_sw_fini,
> .hw_init = vcn_v4_0_hw_init,
> @@ -2229,10 +2228,6 @@ static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
> .resume = vcn_v4_0_resume,
> .is_idle = vcn_v4_0_is_idle,
> .wait_for_idle = vcn_v4_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v4_0_set_clockgating_state,
> .set_powergating_state = vcn_v4_0_set_powergating_state,
> .dump_ip_state = vcn_v4_0_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> index 6dcae398b2dc..0d5c94bfc0ef 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
> @@ -1796,7 +1796,6 @@ static void vcn_v4_0_3_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v4_0_3_ip_funcs = {
> .name = "vcn_v4_0_3",
> .early_init = vcn_v4_0_3_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v4_0_3_sw_init,
> .sw_fini = vcn_v4_0_3_sw_fini,
> .hw_init = vcn_v4_0_3_hw_init,
> @@ -1805,10 +1804,6 @@ static const struct amd_ip_funcs vcn_v4_0_3_ip_funcs = {
> .resume = vcn_v4_0_3_resume,
> .is_idle = vcn_v4_0_3_is_idle,
> .wait_for_idle = vcn_v4_0_3_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v4_0_3_set_clockgating_state,
> .set_powergating_state = vcn_v4_0_3_set_powergating_state,
> .dump_ip_state = vcn_v4_0_3_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> index edb9cd8390b6..71961fb3f7ff 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
> @@ -1678,7 +1678,6 @@ static void vcn_v4_0_5_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v4_0_5_ip_funcs = {
> .name = "vcn_v4_0_5",
> .early_init = vcn_v4_0_5_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v4_0_5_sw_init,
> .sw_fini = vcn_v4_0_5_sw_fini,
> .hw_init = vcn_v4_0_5_hw_init,
> @@ -1687,10 +1686,6 @@ static const struct amd_ip_funcs vcn_v4_0_5_ip_funcs = {
> .resume = vcn_v4_0_5_resume,
> .is_idle = vcn_v4_0_5_is_idle,
> .wait_for_idle = vcn_v4_0_5_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v4_0_5_set_clockgating_state,
> .set_powergating_state = vcn_v4_0_5_set_powergating_state,
> .dump_ip_state = vcn_v4_0_5_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
> index 89bf29fa6f8d..fe2cc1a80c13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
> @@ -1404,7 +1404,6 @@ static void vcn_v5_0_dump_ip_state(struct amdgpu_ip_block *ip_block)
> static const struct amd_ip_funcs vcn_v5_0_0_ip_funcs = {
> .name = "vcn_v5_0_0",
> .early_init = vcn_v5_0_0_early_init,
> - .late_init = NULL,
> .sw_init = vcn_v5_0_0_sw_init,
> .sw_fini = vcn_v5_0_0_sw_fini,
> .hw_init = vcn_v5_0_0_hw_init,
> @@ -1413,10 +1412,6 @@ static const struct amd_ip_funcs vcn_v5_0_0_ip_funcs = {
> .resume = vcn_v5_0_0_resume,
> .is_idle = vcn_v5_0_0_is_idle,
> .wait_for_idle = vcn_v5_0_0_wait_for_idle,
> - .check_soft_reset = NULL,
> - .pre_soft_reset = NULL,
> - .soft_reset = NULL,
> - .post_soft_reset = NULL,
> .set_clockgating_state = vcn_v5_0_0_set_clockgating_state,
> .set_powergating_state = vcn_v5_0_0_set_powergating_state,
> .dump_ip_state = vcn_v5_0_dump_ip_state,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> index 73de5909f655..0fedadd0a6a4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
> @@ -625,7 +625,6 @@ static int vega10_ih_set_powergating_state(void *handle,
> const struct amd_ip_funcs vega10_ih_ip_funcs = {
> .name = "vega10_ih",
> .early_init = vega10_ih_early_init,
> - .late_init = NULL,
> .sw_init = vega10_ih_sw_init,
> .sw_fini = vega10_ih_sw_fini,
> .hw_init = vega10_ih_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> index a42404a58015..b7e3fb4628b2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> @@ -690,7 +690,6 @@ static int vega20_ih_set_powergating_state(void *handle,
> const struct amd_ip_funcs vega20_ih_ip_funcs = {
> .name = "vega20_ih",
> .early_init = vega20_ih_early_init,
> - .late_init = NULL,
> .sw_init = vega20_ih_sw_init,
> .sw_fini = vega20_ih_sw_fini,
> .hw_init = vega20_ih_hw_init,
> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
> index 607b48a2d5eb..b3fa54c0514e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
> @@ -2036,8 +2036,6 @@ static const struct amd_ip_funcs vi_common_ip_funcs = {
> .set_clockgating_state = vi_common_set_clockgating_state,
> .set_powergating_state = vi_common_set_powergating_state,
> .get_clockgating_state = vi_common_get_clockgating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> static const struct amdgpu_ip_block_version vi_common_ip_block =
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index a4882b16ace2..5e9854f5d276 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -3407,8 +3407,6 @@ static const struct amd_ip_funcs amdgpu_dm_funcs = {
> .soft_reset = dm_soft_reset,
> .set_clockgating_state = dm_set_clockgating_state,
> .set_powergating_state = dm_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version dm_ip_block = {
> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> index 785cb20e64b6..8908646ad620 100644
> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
> @@ -3304,8 +3304,6 @@ static const struct amd_ip_funcs kv_dpm_ip_funcs = {
> .is_idle = kv_dpm_is_idle,
> .set_clockgating_state = kv_dpm_set_clockgating_state,
> .set_powergating_state = kv_dpm_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version kv_smu_ip_block = {
> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> index 7b0ded50251a..ee23a0f897c5 100644
> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
> @@ -8046,8 +8046,6 @@ static const struct amd_ip_funcs si_dpm_ip_funcs = {
> .wait_for_idle = si_dpm_wait_for_idle,
> .set_clockgating_state = si_dpm_set_clockgating_state,
> .set_powergating_state = si_dpm_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version si_smu_ip_block =
> diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> index 5aadb6061c22..26624a716fc6 100644
> --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
> @@ -287,8 +287,6 @@ static const struct amd_ip_funcs pp_ip_funcs = {
> .is_idle = pp_is_idle,
> .set_clockgating_state = pp_set_clockgating_state,
> .set_powergating_state = pp_set_powergating_state,
> - .dump_ip_state = NULL,
> - .print_ip_state = NULL,
> };
>
> const struct amdgpu_ip_block_version pp_smu_ip_block =
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> index accc96a03bd9..277169c2f711 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
> @@ -2580,10 +2580,6 @@ const struct amd_ip_funcs smu_ip_funcs = {
> .late_fini = smu_late_fini,
> .suspend = smu_suspend,
> .resume = smu_resume,
> - .is_idle = NULL,
> - .check_soft_reset = NULL,
> - .wait_for_idle = NULL,
> - .soft_reset = NULL,
> .set_clockgating_state = smu_set_clockgating_state,
> .set_powergating_state = smu_set_powergating_state,
> };
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use
2024-10-17 10:06 ` [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use Sunil Khatri
@ 2024-10-17 12:20 ` Christian König
2024-10-17 12:55 ` Khatri, Sunil
0 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 12:20 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher, Christian König; +Cc: amd-gfx
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> Validate the function pointer for get_clockgating_state
> before making a function call.
Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO
functions are not IP specific.
Christian.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/nv.c | 9 ++++++---
> drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++++--
> drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ++++--
> 3 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
> index 6b72169be8f8..40c720b32c59 100644
> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
> @@ -1084,11 +1084,14 @@ static void nv_common_get_clockgating_state(void *handle, u64 *flags)
> if (amdgpu_sriov_vf(adev))
> *flags = 0;
>
> - adev->nbio.funcs->get_clockgating_state(adev, flags);
> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>
> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>
> - adev->smuio.funcs->get_clock_gating_state(adev, flags);
> + if (adev->smuio.funcs && adev->smuio.funcs->get_clock_gating_state)
> + adev->smuio.funcs->get_clock_gating_state(adev, flags);
> }
>
> static const struct amd_ip_funcs nv_common_ip_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
> index 1c07ebdc0d1f..196286be35b4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
> @@ -975,9 +975,11 @@ static void soc21_common_get_clockgating_state(void *handle, u64 *flags)
> {
> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>
> - adev->nbio.funcs->get_clockgating_state(adev, flags);
> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>
> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
> }
>
> static const struct amd_ip_funcs soc21_common_ip_funcs = {
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c b/drivers/gpu/drm/amd/amdgpu/soc24.c
> index 3af10ef4b793..f4278a0fa8f7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc24.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
> @@ -564,9 +564,11 @@ static void soc24_common_get_clockgating_state(void *handle, u64 *flags)
> {
> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>
> - adev->nbio.funcs->get_clockgating_state(adev, flags);
> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>
> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>
> return;
> }
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 00/15] validate/clean the functions of ip funcs
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
` (14 preceding siblings ...)
2024-10-17 10:06 ` [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use Sunil Khatri
@ 2024-10-17 12:23 ` Christian König
2024-10-17 12:57 ` Khatri, Sunil
15 siblings, 1 reply; 31+ messages in thread
From: Christian König @ 2024-10-17 12:23 UTC (permalink / raw)
To: Sunil Khatri, Alex Deucher; +Cc: amd-gfx
Patches #1-#4, #8-#10,#13 are Reviewed-by: Christian König
<christian.koenig@amd.com>
Since those patches should be independent maybe push them to
amd-staging-drm-next before continuing working on the set.
Regards,
Christian.
Am 17.10.24 um 12:06 schrieb Sunil Khatri:
> v4: hw_init/hw_fini functions are mandatory and raise error message if
> these functions are not defined.
>
> v3: Added 2 new patches to clean get_clocking_state and hw_init
> validation.
>
> Sunil Khatri (15):
> drm/amdgpu: validate sw_init before function call
> drm/amdgpu: clean the dummy sw_init functions
> drm/amdgpu: validate sw_fini before function call
> drm/amdgpu: clean the dummy sw_fini functions
> drm/amdgpu: validate hw_fini before function call
> drm/amdgpu: validate suspend before function call
> drm/amdgpu: validate resume before function call
> drm/amdgpu: validate wait_for_idle before function call
> drm/amdgpu: clean the dummy resume functions
> drm/amdgpu: clean the dummy suspend functions
> drm/amdgpu: clean the dummy hw_fini functions
> drm/amdgpu: clean the dummy wait_for_idle functions
> drm/amdgpu: clean the dummy soft_reset functions
> drm/amdgpu: clean unused functions of amd_ip_funcs
> drm/amdgpu: validate get_clockgating_state before use
>
> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 38 ++-
> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 16 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 138 +++++----
> drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 35 ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 25 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
> drivers/gpu/drm/amd/amdgpu/cik.c | 33 +-
> drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
> drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 9 -
> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 9 -
> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 9 -
> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 9 -
> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 9 -
> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 6 -
> drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 6 -
> drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 6 -
> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
> drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
> drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
> drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +-
> drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/nv.c | 29 +-
> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/si.c | 40 ---
> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
> drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 43 +--
> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 29 +-
> drivers/gpu/drm/amd/amdgpu/soc15.c | 14 -
> drivers/gpu/drm/amd/amdgpu/soc21.c | 26 +-
> drivers/gpu/drm/amd/amdgpu/soc24.c | 24 +-
> drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
> drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
> drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
> drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
> drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
> drivers/gpu/drm/amd/amdgpu/vi.c | 20 --
> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
> drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 15 -
> drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 8 -
> .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 14 -
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
> 80 files changed, 171 insertions(+), 1208 deletions(-)
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call
2024-10-17 11:52 ` Christian König
@ 2024-10-17 12:44 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:44 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
On 10/17/2024 5:22 PM, Christian König wrote:
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Before making a function call to hw_fini, validate
>> the function pointer like we do in sw_init.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 33 ++++++++++++++--------
>> 1 file changed, 22 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index cf84b50f2355..96cecd4a636b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -3287,11 +3287,17 @@ static void
>> amdgpu_device_smu_fini_early(struct amdgpu_device *adev)
>> if (!adev->ip_blocks[i].status.hw)
>> continue;
>> if (adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_SMC) {
>> - r =
>> adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
>> - /* XXX handle errors */
>> - if (r) {
>> - DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> + if (!adev->ip_blocks[i].version->funcs->hw_fini) {
>> + DRM_ERROR("hw_fini of IP block <%s> not defined\n",
>> + adev->ip_blocks[i].version->funcs->name);
>> + } else {
>> + r = adev->ip_blocks[i].version->funcs->hw_fini(
>> + &adev->ip_blocks[i]);
>> + /* XXX handle errors */
>> + if (r) {
>> + DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> break;
>> @@ -3325,12 +3331,17 @@ static int amdgpu_device_ip_fini_early(struct
>> amdgpu_device *adev)
>> for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
>> if (!adev->ip_blocks[i].status.hw)
>> continue;
>> -
>> - r =
>> adev->ip_blocks[i].version->funcs->hw_fini(&adev->ip_blocks[i]);
>> - /* XXX handle errors */
>> - if (r) {
>> - DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> + if (!adev->ip_blocks[i].version->funcs->hw_fini) {
>> + DRM_ERROR("hw_fini of IP block <%s> not defined\n",
>> + adev->ip_blocks[i].version->funcs->name);
>> + } else {
>> + r = adev->ip_blocks[i].version->funcs->hw_fini(
>> + &adev->ip_blocks[i]);
>> + /* XXX handle errors */
>> + if (r) {
>> + DRM_DEBUG("hw_fini of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + }
>
> I strongly suggest to make this a separate function, e.g. something
> like amdgpu_ip_block_hw_fini() and then call it twice.
Sure. Noted.
>
> Regards,
> Christian.
>
>> }
>> adev->ip_blocks[i].status.hw = false;
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 06/15] drm/amdgpu: validate suspend before function call
2024-10-17 11:54 ` Christian König
@ 2024-10-17 12:45 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:45 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
On 10/17/2024 5:24 PM, Christian König wrote:
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Before making a function call to suspend, validate
>> the function pointer like we do in sw_init.
>
> Same comment as on patch #5, please add an amdgpu_ip_block_suspend()
> function and just call it multiple times.
> Noted.
> Regards,
> Christian.
>
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 15 ++++++------
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 26 ++++++++++++---------
>> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 ++++++----
>> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 15 ++++++------
>> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 15 ++++++------
>> 5 files changed, 46 insertions(+), 37 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> index c1ff24335a0c..e55d680d95ce 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> @@ -85,13 +85,14 @@ static int aldebaran_mode2_suspend_ip(struct
>> amdgpu_device *adev)
>> AMD_IP_BLOCK_TYPE_SDMA))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> -
>> - if (r) {
>> - dev_err(adev->dev,
>> - "suspend of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "suspend of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 96cecd4a636b..fda89aeb4d1b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -3478,12 +3478,14 @@ static int
>> amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
>> continue;
>> /* XXX handle errors */
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> - /* XXX handle errors */
>> - if (r) {
>> - DRM_ERROR("suspend of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + /* XXX handle errors */
>> + if (r) {
>> + DRM_ERROR("suspend of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> @@ -3560,11 +3562,13 @@ static int
>> amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
>> continue;
>> /* XXX handle errors */
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> - /* XXX handle errors */
>> - if (r) {
>> - DRM_ERROR("suspend of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + /* XXX handle errors */
>> + if (r) {
>> + DRM_ERROR("suspend of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> /* handle putting the SMC in the appropriate state */
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
>> index 3e2724590dbf..6bc75aa1c3b1 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
>> @@ -40,11 +40,13 @@ static int
>> amdgpu_reset_xgmi_reset_on_init_suspend(struct amdgpu_device *adev)
>> continue;
>> /* XXX handle errors */
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> - /* XXX handle errors */
>> - if (r) {
>> - dev_err(adev->dev, "suspend of IP block <%s> failed %d",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + /* XXX handle errors */
>> + if (r) {
>> + dev_err(adev->dev, "suspend of IP block <%s> failed
>> %d",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> }
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> index 475b7df3a908..10dece12509f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> @@ -81,13 +81,14 @@ static int sienna_cichlid_mode2_suspend_ip(struct
>> amdgpu_device *adev)
>> AMD_IP_BLOCK_TYPE_SDMA))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> -
>> - if (r) {
>> - dev_err(adev->dev,
>> - "suspend of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "suspend of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> }
>> diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> index 5ea9090b5040..ab049f0b4d39 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> @@ -80,13 +80,14 @@ static int smu_v13_0_10_mode2_suspend_ip(struct
>> amdgpu_device *adev)
>> AMD_IP_BLOCK_TYPE_MES))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> -
>> - if (r) {
>> - dev_err(adev->dev,
>> - "suspend of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->suspend) {
>> + r =
>> adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "suspend of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = false;
>> }
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 07/15] drm/amdgpu: validate resume before function call
2024-10-17 11:55 ` Christian König
@ 2024-10-17 12:46 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:46 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
On 10/17/2024 5:25 PM, Christian König wrote:
> Same comment as patch #5, please add an amdgpu_ip_block_resume()
> function.
Sure
>
> Regards,
> Christian.
>
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Before making a function call to resume, validate
>> the function pointer like we do in sw_init.
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 23 ++++++----
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 47 ++++++++++++---------
>> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 28 ++++++------
>> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 14 +++---
>> 4 files changed, 66 insertions(+), 46 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> index e55d680d95ce..4dd9af51210d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/aldebaran.c
>> @@ -247,9 +247,11 @@ static int aldebaran_mode2_restore_ip(struct
>> amdgpu_device *adev)
>> dev_err(adev->dev, "Failed to get BIF handle\n");
>> return -EINVAL;
>> }
>> - r = cmn_block->version->funcs->resume(cmn_block);
>> - if (r)
>> - return r;
>> + if (cmn_block->version->funcs->resume) {
>> + r = cmn_block->version->funcs->resume(cmn_block);
>> + if (r)
>> + return r;
>> + }
>> /* Reinit GFXHUB */
>> adev->gfxhub.funcs->init(adev);
>> @@ -283,12 +285,15 @@ static int aldebaran_mode2_restore_ip(struct
>> amdgpu_device *adev)
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_SDMA))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - dev_err(adev->dev,
>> - "resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> +
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index fda89aeb4d1b..aa7314c14db8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -2744,11 +2744,15 @@ static int amdgpu_device_fw_loading(struct
>> amdgpu_device *adev)
>> break;
>> if (amdgpu_in_reset(adev) || adev->in_suspend) {
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - DRM_ERROR("resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r = adev->ip_blocks[i].version->funcs->resume(
>> + &adev->ip_blocks[i]);
>> + if (r) {
>> + DRM_ERROR("resume of IP block <%s> failed
>> %d\n",
>> + adev->ip_blocks[i].version->funcs
>> + ->name, r);
>> + return r;
>> + }
>> }
>> } else {
>> r =
>> adev->ip_blocks[i].version->funcs->hw_init(&adev->ip_blocks[i]);
>> @@ -3683,10 +3687,12 @@ static int
>> amdgpu_device_ip_reinit_late_sriov(struct amdgpu_device *adev)
>> block->status.hw)
>> continue;
>> - if (block->version->type == AMD_IP_BLOCK_TYPE_SMC)
>> - r = block->version->funcs->resume(&adev->ip_blocks[i]);
>> - else
>> + if (block->version->type == AMD_IP_BLOCK_TYPE_SMC) {
>> + if (adev->ip_blocks[i].version->funcs->resume)
>> + r =
>> block->version->funcs->resume(&adev->ip_blocks[i]);
>> + } else {
>> r =
>> block->version->funcs->hw_init(&adev->ip_blocks[i]);
>> + }
>> DRM_INFO("RE-INIT-late: %s %s\n",
>> block->version->funcs->name, r?"failed":"succeeded");
>> if (r)
>> @@ -3721,12 +3727,13 @@ static int
>> amdgpu_device_ip_resume_phase1(struct amdgpu_device *adev)
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_GMC ||
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_IH ||
>> (adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_PSP && amdgpu_sriov_vf(adev))) {
>> -
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - DRM_ERROR("resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + DRM_ERROR("resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>> }
>> @@ -3760,11 +3767,13 @@ static int
>> amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev)
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_IH ||
>> adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - DRM_ERROR("resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + DRM_ERROR("resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>> }
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> index 10dece12509f..082a69babe62 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c
>> @@ -176,12 +176,14 @@ static int
>> sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
>> for (i = 0; i < adev->num_ip_blocks; i++) {
>> if (adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_IH) {
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - dev_err(adev->dev,
>> - "resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>> @@ -194,12 +196,14 @@ static int
>> sienna_cichlid_mode2_restore_ip(struct amdgpu_device *adev)
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_SDMA))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - dev_err(adev->dev,
>> - "resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> index ab049f0b4d39..2e041424ef9f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c
>> @@ -187,12 +187,14 @@ static int smu_v13_0_10_mode2_restore_ip(struct
>> amdgpu_device *adev)
>> adev->ip_blocks[i].version->type ==
>> AMD_IP_BLOCK_TYPE_SDMA))
>> continue;
>> - r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> - if (r) {
>> - dev_err(adev->dev,
>> - "resume of IP block <%s> failed %d\n",
>> - adev->ip_blocks[i].version->funcs->name, r);
>> - return r;
>> + if (adev->ip_blocks[i].version->funcs->resume) {
>> + r =
>> adev->ip_blocks[i].version->funcs->resume(&adev->ip_blocks[i]);
>> + if (r) {
>> + dev_err(adev->dev,
>> + "resume of IP block <%s> failed %d\n",
>> + adev->ip_blocks[i].version->funcs->name, r);
>> + return r;
>> + }
>> }
>> adev->ip_blocks[i].status.hw = true;
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions
2024-10-17 11:58 ` Christian König
@ 2024-10-17 12:47 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:47 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
On 10/17/2024 5:28 PM, Christian König wrote:
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Remove the dummy hw_fini functions for all
>> ip blocks.
>
> As discussed on the call hw_init() and hw_fini() are the only two
> functions I consider mandatory.
>
> So please drop this patch here and as a follow up task maybe look into
> why vkms and mes_v12 don't have a hw_fini function.
>
> For SI and CIK we probably don't care any more since those are to old.
>
Sure will drop this patch and will see the reason first before cleaning
this up. Will push new patch set for this after understanding the reason
if needed.
Thanks Sunil
> Regards,
> Christian.
>
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 6 ------
>> drivers/gpu/drm/amd/amdgpu/cik.c | 6 ------
>> drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +----------
>> drivers/gpu/drm/amd/amdgpu/si.c | 6 ------
>> 4 files changed, 1 insertion(+), 28 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> index ed8015313827..e3a399bfab61 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> @@ -600,11 +600,6 @@ static int amdgpu_vkms_hw_init(struct
>> amdgpu_ip_block *ip_block)
>> return 0;
>> }
>> -static int amdgpu_vkms_hw_fini(struct amdgpu_ip_block *ip_block)
>> -{
>> - return 0;
>> -}
>> -
>> static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
>> {
>> struct amdgpu_device *adev = ip_block->adev;
>> @@ -661,7 +656,6 @@ static const struct amd_ip_funcs
>> amdgpu_vkms_ip_funcs = {
>> .sw_init = amdgpu_vkms_sw_init,
>> .sw_fini = amdgpu_vkms_sw_fini,
>> .hw_init = amdgpu_vkms_hw_init,
>> - .hw_fini = amdgpu_vkms_hw_fini,
>> .suspend = amdgpu_vkms_suspend,
>> .resume = amdgpu_vkms_resume,
>> .is_idle = amdgpu_vkms_is_idle,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c
>> b/drivers/gpu/drm/amd/amdgpu/cik.c
>> index c8fb592f13df..9cb25d0d1051 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
>> @@ -2138,11 +2138,6 @@ static int cik_common_hw_init(struct
>> amdgpu_ip_block *ip_block)
>> return 0;
>> }
>> -static int cik_common_hw_fini(struct amdgpu_ip_block *ip_block)
>> -{
>> - return 0;
>> -}
>> -
>> static int cik_common_resume(struct amdgpu_ip_block *ip_block)
>> {
>> return cik_common_hw_init(ip_block);
>> @@ -2181,7 +2176,6 @@ static const struct amd_ip_funcs
>> cik_common_ip_funcs = {
>> .early_init = cik_common_early_init,
>> .late_init = NULL,
>> .hw_init = cik_common_hw_init,
>> - .hw_fini = cik_common_hw_fini,
>> .resume = cik_common_resume,
>> .is_idle = cik_common_is_idle,
>> .wait_for_idle = cik_common_wait_for_idle,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
>> b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
>> index 9d0e342a2f81..a1af5c90f79a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v12_0.c
>> @@ -40,7 +40,6 @@ MODULE_FIRMWARE("amdgpu/gc_12_0_1_mes1.bin");
>> MODULE_FIRMWARE("amdgpu/gc_12_0_1_uni_mes.bin");
>> static int mes_v12_0_hw_init(struct amdgpu_ip_block *ip_block);
>> -static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block);
>> static int mes_v12_0_kiq_hw_init(struct amdgpu_device *adev);
>> static int mes_v12_0_kiq_hw_fini(struct amdgpu_device *adev);
>> @@ -1516,7 +1515,6 @@ static int mes_v12_0_kiq_hw_init(struct
>> amdgpu_device *adev)
>> return r;
>> failure:
>> - mes_v12_0_hw_fini(ip_block);
>> return r;
>> }
>> @@ -1600,15 +1598,9 @@ static int mes_v12_0_hw_init(struct
>> amdgpu_ip_block *ip_block)
>> return 0;
>> failure:
>> - mes_v12_0_hw_fini(ip_block);
>> return r;
>> }
>> -static int mes_v12_0_hw_fini(struct amdgpu_ip_block *ip_block)
>> -{
>> - return 0;
>> -}
>> -
>> static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
>> {
>> int r;
>> @@ -1617,7 +1609,7 @@ static int mes_v12_0_suspend(struct
>> amdgpu_ip_block *ip_block)
>> if (r)
>> return r;
>> - return mes_v12_0_hw_fini(ip_block);
>> + return 0;
>> }
>> static int mes_v12_0_resume(struct amdgpu_ip_block *ip_block)
>> @@ -1663,7 +1655,6 @@ static const struct amd_ip_funcs
>> mes_v12_0_ip_funcs = {
>> .sw_init = mes_v12_0_sw_init,
>> .sw_fini = mes_v12_0_sw_fini,
>> .hw_init = mes_v12_0_hw_init,
>> - .hw_fini = mes_v12_0_hw_fini,
>> .suspend = mes_v12_0_suspend,
>> .resume = mes_v12_0_resume,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c
>> b/drivers/gpu/drm/amd/amdgpu/si.c
>> index 66ccb76eb72a..e1b3bef6992a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/si.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
>> @@ -2634,11 +2634,6 @@ static int si_common_hw_init(struct
>> amdgpu_ip_block *ip_block)
>> return 0;
>> }
>> -static int si_common_hw_fini(struct amdgpu_ip_block *ip_block)
>> -{
>> - return 0;
>> -}
>> -
>> static int si_common_resume(struct amdgpu_ip_block *ip_block)
>> {
>> return si_common_hw_init(ip_block);
>> @@ -2676,7 +2671,6 @@ static const struct amd_ip_funcs
>> si_common_ip_funcs = {
>> .early_init = si_common_early_init,
>> .late_init = NULL,
>> .hw_init = si_common_hw_init,
>> - .hw_fini = si_common_hw_fini,
>> .resume = si_common_resume,
>> .is_idle = si_common_is_idle,
>> .wait_for_idle = si_common_wait_for_idle,
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs
2024-10-17 12:18 ` Christian König
@ 2024-10-17 12:49 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:49 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
On 10/17/2024 5:48 PM, Christian König wrote:
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Remove the unused and commented out code for vcn/uvd IP's.
>> Also remove the functions which are set to NULL as these are
>> global structures and all members are set to 0 or NULL during
>> initialization.
>
> Please separate that into two patches, one for the vcn/uvd stuff and
> one for the rest.
Sure
>
> Leo needs to take a look at the VCN/UVD stuff, but I think it is ok to
> remove that.
For all the unused code defined between #if endif i did confirmed with
leo to clean up but i will split and add leo too in the review.
>
> Regards,
> Christian.
>
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 4 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 4 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/cik.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/nv.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/si.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/soc15.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/soc21.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
>> drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
>> drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vi.c | 2 -
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
>> drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 2 -
>> drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 2 -
>> .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 2 -
>> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
>> 70 files changed, 790 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> index 8b7e056a7355..ec5e0dcf8613 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
>> @@ -603,8 +603,6 @@ static int acp_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs acp_ip_funcs = {
>> .name = "acp_ip",
>> - .early_init = NULL,
>> - .late_init = NULL,
>> .sw_init = acp_sw_init,
>> .sw_fini = acp_sw_fini,
>> .hw_init = acp_hw_init,
>> @@ -614,8 +612,6 @@ static const struct amd_ip_funcs acp_ip_funcs = {
>> .is_idle = acp_is_idle,
>> .set_clockgating_state = acp_set_clockgating_state,
>> .set_powergating_state = acp_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version acp_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> index acc8a4b2732b..b6e4a8226832 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
>> @@ -143,7 +143,6 @@ static int isp_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs isp_ip_funcs = {
>> .name = "isp_ip",
>> .early_init = isp_early_init,
>> - .late_init = NULL,
>> .hw_init = isp_hw_init,
>> .hw_fini = isp_hw_fini,
>> .is_idle = isp_is_idle,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> index cad153e333d8..abd5e980c9c7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
>> @@ -4095,17 +4095,12 @@ const struct attribute_group
>> amdgpu_flash_attr_group = {
>> const struct amd_ip_funcs psp_ip_funcs = {
>> .name = "psp",
>> .early_init = psp_early_init,
>> - .late_init = NULL,
>> .sw_init = psp_sw_init,
>> .sw_fini = psp_sw_fini,
>> .hw_init = psp_hw_init,
>> .hw_fini = psp_hw_fini,
>> .suspend = psp_suspend,
>> .resume = psp_resume,
>> - .is_idle = NULL,
>> - .check_soft_reset = NULL,
>> - .wait_for_idle = NULL,
>> - .soft_reset = NULL,
>> .set_clockgating_state = psp_set_clockgating_state,
>> .set_powergating_state = psp_set_powergating_state,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
>> index 3ef75f1a47f6..bd2d3863c3ed 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c
>> @@ -993,8 +993,6 @@ static const struct amd_ip_funcs
>> umsch_mm_v4_0_ip_funcs = {
>> .hw_fini = umsch_mm_hw_fini,
>> .suspend = umsch_mm_suspend,
>> .resume = umsch_mm_resume,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version umsch_mm_v4_0_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> index 6850a27f724f..52e01e09a1b3 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c
>> @@ -641,8 +641,6 @@ static int amdgpu_vkms_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs amdgpu_vkms_ip_funcs = {
>> .name = "amdgpu_vkms",
>> - .early_init = NULL,
>> - .late_init = NULL,
>> .sw_init = amdgpu_vkms_sw_init,
>> .sw_fini = amdgpu_vkms_sw_fini,
>> .hw_init = amdgpu_vkms_hw_init,
>> @@ -651,8 +649,6 @@ static const struct amd_ip_funcs
>> amdgpu_vkms_ip_funcs = {
>> .is_idle = amdgpu_vkms_is_idle,
>> .set_clockgating_state = amdgpu_vkms_set_clockgating_state,
>> .set_powergating_state = amdgpu_vkms_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version amdgpu_vkms_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> index 6d96e1f21e20..46713a158d90 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
>> @@ -906,14 +906,12 @@ static void vpe_set_ring_funcs(struct
>> amdgpu_device *adev)
>> const struct amd_ip_funcs vpe_ip_funcs = {
>> .name = "vpe_v6_1",
>> .early_init = vpe_early_init,
>> - .late_init = NULL,
>> .sw_init = vpe_sw_init,
>> .sw_fini = vpe_sw_fini,
>> .hw_init = vpe_hw_init,
>> .hw_fini = vpe_hw_fini,
>> .suspend = vpe_suspend,
>> .resume = vpe_resume,
>> - .soft_reset = NULL,
>> .set_clockgating_state = vpe_set_clockgating_state,
>> .set_powergating_state = vpe_set_powergating_state,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c
>> b/drivers/gpu/drm/amd/amdgpu/cik.c
>> index d7a843280059..23b712fda53d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik.c
>> @@ -2171,15 +2171,12 @@ static int
>> cik_common_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs cik_common_ip_funcs = {
>> .name = "cik_common",
>> .early_init = cik_common_early_init,
>> - .late_init = NULL,
>> .hw_init = cik_common_hw_init,
>> .resume = cik_common_resume,
>> .is_idle = cik_common_is_idle,
>> .soft_reset = cik_common_soft_reset,
>> .set_clockgating_state = cik_common_set_clockgating_state,
>> .set_powergating_state = cik_common_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ip_block_version cik_common_ip_block =
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
>> index 9e9a58fd86ce..1da17755ad53 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik_ih.c
>> @@ -417,7 +417,6 @@ static int cik_ih_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs cik_ih_ip_funcs = {
>> .name = "cik_ih",
>> .early_init = cik_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = cik_ih_sw_init,
>> .sw_fini = cik_ih_sw_fini,
>> .hw_init = cik_ih_hw_init,
>> @@ -429,8 +428,6 @@ static const struct amd_ip_funcs cik_ih_ip_funcs = {
>> .soft_reset = cik_ih_soft_reset,
>> .set_clockgating_state = cik_ih_set_clockgating_state,
>> .set_powergating_state = cik_ih_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs cik_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>> b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>> index df3f429e003e..ede1a028d48d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
>> @@ -1213,7 +1213,6 @@ static int cik_sdma_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs cik_sdma_ip_funcs = {
>> .name = "cik_sdma",
>> .early_init = cik_sdma_early_init,
>> - .late_init = NULL,
>> .sw_init = cik_sdma_sw_init,
>> .sw_fini = cik_sdma_sw_fini,
>> .hw_init = cik_sdma_hw_init,
>> @@ -1225,8 +1224,6 @@ static const struct amd_ip_funcs
>> cik_sdma_ip_funcs = {
>> .soft_reset = cik_sdma_soft_reset,
>> .set_clockgating_state = cik_sdma_set_clockgating_state,
>> .set_powergating_state = cik_sdma_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs cik_sdma_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
>> index cadd69a243af..d72973bd570d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/cz_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/cz_ih.c
>> @@ -415,7 +415,6 @@ static int cz_ih_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs cz_ih_ip_funcs = {
>> .name = "cz_ih",
>> .early_init = cz_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = cz_ih_sw_init,
>> .sw_fini = cz_ih_sw_fini,
>> .hw_init = cz_ih_hw_init,
>> @@ -427,8 +426,6 @@ static const struct amd_ip_funcs cz_ih_ip_funcs = {
>> .soft_reset = cz_ih_soft_reset,
>> .set_clockgating_state = cz_ih_set_clockgating_state,
>> .set_powergating_state = cz_ih_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs cz_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
>> index a5985663a867..5098c50d54c8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
>> @@ -3317,7 +3317,6 @@ static int dce_v10_0_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs dce_v10_0_ip_funcs = {
>> .name = "dce_v10_0",
>> .early_init = dce_v10_0_early_init,
>> - .late_init = NULL,
>> .sw_init = dce_v10_0_sw_init,
>> .sw_fini = dce_v10_0_sw_fini,
>> .hw_init = dce_v10_0_hw_init,
>> @@ -3329,8 +3328,6 @@ static const struct amd_ip_funcs
>> dce_v10_0_ip_funcs = {
>> .soft_reset = dce_v10_0_soft_reset,
>> .set_clockgating_state = dce_v10_0_set_clockgating_state,
>> .set_powergating_state = dce_v10_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static void
>> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
>> index 5c907a1a4778..c5680ff4ab9f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
>> @@ -3449,7 +3449,6 @@ static int dce_v11_0_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs dce_v11_0_ip_funcs = {
>> .name = "dce_v11_0",
>> .early_init = dce_v11_0_early_init,
>> - .late_init = NULL,
>> .sw_init = dce_v11_0_sw_init,
>> .sw_fini = dce_v11_0_sw_fini,
>> .hw_init = dce_v11_0_hw_init,
>> @@ -3460,8 +3459,6 @@ static const struct amd_ip_funcs
>> dce_v11_0_ip_funcs = {
>> .soft_reset = dce_v11_0_soft_reset,
>> .set_clockgating_state = dce_v11_0_set_clockgating_state,
>> .set_powergating_state = dce_v11_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static void
>> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
>> index a53e4fac89dc..eb7de9122d99 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
>> @@ -3139,7 +3139,6 @@ static int dce_v6_0_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs dce_v6_0_ip_funcs = {
>> .name = "dce_v6_0",
>> .early_init = dce_v6_0_early_init,
>> - .late_init = NULL,
>> .sw_init = dce_v6_0_sw_init,
>> .sw_fini = dce_v6_0_sw_fini,
>> .hw_init = dce_v6_0_hw_init,
>> @@ -3150,8 +3149,6 @@ static const struct amd_ip_funcs
>> dce_v6_0_ip_funcs = {
>> .soft_reset = dce_v6_0_soft_reset,
>> .set_clockgating_state = dce_v6_0_set_clockgating_state,
>> .set_powergating_state = dce_v6_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static void
>> diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
>> b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
>> index 9278e0d8d00c..04b79ff87f75 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
>> @@ -3227,7 +3227,6 @@ static int dce_v8_0_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs dce_v8_0_ip_funcs = {
>> .name = "dce_v8_0",
>> .early_init = dce_v8_0_early_init,
>> - .late_init = NULL,
>> .sw_init = dce_v8_0_sw_init,
>> .sw_fini = dce_v8_0_sw_fini,
>> .hw_init = dce_v8_0_hw_init,
>> @@ -3238,8 +3237,6 @@ static const struct amd_ip_funcs
>> dce_v8_0_ip_funcs = {
>> .soft_reset = dce_v8_0_soft_reset,
>> .set_clockgating_state = dce_v8_0_set_clockgating_state,
>> .set_powergating_state = dce_v8_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static void
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
>> index 5769055909bc..41f50bf380c4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c
>> @@ -3435,7 +3435,6 @@ static void gfx_v6_0_emit_mem_sync(struct
>> amdgpu_ring *ring)
>> static const struct amd_ip_funcs gfx_v6_0_ip_funcs = {
>> .name = "gfx_v6_0",
>> .early_init = gfx_v6_0_early_init,
>> - .late_init = NULL,
>> .sw_init = gfx_v6_0_sw_init,
>> .sw_fini = gfx_v6_0_sw_fini,
>> .hw_init = gfx_v6_0_hw_init,
>> @@ -3446,8 +3445,6 @@ static const struct amd_ip_funcs
>> gfx_v6_0_ip_funcs = {
>> .wait_for_idle = gfx_v6_0_wait_for_idle,
>> .set_clockgating_state = gfx_v6_0_set_clockgating_state,
>> .set_powergating_state = gfx_v6_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs gfx_v6_0_ring_funcs_gfx = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
>> index a683d2bfb8de..824d5913103b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
>> @@ -5005,8 +5005,6 @@ static const struct amd_ip_funcs
>> gfx_v7_0_ip_funcs = {
>> .soft_reset = gfx_v7_0_soft_reset,
>> .set_clockgating_state = gfx_v7_0_set_clockgating_state,
>> .set_powergating_state = gfx_v7_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs gfx_v7_0_ring_funcs_gfx = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> index 8b72463fd5c0..480c41ee947e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> @@ -6948,8 +6948,6 @@ static const struct amd_ip_funcs
>> gfx_v8_0_ip_funcs = {
>> .set_clockgating_state = gfx_v8_0_set_clockgating_state,
>> .set_powergating_state = gfx_v8_0_set_powergating_state,
>> .get_clockgating_state = gfx_v8_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs gfx_v8_0_ring_funcs_gfx = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> index c1e2f1d79e74..ca000b3d1afc 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
>> @@ -1121,8 +1121,6 @@ static const struct amd_ip_funcs
>> gmc_v6_0_ip_funcs = {
>> .soft_reset = gmc_v6_0_soft_reset,
>> .set_clockgating_state = gmc_v6_0_set_clockgating_state,
>> .set_powergating_state = gmc_v6_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_gmc_funcs gmc_v6_0_gmc_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> index 54a48662f3b5..07f45f1a503a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c
>> @@ -1348,8 +1348,6 @@ static const struct amd_ip_funcs
>> gmc_v7_0_ip_funcs = {
>> .soft_reset = gmc_v7_0_soft_reset,
>> .set_clockgating_state = gmc_v7_0_set_clockgating_state,
>> .set_powergating_state = gmc_v7_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_gmc_funcs gmc_v7_0_gmc_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> index c4f2ad32c078..12d5967ecd45 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
>> @@ -1722,8 +1722,6 @@ static const struct amd_ip_funcs
>> gmc_v8_0_ip_funcs = {
>> .set_clockgating_state = gmc_v8_0_set_clockgating_state,
>> .set_powergating_state = gmc_v8_0_set_powergating_state,
>> .get_clockgating_state = gmc_v8_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_gmc_funcs gmc_v8_0_gmc_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
>> index a3fb01f905d4..7f45e93c0397 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/iceland_ih.c
>> @@ -407,7 +407,6 @@ static int iceland_ih_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs iceland_ih_ip_funcs = {
>> .name = "iceland_ih",
>> .early_init = iceland_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = iceland_ih_sw_init,
>> .sw_fini = iceland_ih_sw_fini,
>> .hw_init = iceland_ih_hw_init,
>> @@ -419,8 +418,6 @@ static const struct amd_ip_funcs
>> iceland_ih_ip_funcs = {
>> .soft_reset = iceland_ih_soft_reset,
>> .set_clockgating_state = iceland_ih_set_clockgating_state,
>> .set_powergating_state = iceland_ih_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs iceland_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
>> index 09403eac483b..38f953fd65d9 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_0.c
>> @@ -779,7 +779,6 @@ static void ih_v6_0_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs ih_v6_0_ip_funcs = {
>> .name = "ih_v6_0",
>> .early_init = ih_v6_0_early_init,
>> - .late_init = NULL,
>> .sw_init = ih_v6_0_sw_init,
>> .sw_fini = ih_v6_0_sw_fini,
>> .hw_init = ih_v6_0_hw_init,
>> @@ -792,8 +791,6 @@ static const struct amd_ip_funcs ih_v6_0_ip_funcs
>> = {
>> .set_clockgating_state = ih_v6_0_set_clockgating_state,
>> .set_powergating_state = ih_v6_0_set_powergating_state,
>> .get_clockgating_state = ih_v6_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs ih_v6_0_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
>> b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
>> index 9706d7593d26..61381e0c3795 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v6_1.c
>> @@ -762,7 +762,6 @@ static void ih_v6_1_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs ih_v6_1_ip_funcs = {
>> .name = "ih_v6_1",
>> .early_init = ih_v6_1_early_init,
>> - .late_init = NULL,
>> .sw_init = ih_v6_1_sw_init,
>> .sw_fini = ih_v6_1_sw_fini,
>> .hw_init = ih_v6_1_hw_init,
>> @@ -775,8 +774,6 @@ static const struct amd_ip_funcs ih_v6_1_ip_funcs
>> = {
>> .set_clockgating_state = ih_v6_1_set_clockgating_state,
>> .set_powergating_state = ih_v6_1_set_powergating_state,
>> .get_clockgating_state = ih_v6_1_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs ih_v6_1_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
>> b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
>> index 9657145d7cce..d2428cf5d385 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
>> @@ -752,7 +752,6 @@ static void ih_v7_0_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs ih_v7_0_ip_funcs = {
>> .name = "ih_v7_0",
>> .early_init = ih_v7_0_early_init,
>> - .late_init = NULL,
>> .sw_init = ih_v7_0_sw_init,
>> .sw_fini = ih_v7_0_sw_fini,
>> .hw_init = ih_v7_0_hw_init,
>> @@ -765,8 +764,6 @@ static const struct amd_ip_funcs ih_v7_0_ip_funcs
>> = {
>> .set_clockgating_state = ih_v7_0_set_clockgating_state,
>> .set_powergating_state = ih_v7_0_set_powergating_state,
>> .get_clockgating_state = ih_v7_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs ih_v7_0_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
>> index 6762b5c64ccb..d6823fb45d32 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c
>> @@ -742,7 +742,6 @@ static int jpeg_v2_0_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v2_0_ip_funcs = {
>> .name = "jpeg_v2_0",
>> .early_init = jpeg_v2_0_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v2_0_sw_init,
>> .sw_fini = jpeg_v2_0_sw_fini,
>> .hw_init = jpeg_v2_0_hw_init,
>> @@ -751,14 +750,8 @@ static const struct amd_ip_funcs
>> jpeg_v2_0_ip_funcs = {
>> .resume = jpeg_v2_0_resume,
>> .is_idle = jpeg_v2_0_is_idle,
>> .wait_for_idle = jpeg_v2_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v2_0_set_clockgating_state,
>> .set_powergating_state = jpeg_v2_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs jpeg_v2_0_dec_ring_vm_funcs
>> = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
>> index 4b8c801f204d..5063a38801d6 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c
>> @@ -613,7 +613,6 @@ static int jpeg_v2_5_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v2_5_ip_funcs = {
>> .name = "jpeg_v2_5",
>> .early_init = jpeg_v2_5_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v2_5_sw_init,
>> .sw_fini = jpeg_v2_5_sw_fini,
>> .hw_init = jpeg_v2_5_hw_init,
>> @@ -622,20 +621,13 @@ static const struct amd_ip_funcs
>> jpeg_v2_5_ip_funcs = {
>> .resume = jpeg_v2_5_resume,
>> .is_idle = jpeg_v2_5_is_idle,
>> .wait_for_idle = jpeg_v2_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v2_5_set_clockgating_state,
>> .set_powergating_state = jpeg_v2_5_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amd_ip_funcs jpeg_v2_6_ip_funcs = {
>> .name = "jpeg_v2_6",
>> .early_init = jpeg_v2_5_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v2_5_sw_init,
>> .sw_fini = jpeg_v2_5_sw_fini,
>> .hw_init = jpeg_v2_5_hw_init,
>> @@ -644,14 +636,8 @@ static const struct amd_ip_funcs
>> jpeg_v2_6_ip_funcs = {
>> .resume = jpeg_v2_5_resume,
>> .is_idle = jpeg_v2_5_is_idle,
>> .wait_for_idle = jpeg_v2_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v2_5_set_clockgating_state,
>> .set_powergating_state = jpeg_v2_5_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs jpeg_v2_5_dec_ring_vm_funcs
>> = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
>> index 7996209818b6..10adbb7cbf53 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c
>> @@ -533,7 +533,6 @@ static int jpeg_v3_0_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v3_0_ip_funcs = {
>> .name = "jpeg_v3_0",
>> .early_init = jpeg_v3_0_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v3_0_sw_init,
>> .sw_fini = jpeg_v3_0_sw_fini,
>> .hw_init = jpeg_v3_0_hw_init,
>> @@ -542,14 +541,8 @@ static const struct amd_ip_funcs
>> jpeg_v3_0_ip_funcs = {
>> .resume = jpeg_v3_0_resume,
>> .is_idle = jpeg_v3_0_is_idle,
>> .wait_for_idle = jpeg_v3_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v3_0_set_clockgating_state,
>> .set_powergating_state = jpeg_v3_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs jpeg_v3_0_dec_ring_vm_funcs
>> = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
>> index 20e1fe89c463..89953c0f5f1f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c
>> @@ -700,7 +700,6 @@ static int jpeg_v4_0_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v4_0_ip_funcs = {
>> .name = "jpeg_v4_0",
>> .early_init = jpeg_v4_0_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v4_0_sw_init,
>> .sw_fini = jpeg_v4_0_sw_fini,
>> .hw_init = jpeg_v4_0_hw_init,
>> @@ -709,14 +708,8 @@ static const struct amd_ip_funcs
>> jpeg_v4_0_ip_funcs = {
>> .resume = jpeg_v4_0_resume,
>> .is_idle = jpeg_v4_0_is_idle,
>> .wait_for_idle = jpeg_v4_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v4_0_set_clockgating_state,
>> .set_powergating_state = jpeg_v4_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs jpeg_v4_0_dec_ring_vm_funcs
>> = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> index 2a53537db135..6917e4a8e96a 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
>> @@ -1050,7 +1050,6 @@ static int jpeg_v4_0_3_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v4_0_3_ip_funcs = {
>> .name = "jpeg_v4_0_3",
>> .early_init = jpeg_v4_0_3_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v4_0_3_sw_init,
>> .sw_fini = jpeg_v4_0_3_sw_fini,
>> .hw_init = jpeg_v4_0_3_hw_init,
>> @@ -1059,14 +1058,8 @@ static const struct amd_ip_funcs
>> jpeg_v4_0_3_ip_funcs = {
>> .resume = jpeg_v4_0_3_resume,
>> .is_idle = jpeg_v4_0_3_is_idle,
>> .wait_for_idle = jpeg_v4_0_3_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v4_0_3_set_clockgating_state,
>> .set_powergating_state = jpeg_v4_0_3_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs
>> jpeg_v4_0_3_dec_ring_vm_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
>> index ef2d4237925b..f3cce523f3cb 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
>> @@ -741,7 +741,6 @@ static int jpeg_v4_0_5_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v4_0_5_ip_funcs = {
>> .name = "jpeg_v4_0_5",
>> .early_init = jpeg_v4_0_5_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v4_0_5_sw_init,
>> .sw_fini = jpeg_v4_0_5_sw_fini,
>> .hw_init = jpeg_v4_0_5_hw_init,
>> @@ -750,14 +749,8 @@ static const struct amd_ip_funcs
>> jpeg_v4_0_5_ip_funcs = {
>> .resume = jpeg_v4_0_5_resume,
>> .is_idle = jpeg_v4_0_5_is_idle,
>> .wait_for_idle = jpeg_v4_0_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v4_0_5_set_clockgating_state,
>> .set_powergating_state = jpeg_v4_0_5_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs
>> jpeg_v4_0_5_dec_ring_vm_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
>> b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
>> index 7954a6fae464..06840d1dae79 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c
>> @@ -620,7 +620,6 @@ static int jpeg_v5_0_0_process_interrupt(struct
>> amdgpu_device *adev,
>> static const struct amd_ip_funcs jpeg_v5_0_0_ip_funcs = {
>> .name = "jpeg_v5_0_0",
>> .early_init = jpeg_v5_0_0_early_init,
>> - .late_init = NULL,
>> .sw_init = jpeg_v5_0_0_sw_init,
>> .sw_fini = jpeg_v5_0_0_sw_fini,
>> .hw_init = jpeg_v5_0_0_hw_init,
>> @@ -629,14 +628,8 @@ static const struct amd_ip_funcs
>> jpeg_v5_0_0_ip_funcs = {
>> .resume = jpeg_v5_0_0_resume,
>> .is_idle = jpeg_v5_0_0_is_idle,
>> .wait_for_idle = jpeg_v5_0_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = jpeg_v5_0_0_set_clockgating_state,
>> .set_powergating_state = jpeg_v5_0_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs
>> jpeg_v5_0_0_dec_ring_vm_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> index 2edfe86a866b..8ca137313961 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/mes_v11_0.c
>> @@ -1707,8 +1707,6 @@ static const struct amd_ip_funcs
>> mes_v11_0_ip_funcs = {
>> .hw_fini = mes_v11_0_hw_fini,
>> .suspend = mes_v11_0_suspend,
>> .resume = mes_v11_0_resume,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version mes_v11_0_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
>> index 93da900b7ee2..0820ed62e2e8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/navi10_ih.c
>> @@ -694,7 +694,6 @@ static void navi10_ih_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs navi10_ih_ip_funcs = {
>> .name = "navi10_ih",
>> .early_init = navi10_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = navi10_ih_sw_init,
>> .sw_fini = navi10_ih_sw_fini,
>> .hw_init = navi10_ih_hw_init,
>> @@ -707,8 +706,6 @@ static const struct amd_ip_funcs
>> navi10_ih_ip_funcs = {
>> .set_clockgating_state = navi10_ih_set_clockgating_state,
>> .set_powergating_state = navi10_ih_set_powergating_state,
>> .get_clockgating_state = navi10_ih_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs navi10_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c
>> b/drivers/gpu/drm/amd/amdgpu/nv.c
>> index c16f724384cd..6b72169be8f8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
>> @@ -1104,6 +1104,4 @@ static const struct amd_ip_funcs
>> nv_common_ip_funcs = {
>> .set_clockgating_state = nv_common_set_clockgating_state,
>> .set_powergating_state = nv_common_set_powergating_state,
>> .get_clockgating_state = nv_common_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>> index 10fd772cb80f..7948d74f8722 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
>> @@ -1096,7 +1096,6 @@ static int sdma_v2_4_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs sdma_v2_4_ip_funcs = {
>> .name = "sdma_v2_4",
>> .early_init = sdma_v2_4_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v2_4_sw_init,
>> .sw_fini = sdma_v2_4_sw_fini,
>> .hw_init = sdma_v2_4_hw_init,
>> @@ -1108,8 +1107,6 @@ static const struct amd_ip_funcs
>> sdma_v2_4_ip_funcs = {
>> .soft_reset = sdma_v2_4_soft_reset,
>> .set_clockgating_state = sdma_v2_4_set_clockgating_state,
>> .set_powergating_state = sdma_v2_4_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs sdma_v2_4_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>> index 69fba087e09c..9a3d729545a7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
>> @@ -1534,7 +1534,6 @@ static void
>> sdma_v3_0_get_clockgating_state(void *handle, u64 *flags)
>> static const struct amd_ip_funcs sdma_v3_0_ip_funcs = {
>> .name = "sdma_v3_0",
>> .early_init = sdma_v3_0_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v3_0_sw_init,
>> .sw_fini = sdma_v3_0_sw_fini,
>> .hw_init = sdma_v3_0_hw_init,
>> @@ -1550,8 +1549,6 @@ static const struct amd_ip_funcs
>> sdma_v3_0_ip_funcs = {
>> .set_clockgating_state = sdma_v3_0_set_clockgating_state,
>> .set_powergating_state = sdma_v3_0_set_powergating_state,
>> .get_clockgating_state = sdma_v3_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>> index 6a675daf5620..d31c4860933f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c
>> @@ -1929,7 +1929,6 @@ static void sdma_v5_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs sdma_v5_0_ip_funcs = {
>> .name = "sdma_v5_0",
>> .early_init = sdma_v5_0_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v5_0_sw_init,
>> .sw_fini = sdma_v5_0_sw_fini,
>> .hw_init = sdma_v5_0_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> index e1413ccaf7e4..ffa8c62ac101 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
>> @@ -1918,7 +1918,6 @@ static void sdma_v5_2_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs sdma_v5_2_ip_funcs = {
>> .name = "sdma_v5_2",
>> .early_init = sdma_v5_2_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v5_2_sw_init,
>> .sw_fini = sdma_v5_2_sw_fini,
>> .hw_init = sdma_v5_2_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
>> index 4856a093e23f..449d515e6b67 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c
>> @@ -1649,7 +1649,6 @@ static void sdma_v6_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> const struct amd_ip_funcs sdma_v6_0_ip_funcs = {
>> .name = "sdma_v6_0",
>> .early_init = sdma_v6_0_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v6_0_sw_init,
>> .sw_fini = sdma_v6_0_sw_fini,
>> .hw_init = sdma_v6_0_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
>> b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
>> index 24f24974ac1d..dfd4b08e4b47 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c
>> @@ -1579,7 +1579,6 @@ static void sdma_v7_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> const struct amd_ip_funcs sdma_v7_0_ip_funcs = {
>> .name = "sdma_v7_0",
>> .early_init = sdma_v7_0_early_init,
>> - .late_init = NULL,
>> .sw_init = sdma_v7_0_sw_init,
>> .sw_fini = sdma_v7_0_sw_fini,
>> .hw_init = sdma_v7_0_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/si.c
>> b/drivers/gpu/drm/amd/amdgpu/si.c
>> index 6d8d5547d18b..82d6f5aabb1d 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/si.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/si.c
>> @@ -2659,14 +2659,11 @@ static int
>> si_common_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs si_common_ip_funcs = {
>> .name = "si_common",
>> .early_init = si_common_early_init,
>> - .late_init = NULL,
>> .hw_init = si_common_hw_init,
>> .resume = si_common_resume,
>> .is_idle = si_common_is_idle,
>> .set_clockgating_state = si_common_set_clockgating_state,
>> .set_powergating_state = si_common_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ip_block_version si_common_ip_block =
>> diff --git a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>> b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>> index d44483ed3363..47647a6083e8 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/si_dma.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/si_dma.c
>> @@ -691,7 +691,6 @@ static int si_dma_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs si_dma_ip_funcs = {
>> .name = "si_dma",
>> .early_init = si_dma_early_init,
>> - .late_init = NULL,
>> .sw_init = si_dma_sw_init,
>> .sw_fini = si_dma_sw_fini,
>> .hw_init = si_dma_hw_init,
>> @@ -703,8 +702,6 @@ static const struct amd_ip_funcs si_dma_ip_funcs = {
>> .soft_reset = si_dma_soft_reset,
>> .set_clockgating_state = si_dma_set_clockgating_state,
>> .set_powergating_state = si_dma_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs si_dma_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/si_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/si_ih.c
>> index b018a3b90401..2ec1ebe4db11 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/si_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/si_ih.c
>> @@ -278,7 +278,6 @@ static int si_ih_set_powergating_state(void *handle,
>> static const struct amd_ip_funcs si_ih_ip_funcs = {
>> .name = "si_ih",
>> .early_init = si_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = si_ih_sw_init,
>> .sw_fini = si_ih_sw_fini,
>> .hw_init = si_ih_hw_init,
>> @@ -290,8 +289,6 @@ static const struct amd_ip_funcs si_ih_ip_funcs = {
>> .soft_reset = si_ih_soft_reset,
>> .set_clockgating_state = si_ih_set_clockgating_state,
>> .set_powergating_state = si_ih_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs si_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c
>> b/drivers/gpu/drm/amd/amdgpu/soc15.c
>> index 19391cbc1474..93e44e7ee3fa 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
>> @@ -1494,6 +1494,4 @@ static const struct amd_ip_funcs
>> soc15_common_ip_funcs = {
>> .set_clockgating_state = soc15_common_set_clockgating_state,
>> .set_powergating_state = soc15_common_set_powergating_state,
>> .get_clockgating_state= soc15_common_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c
>> b/drivers/gpu/drm/amd/amdgpu/soc21.c
>> index 078f25b5f09b..1c07ebdc0d1f 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
>> @@ -993,6 +993,4 @@ static const struct amd_ip_funcs
>> soc21_common_ip_funcs = {
>> .set_clockgating_state = soc21_common_set_clockgating_state,
>> .set_powergating_state = soc21_common_set_powergating_state,
>> .get_clockgating_state = soc21_common_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
>> index 45fb5140c8b7..5a04a6770138 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/tonga_ih.c
>> @@ -463,7 +463,6 @@ static int tonga_ih_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs tonga_ih_ip_funcs = {
>> .name = "tonga_ih",
>> .early_init = tonga_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = tonga_ih_sw_init,
>> .sw_fini = tonga_ih_sw_fini,
>> .hw_init = tonga_ih_hw_init,
>> @@ -478,8 +477,6 @@ static const struct amd_ip_funcs
>> tonga_ih_ip_funcs = {
>> .post_soft_reset = tonga_ih_post_soft_reset,
>> .set_clockgating_state = tonga_ih_set_clockgating_state,
>> .set_powergating_state = tonga_ih_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ih_funcs tonga_ih_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
>> b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
>> index 3011b5853fb4..bdbca25d80c4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
>> @@ -805,7 +805,6 @@ static int uvd_v3_1_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs uvd_v3_1_ip_funcs = {
>> .name = "uvd_v3_1",
>> .early_init = uvd_v3_1_early_init,
>> - .late_init = NULL,
>> .sw_init = uvd_v3_1_sw_init,
>> .sw_fini = uvd_v3_1_sw_fini,
>> .hw_init = uvd_v3_1_hw_init,
>> @@ -818,8 +817,6 @@ static const struct amd_ip_funcs
>> uvd_v3_1_ip_funcs = {
>> .soft_reset = uvd_v3_1_soft_reset,
>> .set_clockgating_state = uvd_v3_1_set_clockgating_state,
>> .set_powergating_state = uvd_v3_1_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version uvd_v3_1_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
>> b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
>> index 4852a2ab128f..a836dc9cfcad 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c
>> @@ -755,7 +755,6 @@ static int uvd_v4_2_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
>> .name = "uvd_v4_2",
>> .early_init = uvd_v4_2_early_init,
>> - .late_init = NULL,
>> .sw_init = uvd_v4_2_sw_init,
>> .sw_fini = uvd_v4_2_sw_fini,
>> .hw_init = uvd_v4_2_hw_init,
>> @@ -768,8 +767,6 @@ static const struct amd_ip_funcs
>> uvd_v4_2_ip_funcs = {
>> .soft_reset = uvd_v4_2_soft_reset,
>> .set_clockgating_state = uvd_v4_2_set_clockgating_state,
>> .set_powergating_state = uvd_v4_2_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>> b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>> index a24b210c79ac..ab55fae3569e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c
>> @@ -867,7 +867,6 @@ static void uvd_v5_0_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
>> .name = "uvd_v5_0",
>> .early_init = uvd_v5_0_early_init,
>> - .late_init = NULL,
>> .sw_init = uvd_v5_0_sw_init,
>> .sw_fini = uvd_v5_0_sw_fini,
>> .hw_init = uvd_v5_0_hw_init,
>> @@ -881,8 +880,6 @@ static const struct amd_ip_funcs
>> uvd_v5_0_ip_funcs = {
>> .set_clockgating_state = uvd_v5_0_set_clockgating_state,
>> .set_powergating_state = uvd_v5_0_set_powergating_state,
>> .get_clockgating_state = uvd_v5_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
>> b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
>> index b4eeeebfe095..39f8c3d3a135 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c
>> @@ -1532,7 +1532,6 @@ static void uvd_v6_0_get_clockgating_state(void
>> *handle, u64 *flags)
>> static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
>> .name = "uvd_v6_0",
>> .early_init = uvd_v6_0_early_init,
>> - .late_init = NULL,
>> .sw_init = uvd_v6_0_sw_init,
>> .sw_fini = uvd_v6_0_sw_fini,
>> .hw_init = uvd_v6_0_hw_init,
>> @@ -1549,8 +1548,6 @@ static const struct amd_ip_funcs
>> uvd_v6_0_ip_funcs = {
>> .set_clockgating_state = uvd_v6_0_set_clockgating_state,
>> .set_powergating_state = uvd_v6_0_set_powergating_state,
>> .get_clockgating_state = uvd_v6_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> index 55fa858328f6..f909a60a8853 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c
>> @@ -1462,104 +1462,6 @@ static void
>> uvd_v7_0_enc_ring_emit_wreg(struct amdgpu_ring *ring,
>> amdgpu_ring_write(ring, val);
>> }
>> -#if 0
>> -static bool uvd_v7_0_is_idle(void *handle)
>> -{
>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> -
>> - return !(RREG32(mmSRBM_STATUS) & SRBM_STATUS__UVD_BUSY_MASK);
>> -}
>> -
>> -static int uvd_v7_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
>> -{
>> - unsigned i;
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - for (i = 0; i < adev->usec_timeout; i++) {
>> - if (uvd_v7_0_is_idle(handle))
>> - return 0;
>> - }
>> - return -ETIMEDOUT;
>> -}
>> -
>> -#define AMDGPU_UVD_STATUS_BUSY_MASK 0xfd
>> -static bool uvd_v7_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> - u32 srbm_soft_reset = 0;
>> - u32 tmp = RREG32(mmSRBM_STATUS);
>> -
>> - if (REG_GET_FIELD(tmp, SRBM_STATUS, UVD_RQ_PENDING) ||
>> - REG_GET_FIELD(tmp, SRBM_STATUS, UVD_BUSY) ||
>> - (RREG32_SOC15(UVD, ring->me, mmUVD_STATUS) &
>> - AMDGPU_UVD_STATUS_BUSY_MASK))
>> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
>> - SRBM_SOFT_RESET, SOFT_RESET_UVD, 1);
>> -
>> - if (srbm_soft_reset) {
>> - adev->uvd.inst[ring->me].srbm_soft_reset = srbm_soft_reset;
>> - return true;
>> - } else {
>> - adev->uvd.inst[ring->me].srbm_soft_reset = 0;
>> - return false;
>> - }
>> -}
>> -
>> -static int uvd_v7_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
>> - return 0;
>> -
>> - uvd_v7_0_stop(adev);
>> - return 0;
>> -}
>> -
>> -static int uvd_v7_0_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> - u32 srbm_soft_reset;
>> -
>> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
>> - return 0;
>> - srbm_soft_reset = adev->uvd.inst[ring->me].srbm_soft_reset;
>> -
>> - if (srbm_soft_reset) {
>> - u32 tmp;
>> -
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> - tmp |= srbm_soft_reset;
>> - dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
>> - WREG32(mmSRBM_SOFT_RESET, tmp);
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> -
>> - udelay(50);
>> -
>> - tmp &= ~srbm_soft_reset;
>> - WREG32(mmSRBM_SOFT_RESET, tmp);
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> -
>> - /* Wait a little for things to settle down */
>> - udelay(50);
>> - }
>> -
>> - return 0;
>> -}
>> -
>> -static int uvd_v7_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - if (!adev->uvd.inst[ring->me].srbm_soft_reset)
>> - return 0;
>> -
>> - mdelay(5);
>> -
>> - return uvd_v7_0_start(adev);
>> -}
>> -#endif
>> -
>> static int uvd_v7_0_set_interrupt_state(struct amdgpu_device *adev,
>> struct amdgpu_irq_src *source,
>> unsigned type,
>> @@ -1609,187 +1511,9 @@ static int uvd_v7_0_process_interrupt(struct
>> amdgpu_device *adev,
>> return 0;
>> }
>> -#if 0
>> -static void uvd_v7_0_set_sw_clock_gating(struct amdgpu_device *adev)
>> -{
>> - uint32_t data, data1, data2, suvd_flags;
>> -
>> - data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL);
>> - data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
>> - data2 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL);
>> -
>> - data &= ~(UVD_CGC_CTRL__CLK_OFF_DELAY_MASK |
>> - UVD_CGC_CTRL__CLK_GATE_DLY_TIMER_MASK);
>> -
>> - suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
>> - UVD_SUVD_CGC_GATE__SIT_MASK |
>> - UVD_SUVD_CGC_GATE__SMP_MASK |
>> - UVD_SUVD_CGC_GATE__SCM_MASK |
>> - UVD_SUVD_CGC_GATE__SDB_MASK;
>> -
>> - data |= UVD_CGC_CTRL__DYN_CLOCK_MODE_MASK |
>> - (1 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_GATE_DLY_TIMER)) |
>> - (4 << REG_FIELD_SHIFT(UVD_CGC_CTRL, CLK_OFF_DELAY));
>> -
>> - data &= ~(UVD_CGC_CTRL__UDEC_RE_MODE_MASK |
>> - UVD_CGC_CTRL__UDEC_CM_MODE_MASK |
>> - UVD_CGC_CTRL__UDEC_IT_MODE_MASK |
>> - UVD_CGC_CTRL__UDEC_DB_MODE_MASK |
>> - UVD_CGC_CTRL__UDEC_MP_MODE_MASK |
>> - UVD_CGC_CTRL__SYS_MODE_MASK |
>> - UVD_CGC_CTRL__UDEC_MODE_MASK |
>> - UVD_CGC_CTRL__MPEG2_MODE_MASK |
>> - UVD_CGC_CTRL__REGS_MODE_MASK |
>> - UVD_CGC_CTRL__RBC_MODE_MASK |
>> - UVD_CGC_CTRL__LMI_MC_MODE_MASK |
>> - UVD_CGC_CTRL__LMI_UMC_MODE_MASK |
>> - UVD_CGC_CTRL__IDCT_MODE_MASK |
>> - UVD_CGC_CTRL__MPRD_MODE_MASK |
>> - UVD_CGC_CTRL__MPC_MODE_MASK |
>> - UVD_CGC_CTRL__LBSI_MODE_MASK |
>> - UVD_CGC_CTRL__LRBBM_MODE_MASK |
>> - UVD_CGC_CTRL__WCB_MODE_MASK |
>> - UVD_CGC_CTRL__VCPU_MODE_MASK |
>> - UVD_CGC_CTRL__JPEG_MODE_MASK |
>> - UVD_CGC_CTRL__JPEG2_MODE_MASK |
>> - UVD_CGC_CTRL__SCPU_MODE_MASK);
>> - data2 &= ~(UVD_SUVD_CGC_CTRL__SRE_MODE_MASK |
>> - UVD_SUVD_CGC_CTRL__SIT_MODE_MASK |
>> - UVD_SUVD_CGC_CTRL__SMP_MODE_MASK |
>> - UVD_SUVD_CGC_CTRL__SCM_MODE_MASK |
>> - UVD_SUVD_CGC_CTRL__SDB_MODE_MASK);
>> - data1 |= suvd_flags;
>> -
>> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_CTRL, data);
>> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, 0);
>> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
>> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_CTRL, data2);
>> -}
>> -
>> -static void uvd_v7_0_set_hw_clock_gating(struct amdgpu_device *adev)
>> -{
>> - uint32_t data, data1, cgc_flags, suvd_flags;
>> -
>> - data = RREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE);
>> - data1 = RREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE);
>> -
>> - cgc_flags = UVD_CGC_GATE__SYS_MASK |
>> - UVD_CGC_GATE__UDEC_MASK |
>> - UVD_CGC_GATE__MPEG2_MASK |
>> - UVD_CGC_GATE__RBC_MASK |
>> - UVD_CGC_GATE__LMI_MC_MASK |
>> - UVD_CGC_GATE__IDCT_MASK |
>> - UVD_CGC_GATE__MPRD_MASK |
>> - UVD_CGC_GATE__MPC_MASK |
>> - UVD_CGC_GATE__LBSI_MASK |
>> - UVD_CGC_GATE__LRBBM_MASK |
>> - UVD_CGC_GATE__UDEC_RE_MASK |
>> - UVD_CGC_GATE__UDEC_CM_MASK |
>> - UVD_CGC_GATE__UDEC_IT_MASK |
>> - UVD_CGC_GATE__UDEC_DB_MASK |
>> - UVD_CGC_GATE__UDEC_MP_MASK |
>> - UVD_CGC_GATE__WCB_MASK |
>> - UVD_CGC_GATE__VCPU_MASK |
>> - UVD_CGC_GATE__SCPU_MASK |
>> - UVD_CGC_GATE__JPEG_MASK |
>> - UVD_CGC_GATE__JPEG2_MASK;
>> -
>> - suvd_flags = UVD_SUVD_CGC_GATE__SRE_MASK |
>> - UVD_SUVD_CGC_GATE__SIT_MASK |
>> - UVD_SUVD_CGC_GATE__SMP_MASK |
>> - UVD_SUVD_CGC_GATE__SCM_MASK |
>> - UVD_SUVD_CGC_GATE__SDB_MASK;
>> -
>> - data |= cgc_flags;
>> - data1 |= suvd_flags;
>> -
>> - WREG32_SOC15(UVD, ring->me, mmUVD_CGC_GATE, data);
>> - WREG32_SOC15(UVD, ring->me, mmUVD_SUVD_CGC_GATE, data1);
>> -}
>> -
>> -static void uvd_v7_0_set_bypass_mode(struct amdgpu_device *adev,
>> bool enable)
>> -{
>> - u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
>> -
>> - if (enable)
>> - tmp |= (GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
>> - GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
>> - else
>> - tmp &= ~(GCK_DFS_BYPASS_CNTL__BYPASSDCLK_MASK |
>> - GCK_DFS_BYPASS_CNTL__BYPASSVCLK_MASK);
>> -
>> - WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
>> -}
>> -
>> -
>> -static int uvd_v7_0_set_clockgating_state(void *handle,
>> - enum amd_clockgating_state state)
>> -{
>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> - bool enable = (state == AMD_CG_STATE_GATE);
>> - struct amdgpu_ip_block *ip_block;
>> -
>> - ip_block = amdgpu_device_ip_get_ip_block(adev,
>> AMD_IP_BLOCK_TYPE_UVD);
>> - if (!ip_block)
>> - return -EINVAL;
>> -
>> - uvd_v7_0_set_bypass_mode(adev, enable);
>> -
>> - if (!(adev->cg_flags & AMD_CG_SUPPORT_UVD_MGCG))
>> - return 0;
>> -
>> - if (enable) {
>> - /* disable HW gating and enable Sw gating */
>> - uvd_v7_0_set_sw_clock_gating(adev);
>> - } else {
>> - /* wait for STATUS to clear */
>> - if (uvd_v7_0_wait_for_idle(ip_block))
>> - return -EBUSY;
>> -
>> - /* enable HW gates because UVD is idle */
>> - /* uvd_v7_0_set_hw_clock_gating(adev); */
>> - }
>> -
>> - return 0;
>> -}
>> -
>> -static int uvd_v7_0_set_powergating_state(void *handle,
>> - enum amd_powergating_state state)
>> -{
>> - /* This doesn't actually powergate the UVD block.
>> - * That's done in the dpm code via the SMC. This
>> - * just re-inits the block as necessary. The actual
>> - * gating still happens in the dpm code. We should
>> - * revisit this when there is a cleaner line between
>> - * the smc and the hw blocks
>> - */
>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> -
>> - if (!(adev->pg_flags & AMD_PG_SUPPORT_UVD))
>> - return 0;
>> -
>> - WREG32_SOC15(UVD, ring->me, mmUVD_POWER_STATUS,
>> UVD_POWER_STATUS__UVD_PG_EN_MASK);
>> -
>> - if (state == AMD_PG_STATE_GATE) {
>> - uvd_v7_0_stop(adev);
>> - return 0;
>> - } else {
>> - return uvd_v7_0_start(adev);
>> - }
>> -}
>> -#endif
>> -
>> -static int uvd_v7_0_set_clockgating_state(void *handle,
>> - enum amd_clockgating_state state)
>> -{
>> - /* needed for driver unload*/
>> - return 0;
>> -}
>> -
>> const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
>> .name = "uvd_v7_0",
>> .early_init = uvd_v7_0_early_init,
>> - .late_init = NULL,
>> .sw_init = uvd_v7_0_sw_init,
>> .sw_fini = uvd_v7_0_sw_fini,
>> .hw_init = uvd_v7_0_hw_init,
>> @@ -1797,14 +1521,6 @@ const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
>> .prepare_suspend = uvd_v7_0_prepare_suspend,
>> .suspend = uvd_v7_0_suspend,
>> .resume = uvd_v7_0_resume,
>> - .is_idle = NULL /* uvd_v7_0_is_idle */,
>> - .wait_for_idle = NULL /* uvd_v7_0_wait_for_idle */,
>> - .check_soft_reset = NULL /* uvd_v7_0_check_soft_reset */,
>> - .pre_soft_reset = NULL /* uvd_v7_0_pre_soft_reset */,
>> - .soft_reset = NULL /* uvd_v7_0_soft_reset */,
>> - .post_soft_reset = NULL /* uvd_v7_0_post_soft_reset */,
>> - .set_clockgating_state = uvd_v7_0_set_clockgating_state,
>> - .set_powergating_state = NULL /* uvd_v7_0_set_powergating_state */,
>> };
>> static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
>> index a4531000ec0b..c1ed91b39415 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v2_0.c
>> @@ -617,7 +617,6 @@ static int vce_v2_0_set_powergating_state(void
>> *handle,
>> static const struct amd_ip_funcs vce_v2_0_ip_funcs = {
>> .name = "vce_v2_0",
>> .early_init = vce_v2_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vce_v2_0_sw_init,
>> .sw_fini = vce_v2_0_sw_fini,
>> .hw_init = vce_v2_0_hw_init,
>> @@ -629,8 +628,6 @@ static const struct amd_ip_funcs
>> vce_v2_0_ip_funcs = {
>> .soft_reset = vce_v2_0_soft_reset,
>> .set_clockgating_state = vce_v2_0_set_clockgating_state,
>> .set_powergating_state = vce_v2_0_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs vce_v2_0_ring_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
>> index 9f9a9d89bcdc..6bb318a06f19 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c
>> @@ -896,7 +896,6 @@ static void vce_v3_0_emit_pipeline_sync(struct
>> amdgpu_ring *ring)
>> static const struct amd_ip_funcs vce_v3_0_ip_funcs = {
>> .name = "vce_v3_0",
>> .early_init = vce_v3_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vce_v3_0_sw_init,
>> .sw_fini = vce_v3_0_sw_fini,
>> .hw_init = vce_v3_0_hw_init,
>> @@ -912,8 +911,6 @@ static const struct amd_ip_funcs
>> vce_v3_0_ip_funcs = {
>> .set_clockgating_state = vce_v3_0_set_clockgating_state,
>> .set_powergating_state = vce_v3_0_set_powergating_state,
>> .get_clockgating_state = vce_v3_0_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ring_funcs vce_v3_0_ring_phys_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
>> index f4d2650e6b7a..da78f69da724 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
>> @@ -543,7 +543,6 @@ static int vce_v4_0_hw_fini(struct
>> amdgpu_ip_block *ip_block)
>> cancel_delayed_work_sync(&adev->vce.idle_work);
>> if (!amdgpu_sriov_vf(adev)) {
>> - /* vce_v4_0_wait_for_idle(ip_block); */
>> vce_v4_0_stop(adev);
>> } else {
>> /* full access mode, so don't touch any VCE register */
>> @@ -691,273 +690,6 @@ static int vce_v4_0_set_clockgating_state(void
>> *handle,
>> return 0;
>> }
>> -#if 0
>> -static bool vce_v4_0_is_idle(void *handle)
>> -{
>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> - u32 mask = 0;
>> -
>> - mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE0) ? 0
>> : SRBM_STATUS2__VCE0_BUSY_MASK;
>> - mask |= (adev->vce.harvest_config & AMDGPU_VCE_HARVEST_VCE1) ? 0
>> : SRBM_STATUS2__VCE1_BUSY_MASK;
>> -
>> - return !(RREG32(mmSRBM_STATUS2) & mask);
>> -}
>> -
>> -static int vce_v4_0_wait_for_idle(struct amdgpu_ip_block *ip_block)
>> -{
>> - unsigned i;
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - for (i = 0; i < adev->usec_timeout; i++)
>> - if (vce_v4_0_is_idle(handle))
>> - return 0;
>> -
>> - return -ETIMEDOUT;
>> -}
>> -
>> -#define VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK 0x00000008L /*
>> AUTO_BUSY */
>> -#define VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK 0x00000010L /*
>> RB0_BUSY */
>> -#define VCE_STATUS_VCPU_REPORT_RB1_BUSY_MASK 0x00000020L /*
>> RB1_BUSY */
>> -#define AMDGPU_VCE_STATUS_BUSY_MASK
>> (VCE_STATUS_VCPU_REPORT_AUTO_BUSY_MASK | \
>> - VCE_STATUS_VCPU_REPORT_RB0_BUSY_MASK)
>> -
>> -static bool vce_v4_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> - u32 srbm_soft_reset = 0;
>> -
>> - /* According to VCE team , we should use VCE_STATUS instead
>> - * SRBM_STATUS.VCE_BUSY bit for busy status checking.
>> - * GRBM_GFX_INDEX.INSTANCE_INDEX is used to specify which VCE
>> - * instance's registers are accessed
>> - * (0 for 1st instance, 10 for 2nd instance).
>> - *
>> - *VCE_STATUS
>> - *|UENC|ACPI|AUTO ACTIVE|RB1 |RB0 |RB2 | |FW_LOADED|JOB |
>> - *|----+----+-----------+----+----+----+----------+---------+----|
>> - *|bit8|bit7| bit6 |bit5|bit4|bit3| bit2 | bit1 |bit0|
>> - *
>> - * VCE team suggest use bit 3--bit 6 for busy status check
>> - */
>> - mutex_lock(&adev->grbm_idx_mutex);
>> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
>> - if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) &
>> AMDGPU_VCE_STATUS_BUSY_MASK) {
>> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
>> SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
>> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
>> SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
>> - }
>> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0x10);
>> - if (RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_STATUS) &
>> AMDGPU_VCE_STATUS_BUSY_MASK) {
>> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
>> SRBM_SOFT_RESET, SOFT_RESET_VCE0, 1);
>> - srbm_soft_reset = REG_SET_FIELD(srbm_soft_reset,
>> SRBM_SOFT_RESET, SOFT_RESET_VCE1, 1);
>> - }
>> - WREG32_FIELD(GRBM_GFX_INDEX, INSTANCE_INDEX, 0);
>> - mutex_unlock(&adev->grbm_idx_mutex);
>> -
>> - if (srbm_soft_reset) {
>> - adev->vce.srbm_soft_reset = srbm_soft_reset;
>> - return true;
>> - } else {
>> - adev->vce.srbm_soft_reset = 0;
>> - return false;
>> - }
>> -}
>> -
>> -static int vce_v4_0_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> - u32 srbm_soft_reset;
>> -
>> - if (!adev->vce.srbm_soft_reset)
>> - return 0;
>> - srbm_soft_reset = adev->vce.srbm_soft_reset;
>> -
>> - if (srbm_soft_reset) {
>> - u32 tmp;
>> -
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> - tmp |= srbm_soft_reset;
>> - dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp);
>> - WREG32(mmSRBM_SOFT_RESET, tmp);
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> -
>> - udelay(50);
>> -
>> - tmp &= ~srbm_soft_reset;
>> - WREG32(mmSRBM_SOFT_RESET, tmp);
>> - tmp = RREG32(mmSRBM_SOFT_RESET);
>> -
>> - /* Wait a little for things to settle down */
>> - udelay(50);
>> - }
>> -
>> - return 0;
>> -}
>> -
>> -static int vce_v4_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - if (!adev->vce.srbm_soft_reset)
>> - return 0;
>> -
>> - mdelay(5);
>> -
>> - return vce_v4_0_suspend(adev);
>> -}
>> -
>> -
>> -static int vce_v4_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
>> -{
>> - struct amdgpu_device *adev = ip_block->adev;
>> -
>> - if (!adev->vce.srbm_soft_reset)
>> - return 0;
>> -
>> - mdelay(5);
>> -
>> - return vce_v4_0_resume(adev);
>> -}
>> -
>> -static void vce_v4_0_override_vce_clock_gating(struct amdgpu_device
>> *adev, bool override)
>> -{
>> - u32 tmp, data;
>> -
>> - tmp = data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL));
>> - if (override)
>> - data |= VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
>> - else
>> - data &= ~VCE_RB_ARB_CTRL__VCE_CGTT_OVERRIDE_MASK;
>> -
>> - if (tmp != data)
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_RB_ARB_CTRL), data);
>> -}
>> -
>> -static void vce_v4_0_set_vce_sw_clock_gating(struct amdgpu_device
>> *adev,
>> - bool gated)
>> -{
>> - u32 data;
>> -
>> - /* Set Override to disable Clock Gating */
>> - vce_v4_0_override_vce_clock_gating(adev, true);
>> -
>> - /* This function enables MGCG which is controlled by firmware.
>> - With the clocks in the gated state the core is still
>> - accessible but the firmware will throttle the clocks on the
>> - fly as necessary.
>> - */
>> - if (gated) {
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
>> - data |= 0x1ff;
>> - data &= ~0xef0000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_CLOCK_GATING));
>> - data |= 0x3ff000;
>> - data &= ~0xffc00000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING),
>> data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_CLOCK_GATING_2));
>> - data |= 0x2;
>> - data &= ~0x00010000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2),
>> data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_REG_CLOCK_GATING));
>> - data |= 0x37f;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_REG_CLOCK_GATING), data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_DMA_DCLK_CTRL));
>> - data |= VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
>> - VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
>> - VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
>> - 0x8;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL),
>> data);
>> - } else {
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B));
>> - data &= ~0x80010;
>> - data |= 0xe70008;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_B), data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_CLOCK_GATING));
>> - data |= 0xffc00000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING),
>> data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_CLOCK_GATING_2));
>> - data |= 0x10000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING_2),
>> data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_REG_CLOCK_GATING));
>> - data &= ~0xffc00000;
>> - WREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_REG_CLOCK_GATING), data);
>> -
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_DMA_DCLK_CTRL));
>> - data &= ~(VCE_UENC_DMA_DCLK_CTRL__WRDMCLK_FORCEON_MASK |
>> - VCE_UENC_DMA_DCLK_CTRL__RDDMCLK_FORCEON_MASK |
>> - VCE_UENC_DMA_DCLK_CTRL__REGCLK_FORCEON_MASK |
>> - 0x8);
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_DMA_DCLK_CTRL),
>> data);
>> - }
>> - vce_v4_0_override_vce_clock_gating(adev, false);
>> -}
>> -
>> -static void vce_v4_0_set_bypass_mode(struct amdgpu_device *adev,
>> bool enable)
>> -{
>> - u32 tmp = RREG32_SMC(ixGCK_DFS_BYPASS_CNTL);
>> -
>> - if (enable)
>> - tmp |= GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
>> - else
>> - tmp &= ~GCK_DFS_BYPASS_CNTL__BYPASSECLK_MASK;
>> -
>> - WREG32_SMC(ixGCK_DFS_BYPASS_CNTL, tmp);
>> -}
>> -
>> -static int vce_v4_0_set_clockgating_state(void *handle,
>> - enum amd_clockgating_state state)
>> -{
>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> - bool enable = (state == AMD_CG_STATE_GATE);
>> - int i;
>> -
>> - if ((adev->asic_type == CHIP_POLARIS10) ||
>> - (adev->asic_type == CHIP_TONGA) ||
>> - (adev->asic_type == CHIP_FIJI))
>> - vce_v4_0_set_bypass_mode(adev, enable);
>> -
>> - if (!(adev->cg_flags & AMD_CG_SUPPORT_VCE_MGCG))
>> - return 0;
>> -
>> - mutex_lock(&adev->grbm_idx_mutex);
>> - for (i = 0; i < 2; i++) {
>> - /* Program VCE Instance 0 or 1 if not harvested */
>> - if (adev->vce.harvest_config & (1 << i))
>> - continue;
>> -
>> - WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, i);
>> -
>> - if (enable) {
>> - /* initialize VCE_CLOCK_GATING_A: Clock ON/OFF delay */
>> - uint32_t data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_CLOCK_GATING_A);
>> - data &= ~(0xf | 0xff0);
>> - data |= ((0x0 << 0) | (0x04 << 4));
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_CLOCK_GATING_A,
>> data);
>> -
>> - /* initialize VCE_UENC_CLOCK_GATING: Clock ON/OFF delay */
>> - data = RREG32(SOC15_REG_OFFSET(VCE, 0,
>> mmVCE_UENC_CLOCK_GATING);
>> - data &= ~(0xf | 0xff0);
>> - data |= ((0x0 << 0) | (0x04 << 4));
>> - WREG32(SOC15_REG_OFFSET(VCE, 0, mmVCE_UENC_CLOCK_GATING,
>> data);
>> - }
>> -
>> - vce_v4_0_set_vce_sw_clock_gating(adev, enable);
>> - }
>> -
>> - WREG32_FIELD(GRBM_GFX_INDEX, VCE_INSTANCE, 0);
>> - mutex_unlock(&adev->grbm_idx_mutex);
>> -
>> - return 0;
>> -}
>> -#endif
>> -
>> static int vce_v4_0_set_powergating_state(void *handle,
>> enum amd_powergating_state state)
>> {
>> @@ -1076,19 +808,12 @@ static int vce_v4_0_process_interrupt(struct
>> amdgpu_device *adev,
>> const struct amd_ip_funcs vce_v4_0_ip_funcs = {
>> .name = "vce_v4_0",
>> .early_init = vce_v4_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vce_v4_0_sw_init,
>> .sw_fini = vce_v4_0_sw_fini,
>> .hw_init = vce_v4_0_hw_init,
>> .hw_fini = vce_v4_0_hw_fini,
>> .suspend = vce_v4_0_suspend,
>> .resume = vce_v4_0_resume,
>> - .is_idle = NULL /* vce_v4_0_is_idle */,
>> - .wait_for_idle = NULL /* vce_v4_0_wait_for_idle */,
>> - .check_soft_reset = NULL /* vce_v4_0_check_soft_reset */,
>> - .pre_soft_reset = NULL /* vce_v4_0_pre_soft_reset */,
>> - .soft_reset = NULL /* vce_v4_0_soft_reset */,
>> - .post_soft_reset = NULL /* vce_v4_0_post_soft_reset */,
>> .set_clockgating_state = vce_v4_0_set_clockgating_state,
>> .set_powergating_state = vce_v4_0_set_powergating_state,
>> };
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
>> index 129c759772c2..497b5d93a58b 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
>> @@ -1987,7 +1987,6 @@ static void vcn_v1_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
>> .name = "vcn_v1_0",
>> .early_init = vcn_v1_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v1_0_sw_init,
>> .sw_fini = vcn_v1_0_sw_fini,
>> .hw_init = vcn_v1_0_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
>> index 19bbd49f760e..e0322cbca3ec 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c
>> @@ -2095,7 +2095,6 @@ static void vcn_v2_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v2_0_ip_funcs = {
>> .name = "vcn_v2_0",
>> .early_init = vcn_v2_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v2_0_sw_init,
>> .sw_fini = vcn_v2_0_sw_fini,
>> .hw_init = vcn_v2_0_hw_init,
>> @@ -2104,10 +2103,6 @@ static const struct amd_ip_funcs
>> vcn_v2_0_ip_funcs = {
>> .resume = vcn_v2_0_resume,
>> .is_idle = vcn_v2_0_is_idle,
>> .wait_for_idle = vcn_v2_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v2_0_set_clockgating_state,
>> .set_powergating_state = vcn_v2_0_set_powergating_state,
>> .dump_ip_state = vcn_v2_0_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
>> index 30420ead7fc4..6aa08281d094 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c
>> @@ -1987,7 +1987,6 @@ static void vcn_v2_5_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v2_5_ip_funcs = {
>> .name = "vcn_v2_5",
>> .early_init = vcn_v2_5_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v2_5_sw_init,
>> .sw_fini = vcn_v2_5_sw_fini,
>> .hw_init = vcn_v2_5_hw_init,
>> @@ -1996,10 +1995,6 @@ static const struct amd_ip_funcs
>> vcn_v2_5_ip_funcs = {
>> .resume = vcn_v2_5_resume,
>> .is_idle = vcn_v2_5_is_idle,
>> .wait_for_idle = vcn_v2_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v2_5_set_clockgating_state,
>> .set_powergating_state = vcn_v2_5_set_powergating_state,
>> .dump_ip_state = vcn_v2_5_dump_ip_state,
>> @@ -2009,7 +2004,6 @@ static const struct amd_ip_funcs
>> vcn_v2_5_ip_funcs = {
>> static const struct amd_ip_funcs vcn_v2_6_ip_funcs = {
>> .name = "vcn_v2_6",
>> .early_init = vcn_v2_5_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v2_5_sw_init,
>> .sw_fini = vcn_v2_5_sw_fini,
>> .hw_init = vcn_v2_5_hw_init,
>> @@ -2018,10 +2012,6 @@ static const struct amd_ip_funcs
>> vcn_v2_6_ip_funcs = {
>> .resume = vcn_v2_5_resume,
>> .is_idle = vcn_v2_5_is_idle,
>> .wait_for_idle = vcn_v2_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v2_5_set_clockgating_state,
>> .set_powergating_state = vcn_v2_5_set_powergating_state,
>> .dump_ip_state = vcn_v2_5_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
>> index 13632c22d2f9..6732ad7f16f5 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
>> @@ -2313,7 +2313,6 @@ static void vcn_v3_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v3_0_ip_funcs = {
>> .name = "vcn_v3_0",
>> .early_init = vcn_v3_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v3_0_sw_init,
>> .sw_fini = vcn_v3_0_sw_fini,
>> .hw_init = vcn_v3_0_hw_init,
>> @@ -2322,10 +2321,6 @@ static const struct amd_ip_funcs
>> vcn_v3_0_ip_funcs = {
>> .resume = vcn_v3_0_resume,
>> .is_idle = vcn_v3_0_is_idle,
>> .wait_for_idle = vcn_v3_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v3_0_set_clockgating_state,
>> .set_powergating_state = vcn_v3_0_set_powergating_state,
>> .dump_ip_state = vcn_v3_0_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> index e7b7a8150ea7..5512259cac79 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
>> @@ -2220,7 +2220,6 @@ static void vcn_v4_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v4_0_ip_funcs = {
>> .name = "vcn_v4_0",
>> .early_init = vcn_v4_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v4_0_sw_init,
>> .sw_fini = vcn_v4_0_sw_fini,
>> .hw_init = vcn_v4_0_hw_init,
>> @@ -2229,10 +2228,6 @@ static const struct amd_ip_funcs
>> vcn_v4_0_ip_funcs = {
>> .resume = vcn_v4_0_resume,
>> .is_idle = vcn_v4_0_is_idle,
>> .wait_for_idle = vcn_v4_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v4_0_set_clockgating_state,
>> .set_powergating_state = vcn_v4_0_set_powergating_state,
>> .dump_ip_state = vcn_v4_0_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
>> index 6dcae398b2dc..0d5c94bfc0ef 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
>> @@ -1796,7 +1796,6 @@ static void vcn_v4_0_3_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v4_0_3_ip_funcs = {
>> .name = "vcn_v4_0_3",
>> .early_init = vcn_v4_0_3_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v4_0_3_sw_init,
>> .sw_fini = vcn_v4_0_3_sw_fini,
>> .hw_init = vcn_v4_0_3_hw_init,
>> @@ -1805,10 +1804,6 @@ static const struct amd_ip_funcs
>> vcn_v4_0_3_ip_funcs = {
>> .resume = vcn_v4_0_3_resume,
>> .is_idle = vcn_v4_0_3_is_idle,
>> .wait_for_idle = vcn_v4_0_3_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v4_0_3_set_clockgating_state,
>> .set_powergating_state = vcn_v4_0_3_set_powergating_state,
>> .dump_ip_state = vcn_v4_0_3_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
>> index edb9cd8390b6..71961fb3f7ff 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
>> @@ -1678,7 +1678,6 @@ static void vcn_v4_0_5_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v4_0_5_ip_funcs = {
>> .name = "vcn_v4_0_5",
>> .early_init = vcn_v4_0_5_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v4_0_5_sw_init,
>> .sw_fini = vcn_v4_0_5_sw_fini,
>> .hw_init = vcn_v4_0_5_hw_init,
>> @@ -1687,10 +1686,6 @@ static const struct amd_ip_funcs
>> vcn_v4_0_5_ip_funcs = {
>> .resume = vcn_v4_0_5_resume,
>> .is_idle = vcn_v4_0_5_is_idle,
>> .wait_for_idle = vcn_v4_0_5_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v4_0_5_set_clockgating_state,
>> .set_powergating_state = vcn_v4_0_5_set_powergating_state,
>> .dump_ip_state = vcn_v4_0_5_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
>> b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
>> index 89bf29fa6f8d..fe2cc1a80c13 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c
>> @@ -1404,7 +1404,6 @@ static void vcn_v5_0_dump_ip_state(struct
>> amdgpu_ip_block *ip_block)
>> static const struct amd_ip_funcs vcn_v5_0_0_ip_funcs = {
>> .name = "vcn_v5_0_0",
>> .early_init = vcn_v5_0_0_early_init,
>> - .late_init = NULL,
>> .sw_init = vcn_v5_0_0_sw_init,
>> .sw_fini = vcn_v5_0_0_sw_fini,
>> .hw_init = vcn_v5_0_0_hw_init,
>> @@ -1413,10 +1412,6 @@ static const struct amd_ip_funcs
>> vcn_v5_0_0_ip_funcs = {
>> .resume = vcn_v5_0_0_resume,
>> .is_idle = vcn_v5_0_0_is_idle,
>> .wait_for_idle = vcn_v5_0_0_wait_for_idle,
>> - .check_soft_reset = NULL,
>> - .pre_soft_reset = NULL,
>> - .soft_reset = NULL,
>> - .post_soft_reset = NULL,
>> .set_clockgating_state = vcn_v5_0_0_set_clockgating_state,
>> .set_powergating_state = vcn_v5_0_0_set_powergating_state,
>> .dump_ip_state = vcn_v5_0_dump_ip_state,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
>> index 73de5909f655..0fedadd0a6a4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vega10_ih.c
>> @@ -625,7 +625,6 @@ static int vega10_ih_set_powergating_state(void
>> *handle,
>> const struct amd_ip_funcs vega10_ih_ip_funcs = {
>> .name = "vega10_ih",
>> .early_init = vega10_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = vega10_ih_sw_init,
>> .sw_fini = vega10_ih_sw_fini,
>> .hw_init = vega10_ih_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
>> b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
>> index a42404a58015..b7e3fb4628b2 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
>> @@ -690,7 +690,6 @@ static int vega20_ih_set_powergating_state(void
>> *handle,
>> const struct amd_ip_funcs vega20_ih_ip_funcs = {
>> .name = "vega20_ih",
>> .early_init = vega20_ih_early_init,
>> - .late_init = NULL,
>> .sw_init = vega20_ih_sw_init,
>> .sw_fini = vega20_ih_sw_fini,
>> .hw_init = vega20_ih_hw_init,
>> diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c
>> b/drivers/gpu/drm/amd/amdgpu/vi.c
>> index 607b48a2d5eb..b3fa54c0514e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/vi.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/vi.c
>> @@ -2036,8 +2036,6 @@ static const struct amd_ip_funcs
>> vi_common_ip_funcs = {
>> .set_clockgating_state = vi_common_set_clockgating_state,
>> .set_powergating_state = vi_common_set_powergating_state,
>> .get_clockgating_state = vi_common_get_clockgating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> static const struct amdgpu_ip_block_version vi_common_ip_block =
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index a4882b16ace2..5e9854f5d276 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -3407,8 +3407,6 @@ static const struct amd_ip_funcs
>> amdgpu_dm_funcs = {
>> .soft_reset = dm_soft_reset,
>> .set_clockgating_state = dm_set_clockgating_state,
>> .set_powergating_state = dm_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version dm_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
>> b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
>> index 785cb20e64b6..8908646ad620 100644
>> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
>> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
>> @@ -3304,8 +3304,6 @@ static const struct amd_ip_funcs
>> kv_dpm_ip_funcs = {
>> .is_idle = kv_dpm_is_idle,
>> .set_clockgating_state = kv_dpm_set_clockgating_state,
>> .set_powergating_state = kv_dpm_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version kv_smu_ip_block = {
>> diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
>> b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
>> index 7b0ded50251a..ee23a0f897c5 100644
>> --- a/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
>> +++ b/drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c
>> @@ -8046,8 +8046,6 @@ static const struct amd_ip_funcs
>> si_dpm_ip_funcs = {
>> .wait_for_idle = si_dpm_wait_for_idle,
>> .set_clockgating_state = si_dpm_set_clockgating_state,
>> .set_powergating_state = si_dpm_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version si_smu_ip_block =
>> diff --git a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
>> b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
>> index 5aadb6061c22..26624a716fc6 100644
>> --- a/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
>> +++ b/drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c
>> @@ -287,8 +287,6 @@ static const struct amd_ip_funcs pp_ip_funcs = {
>> .is_idle = pp_is_idle,
>> .set_clockgating_state = pp_set_clockgating_state,
>> .set_powergating_state = pp_set_powergating_state,
>> - .dump_ip_state = NULL,
>> - .print_ip_state = NULL,
>> };
>> const struct amdgpu_ip_block_version pp_smu_ip_block =
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> index accc96a03bd9..277169c2f711 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> @@ -2580,10 +2580,6 @@ const struct amd_ip_funcs smu_ip_funcs = {
>> .late_fini = smu_late_fini,
>> .suspend = smu_suspend,
>> .resume = smu_resume,
>> - .is_idle = NULL,
>> - .check_soft_reset = NULL,
>> - .wait_for_idle = NULL,
>> - .soft_reset = NULL,
>> .set_clockgating_state = smu_set_clockgating_state,
>> .set_powergating_state = smu_set_powergating_state,
>> };
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use
2024-10-17 12:20 ` Christian König
@ 2024-10-17 12:55 ` Khatri, Sunil
2024-10-17 13:15 ` Christian König
0 siblings, 1 reply; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:55 UTC (permalink / raw)
To: Christian König, Alex Deucher, Christian König; +Cc: amd-gfx
[-- Attachment #1: Type: text/plain, Size: 3836 bytes --]
On 10/17/2024 5:50 PM, Christian König wrote:
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> Validate the function pointer for get_clockgating_state
>> before making a function call.
>
> Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO
> functions are not IP specific.
>
For many socs this check is added and only missing in the
files/functions mentioned below. SOC where these functions are called
are nv_common, soc15_common, soc21_common, soc24_common
eg: SOC15 already have these changes and its safe to add for other socs
that i mentioned above.
soc15_common_get_clockgating_state Regards Sunil
> Christian.
>
>>
>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/nv.c | 9 ++++++---
>> drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++++--
>> drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ++++--
>> 3 files changed, 14 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c
>> b/drivers/gpu/drm/amd/amdgpu/nv.c
>> index 6b72169be8f8..40c720b32c59 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
>> @@ -1084,11 +1084,14 @@ static void
>> nv_common_get_clockgating_state(void *handle, u64 *flags)
>> if (amdgpu_sriov_vf(adev))
>> *flags = 0;
>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> - adev->smuio.funcs->get_clock_gating_state(adev, flags);
>> + if (adev->smuio.funcs && adev->smuio.funcs->get_clock_gating_state)
>> + adev->smuio.funcs->get_clock_gating_state(adev, flags);
>> }
>> static const struct amd_ip_funcs nv_common_ip_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c
>> b/drivers/gpu/drm/amd/amdgpu/soc21.c
>> index 1c07ebdc0d1f..196286be35b4 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
>> @@ -975,9 +975,11 @@ static void
>> soc21_common_get_clockgating_state(void *handle, u64 *flags)
>> {
>> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> }
>> static const struct amd_ip_funcs soc21_common_ip_funcs = {
>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c
>> b/drivers/gpu/drm/amd/amdgpu/soc24.c
>> index 3af10ef4b793..f4278a0fa8f7 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/soc24.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
>> @@ -564,9 +564,11 @@ static void
>> soc24_common_get_clockgating_state(void *handle, u64 *flags)
>> {
>> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>> return;
>> }
>
[-- Attachment #2: Type: text/html, Size: 6801 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 00/15] validate/clean the functions of ip funcs
2024-10-17 12:23 ` [PATCH v4 00/15] validate/clean the functions of ip funcs Christian König
@ 2024-10-17 12:57 ` Khatri, Sunil
0 siblings, 0 replies; 31+ messages in thread
From: Khatri, Sunil @ 2024-10-17 12:57 UTC (permalink / raw)
To: Christian König, Alex Deucher; +Cc: amd-gfx
On 10/17/2024 5:53 PM, Christian König wrote:
> Patches #1-#4, #8-#10,#13 are Reviewed-by: Christian König
> <christian.koenig@amd.com>
>
> Since those patches should be independent maybe push them to
> amd-staging-drm-next before continuing working on the set.
Sure if the order isnt needed i will push those out of what you
mentioned and share the rest for review after making changes.
Regards
Sunil Khatri
>
> Regards,
> Christian.
>
> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>> v4: hw_init/hw_fini functions are mandatory and raise error message if
>> these functions are not defined.
>>
>> v3: Added 2 new patches to clean get_clocking_state and hw_init
>> validation.
>>
>> Sunil Khatri (15):
>> drm/amdgpu: validate sw_init before function call
>> drm/amdgpu: clean the dummy sw_init functions
>> drm/amdgpu: validate sw_fini before function call
>> drm/amdgpu: clean the dummy sw_fini functions
>> drm/amdgpu: validate hw_fini before function call
>> drm/amdgpu: validate suspend before function call
>> drm/amdgpu: validate resume before function call
>> drm/amdgpu: validate wait_for_idle before function call
>> drm/amdgpu: clean the dummy resume functions
>> drm/amdgpu: clean the dummy suspend functions
>> drm/amdgpu: clean the dummy hw_fini functions
>> drm/amdgpu: clean the dummy wait_for_idle functions
>> drm/amdgpu: clean the dummy soft_reset functions
>> drm/amdgpu: clean unused functions of amd_ip_funcs
>> drm/amdgpu: validate get_clockgating_state before use
>>
>> drivers/gpu/drm/amd/amdgpu/aldebaran.c | 38 ++-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 16 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 138 +++++----
>> drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c | 35 ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c | 12 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 25 +-
>> drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/cik.c | 33 +-
>> drivers/gpu/drm/amd/amdgpu/cik_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/cz_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 9 -
>> drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 9 -
>> drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 9 -
>> drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 9 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 9 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c | 6 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 6 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v12_0.c | 6 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/iceland_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v6_1.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/ih_v7_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 14 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/jpeg_v5_0_0.c | 7 -
>> drivers/gpu/drm/amd/amdgpu/mes_v11_0.c | 2 -
>> drivers/gpu/drm/amd/amdgpu/mes_v12_0.c | 11 +-
>> drivers/gpu/drm/amd/amdgpu/navi10_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/nv.c | 29 +-
>> drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/sdma_v7_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/si.c | 40 ---
>> drivers/gpu/drm/amd/amdgpu/si_dma.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/sienna_cichlid.c | 43 +--
>> drivers/gpu/drm/amd/amdgpu/smu_v13_0_10.c | 29 +-
>> drivers/gpu/drm/amd/amdgpu/soc15.c | 14 -
>> drivers/gpu/drm/amd/amdgpu/soc21.c | 26 +-
>> drivers/gpu/drm/amd/amdgpu/soc24.c | 24 +-
>> drivers/gpu/drm/amd/amdgpu/tonga_ih.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 284 ------------------
>> drivers/gpu/drm/amd/amdgpu/vce_v2_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 3 -
>> drivers/gpu/drm/amd/amdgpu/vce_v4_0.c | 275 -----------------
>> drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c | 10 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 5 -
>> drivers/gpu/drm/amd/amdgpu/vega10_ih.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vega20_ih.c | 1 -
>> drivers/gpu/drm/amd/amdgpu/vi.c | 20 --
>> .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -
>> drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c | 15 -
>> drivers/gpu/drm/amd/pm/legacy-dpm/si_dpm.c | 8 -
>> .../gpu/drm/amd/pm/powerplay/amd_powerplay.c | 14 -
>> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 -
>> 80 files changed, 171 insertions(+), 1208 deletions(-)
>>
>
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use
2024-10-17 12:55 ` Khatri, Sunil
@ 2024-10-17 13:15 ` Christian König
0 siblings, 0 replies; 31+ messages in thread
From: Christian König @ 2024-10-17 13:15 UTC (permalink / raw)
To: Khatri, Sunil, Christian König, Alex Deucher; +Cc: amd-gfx
[-- Attachment #1: Type: text/plain, Size: 4121 bytes --]
Am 17.10.24 um 14:55 schrieb Khatri, Sunil:
>
> On 10/17/2024 5:50 PM, Christian König wrote:
>
>> Am 17.10.24 um 12:06 schrieb Sunil Khatri:
>>> Validate the function pointer for get_clockgating_state
>>> before making a function call.
>>
>> Oh, I'm not sure if that is necessary or not. The NBIO, HDP and SMUIO
>> functions are not IP specific.
>>
> For many socs this check is added and only missing in the
> files/functions mentioned below. SOC where these functions are called
> are nv_common, soc15_common, soc21_common, soc24_common
> eg: SOC15 already have these changes and its safe to add for other
> socs that i mentioned above.
You mean that the checks are in almost all places, but here they are
missing? Mhm, that's strange.
Let me investigate that further,
Christian.
> soc15_common_get_clockgating_state Regards Sunil
>> Christian.
>>
>>>
>>> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/nv.c | 9 ++++++---
>>> drivers/gpu/drm/amd/amdgpu/soc21.c | 6 ++++--
>>> drivers/gpu/drm/amd/amdgpu/soc24.c | 6 ++++--
>>> 3 files changed, 14 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c
>>> b/drivers/gpu/drm/amd/amdgpu/nv.c
>>> index 6b72169be8f8..40c720b32c59 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/nv.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/nv.c
>>> @@ -1084,11 +1084,14 @@ static void
>>> nv_common_get_clockgating_state(void *handle, u64 *flags)
>>> if (amdgpu_sriov_vf(adev))
>>> *flags = 0;
>>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> - adev->smuio.funcs->get_clock_gating_state(adev, flags);
>>> + if (adev->smuio.funcs &&
>>> adev->smuio.funcs->get_clock_gating_state)
>>> + adev->smuio.funcs->get_clock_gating_state(adev, flags);
>>> }
>>> static const struct amd_ip_funcs nv_common_ip_funcs = {
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c
>>> b/drivers/gpu/drm/amd/amdgpu/soc21.c
>>> index 1c07ebdc0d1f..196286be35b4 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/soc21.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
>>> @@ -975,9 +975,11 @@ static void
>>> soc21_common_get_clockgating_state(void *handle, u64 *flags)
>>> {
>>> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> }
>>> static const struct amd_ip_funcs soc21_common_ip_funcs = {
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/soc24.c
>>> b/drivers/gpu/drm/amd/amdgpu/soc24.c
>>> index 3af10ef4b793..f4278a0fa8f7 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/soc24.c
>>> +++ b/drivers/gpu/drm/amd/amdgpu/soc24.c
>>> @@ -564,9 +564,11 @@ static void
>>> soc24_common_get_clockgating_state(void *handle, u64 *flags)
>>> {
>>> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
>>> - adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> + if (adev->nbio.funcs && adev->nbio.funcs->get_clockgating_state)
>>> + adev->nbio.funcs->get_clockgating_state(adev, flags);
>>> - adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> + if (adev->hdp.funcs && adev->hdp.funcs->get_clock_gating_state)
>>> + adev->hdp.funcs->get_clock_gating_state(adev, flags);
>>> return;
>>> }
>>
[-- Attachment #2: Type: text/html, Size: 6985 bytes --]
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2024-10-17 13:15 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-17 10:06 [PATCH v4 00/15] validate/clean the functions of ip funcs Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 01/15] drm/amdgpu: validate sw_init before function call Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 02/15] drm/amdgpu: clean the dummy sw_init functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 03/15] drm/amdgpu: validate sw_fini before function call Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 04/15] drm/amdgpu: clean the dummy sw_fini functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 05/15] drm/amdgpu: validate hw_fini before function call Sunil Khatri
2024-10-17 11:52 ` Christian König
2024-10-17 12:44 ` Khatri, Sunil
2024-10-17 10:06 ` [PATCH v4 06/15] drm/amdgpu: validate suspend " Sunil Khatri
2024-10-17 11:54 ` Christian König
2024-10-17 12:45 ` Khatri, Sunil
2024-10-17 10:06 ` [PATCH v4 07/15] drm/amdgpu: validate resume " Sunil Khatri
2024-10-17 11:55 ` Christian König
2024-10-17 12:46 ` Khatri, Sunil
2024-10-17 10:06 ` [PATCH v4 08/15] drm/amdgpu: validate wait_for_idle " Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 09/15] drm/amdgpu: clean the dummy resume functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 10/15] drm/amdgpu: clean the dummy suspend functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 11/15] drm/amdgpu: clean the dummy hw_fini functions Sunil Khatri
2024-10-17 11:58 ` Christian König
2024-10-17 12:47 ` Khatri, Sunil
2024-10-17 10:06 ` [PATCH v4 12/15] drm/amdgpu: clean the dummy wait_for_idle functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 13/15] drm/amdgpu: clean the dummy soft_reset functions Sunil Khatri
2024-10-17 10:06 ` [PATCH v4 14/15] drm/amdgpu: clean unused functions of amd_ip_funcs Sunil Khatri
2024-10-17 12:18 ` Christian König
2024-10-17 12:49 ` Khatri, Sunil
2024-10-17 10:06 ` [PATCH v4 15/15] drm/amdgpu: validate get_clockgating_state before use Sunil Khatri
2024-10-17 12:20 ` Christian König
2024-10-17 12:55 ` Khatri, Sunil
2024-10-17 13:15 ` Christian König
2024-10-17 12:23 ` [PATCH v4 00/15] validate/clean the functions of ip funcs Christian König
2024-10-17 12:57 ` Khatri, Sunil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox