summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authoryipechai <YiPeng.Chai@amd.com>2022-02-17 14:55:19 +0800
committerAlex Deucher <alexander.deucher@amd.com>2022-03-02 18:40:05 -0500
commit667c7091a39e8b360d34f37aed5f8dd85bdc45f7 (patch)
treef6753d492ed997b73da885608a0cb2a08d1c9db3 /drivers
parent01d468d9a420152e4a1270992e69a37ea0c98e04 (diff)
downloadlwn-667c7091a39e8b360d34f37aed5f8dd85bdc45f7.tar.gz
lwn-667c7091a39e8b360d34f37aed5f8dd85bdc45f7.zip
drm/amdgpu: Optimize xxx_ras_fini function of each ras block
1. Move the variables of ras block instance members from specific xxx_ras_fini to general ras_fini call. 2. Function calls inside the modules only use parameters passed from xxx_ras_fini instead of ras block instance members. Signed-off-by: yipechai <YiPeng.Chai@amd.com> Reviewed-by: Tao Zhou <tao.zhou1@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c8
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c2
-rw-r--r--drivers/gpu/drm/amd/amdgpu/soc15.c2
11 files changed, 21 insertions, 21 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index d020c4599433..40f7e29aa9ca 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -647,8 +647,8 @@ late_fini:
void amdgpu_gfx_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__GFX) &&
- adev->gfx.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->gfx.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
int amdgpu_gfx_process_ras_data_cb(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 350fbfec1e03..62083d3aa9b8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -455,16 +455,16 @@ int amdgpu_gmc_ras_late_init(struct amdgpu_device *adev)
void amdgpu_gmc_ras_fini(struct amdgpu_device *adev)
{
if (adev->umc.ras && adev->umc.ras->ras_block.ras_fini)
- adev->umc.ras->ras_block.ras_fini(adev, NULL);
+ adev->umc.ras->ras_block.ras_fini(adev, adev->umc.ras_if);
if (adev->mmhub.ras && adev->mmhub.ras->ras_block.ras_fini)
- adev->mmhub.ras->ras_block.ras_fini(adev, NULL);
+ adev->mmhub.ras->ras_block.ras_fini(adev, adev->mmhub.ras_if);
if (adev->gmc.xgmi.ras && adev->gmc.xgmi.ras->ras_block.ras_fini)
- adev->gmc.xgmi.ras->ras_block.ras_fini(adev, NULL);
+ adev->gmc.xgmi.ras->ras_block.ras_fini(adev, adev->gmc.xgmi.ras_if);
if (adev->hdp.ras && adev->hdp.ras->ras_block.ras_fini)
- adev->hdp.ras->ras_block.ras_fini(adev, NULL);
+ adev->hdp.ras->ras_block.ras_fini(adev, adev->hdp.ras_if);
}
/*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c
index 0f224e21cd55..5595f903c17a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_hdp.c
@@ -27,6 +27,6 @@
void amdgpu_hdp_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__HDP) &&
- adev->hdp.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->hdp.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
index 6dfcedcc37fd..e7c3b8fff868 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.c
@@ -27,6 +27,6 @@
void amdgpu_mmhub_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__MMHUB) &&
- adev->mmhub.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->mmhub.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
index 0de2fdf31eed..54a5a15272c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.c
@@ -47,6 +47,6 @@ late_fini:
void amdgpu_nbio_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__PCIE_BIF) &&
- adev->nbio.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->nbio.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
index 863035a94bd8..1df8de84386d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c
@@ -114,8 +114,8 @@ late_fini:
void amdgpu_sdma_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__SDMA) &&
- adev->sdma.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->sdma.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
int amdgpu_sdma_process_ras_data_cb(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
index 41e976733c57..2623a2d30703 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c
@@ -165,8 +165,8 @@ late_fini:
void amdgpu_umc_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__UMC) &&
- adev->umc.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->umc.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
int amdgpu_umc_process_ecc_irq(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index 3e56adea84a3..a54257760f9e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -771,8 +771,8 @@ static int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev, struct ras_comm
static void amdgpu_xgmi_ras_fini(struct amdgpu_device *adev, struct ras_common_if *ras_block)
{
if (amdgpu_ras_is_supported(adev, AMDGPU_RAS_BLOCK__XGMI_WAFL) &&
- adev->gmc.xgmi.ras_if)
- amdgpu_ras_block_late_fini(adev, adev->gmc.xgmi.ras_if);
+ ras_block)
+ amdgpu_ras_block_late_fini(adev, ras_block);
}
uint64_t amdgpu_xgmi_get_relative_phy_addr(struct amdgpu_device *adev,
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 3ecb238c6483..e8446967a4d4 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2433,7 +2433,7 @@ static int gfx_v9_0_sw_fini(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (adev->gfx.ras && adev->gfx.ras->ras_block.ras_fini)
- adev->gfx.ras->ras_block.ras_fini(adev, NULL);
+ adev->gfx.ras->ras_block.ras_fini(adev, adev->gfx.ras_if);
for (i = 0; i < adev->gfx.num_gfx_rings; i++)
amdgpu_ring_fini(&adev->gfx.gfx_ring[i]);
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index d0a9012e53d7..222d25a0413a 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -1997,7 +1997,7 @@ static int sdma_v4_0_sw_fini(void *handle)
if (adev->sdma.ras && adev->sdma.ras->ras_block.hw_ops &&
adev->sdma.ras->ras_block.ras_fini)
- adev->sdma.ras->ras_block.ras_fini(adev, NULL);
+ adev->sdma.ras->ras_block.ras_fini(adev, adev->sdma.ras_if);
for (i = 0; i < adev->sdma.num_instances; i++) {
amdgpu_ring_fini(&adev->sdma.instance[i].ring);
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 34cd5cad7da5..0631ebd39db1 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -1215,7 +1215,7 @@ static int soc15_common_sw_fini(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
if (adev->nbio.ras && adev->nbio.ras->ras_block.ras_fini)
- adev->nbio.ras->ras_block.ras_fini(adev, NULL);
+ adev->nbio.ras->ras_block.ras_fini(adev, adev->nbio.ras_if);
if (adev->df.funcs &&
adev->df.funcs->sw_fini)