Skip to content

Commit e15ec81

Browse files
amd-sukhatrialexdeucher
authored andcommitted
drm/amdgpu: update the handle ptr in post_soft_reset
Update the *handle to amdgpu_ip_block ptr for all functions pointers of post_soft_reset. Signed-off-by: Sunil Khatri <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0ef2a1e commit e15ec81

File tree

11 files changed

+21
-20
lines changed

11 files changed

+21
-20
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5070,7 +5070,7 @@ static int amdgpu_device_ip_post_soft_reset(struct amdgpu_device *adev)
50705070
continue;
50715071
if (adev->ip_blocks[i].status.hang &&
50725072
adev->ip_blocks[i].version->funcs->post_soft_reset)
5073-
r = adev->ip_blocks[i].version->funcs->post_soft_reset(adev);
5073+
r = adev->ip_blocks[i].version->funcs->post_soft_reset(&adev->ip_blocks[i]);
50745074
if (r)
50755075
return r;
50765076
}

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4931,12 +4931,13 @@ static bool gfx_v11_0_check_soft_reset(struct amdgpu_ip_block *ip_block)
49314931
return false;
49324932
}
49334933

4934-
static int gfx_v11_0_post_soft_reset(void *handle)
4934+
static int gfx_v11_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
49354935
{
4936+
struct amdgpu_device *adev = ip_block->adev;
49364937
/**
49374938
* GFX soft reset will impact MES, need resume MES when do GFX soft reset
49384939
*/
4939-
return amdgpu_mes_resume((struct amdgpu_device *)handle);
4940+
return amdgpu_mes_resume(adev);
49404941
}
49414942

49424943
static uint64_t gfx_v11_0_get_gpu_clock_counter(struct amdgpu_device *adev)

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5086,9 +5086,9 @@ static int gfx_v8_0_soft_reset(struct amdgpu_ip_block *ip_block)
50865086
return 0;
50875087
}
50885088

5089-
static int gfx_v8_0_post_soft_reset(void *handle)
5089+
static int gfx_v8_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
50905090
{
5091-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
5091+
struct amdgpu_device *adev = ip_block->adev;
50925092
u32 grbm_soft_reset = 0;
50935093

50945094
if ((!adev->gfx.grbm_soft_reset) &&

drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,9 +1361,9 @@ static int gmc_v8_0_soft_reset(struct amdgpu_ip_block *ip_block)
13611361
return 0;
13621362
}
13631363

1364-
static int gmc_v8_0_post_soft_reset(void *handle)
1364+
static int gmc_v8_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
13651365
{
1366-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1366+
struct amdgpu_device *adev = ip_block->adev;
13671367

13681368
if (!adev->gmc.srbm_soft_reset)
13691369
return 0;

drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,9 +1271,9 @@ static int sdma_v3_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
12711271
return 0;
12721272
}
12731273

1274-
static int sdma_v3_0_post_soft_reset(void *handle)
1274+
static int sdma_v3_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
12751275
{
1276-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1276+
struct amdgpu_device *adev = ip_block->adev;
12771277
u32 srbm_soft_reset = 0;
12781278

12791279
if (!adev->sdma.srbm_soft_reset)

drivers/gpu/drm/amd/amdgpu/tonga_ih.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,9 @@ static int tonga_ih_pre_soft_reset(struct amdgpu_ip_block *ip_block)
415415
return tonga_ih_hw_fini(adev);
416416
}
417417

418-
static int tonga_ih_post_soft_reset(void *handle)
418+
static int tonga_ih_post_soft_reset(struct amdgpu_ip_block *ip_block)
419419
{
420-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
420+
struct amdgpu_device *adev = ip_block->adev;
421421

422422
if (!adev->irq.srbm_soft_reset)
423423
return 0;

drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,9 +1226,9 @@ static int uvd_v6_0_soft_reset(struct amdgpu_ip_block *ip_block)
12261226
return 0;
12271227
}
12281228

1229-
static int uvd_v6_0_post_soft_reset(void *handle)
1229+
static int uvd_v6_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
12301230
{
1231-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1231+
struct amdgpu_device *adev = ip_block->adev;
12321232

12331233
if (!adev->uvd.inst->srbm_soft_reset)
12341234
return 0;

drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,9 +1548,9 @@ static int uvd_v7_0_soft_reset(struct amdgpu_ip_block *ip_block)
15481548
return 0;
15491549
}
15501550

1551-
static int uvd_v7_0_post_soft_reset(void *handle)
1551+
static int uvd_v7_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
15521552
{
1553-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
1553+
struct amdgpu_device *adev = ip_block->adev;
15541554

15551555
if (!adev->uvd.inst[ring->me].srbm_soft_reset)
15561556
return 0;

drivers/gpu/drm/amd/amdgpu/vce_v3_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,9 +712,9 @@ static int vce_v3_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
712712
}
713713

714714

715-
static int vce_v3_0_post_soft_reset(void *handle)
715+
static int vce_v3_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
716716
{
717-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
717+
struct amdgpu_device *adev = ip_block->adev;
718718

719719
if (!adev->vce.srbm_soft_reset)
720720
return 0;

drivers/gpu/drm/amd/amdgpu/vce_v4_0.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,9 @@ static int vce_v4_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
806806
}
807807

808808

809-
static int vce_v4_0_post_soft_reset(void *handle)
809+
static int vce_v4_0_post_soft_reset(struct amdgpu_ip_block *ip_block)
810810
{
811-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
811+
struct amdgpu_device *adev = ip_block->adev;
812812

813813
if (!adev->vce.srbm_soft_reset)
814814
return 0;

drivers/gpu/drm/amd/include/amd_shared.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ struct amd_ip_funcs {
395395
bool (*check_soft_reset)(struct amdgpu_ip_block *ip_block);
396396
int (*pre_soft_reset)(struct amdgpu_ip_block *ip_block);
397397
int (*soft_reset)(struct amdgpu_ip_block *ip_block);
398-
int (*post_soft_reset)(void *handle);
398+
int (*post_soft_reset)(struct amdgpu_ip_block *ip_block);
399399
int (*set_clockgating_state)(void *handle,
400400
enum amd_clockgating_state state);
401401
int (*set_powergating_state)(void *handle,

0 commit comments

Comments
 (0)