Skip to content

Commit a867149

Browse files
committed
drm/amdgpu: make sure to init common IP before gmc
Move common IP init before GMC init so that HDP gets remapped before GMC init which uses it. This fixes the Unsupported Request error reported through AER during driver load. The error happens as a write happens to the remap offset before real remapping is done. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216373 The error was unnoticed before and got visible because of the commit referenced below. This doesn't fix anything in the commit below, rather fixes the issue in amdgpu exposed by the commit. The reference is only to associate this commit with below one so that both go together. Fixes: 8795e18 ("PCI/portdrv: Don't disable AER reporting in get_port_device_capability()") Acked-by: Christian König <[email protected]> Reviewed-by: Lijo Lazar <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent e3163bc commit a867149

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,8 +2365,16 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
23652365
}
23662366
adev->ip_blocks[i].status.sw = true;
23672367

2368-
/* need to do gmc hw init early so we can allocate gpu mem */
2369-
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
2368+
if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON) {
2369+
/* need to do common hw init early so everything is set up for gmc */
2370+
r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
2371+
if (r) {
2372+
DRM_ERROR("hw_init %d failed %d\n", i, r);
2373+
goto init_failed;
2374+
}
2375+
adev->ip_blocks[i].status.hw = true;
2376+
} else if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) {
2377+
/* need to do gmc hw init early so we can allocate gpu mem */
23702378
/* Try to reserve bad pages early */
23712379
if (amdgpu_sriov_vf(adev))
23722380
amdgpu_virt_exchange_data(adev);
@@ -3052,8 +3060,8 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)
30523060
int i, r;
30533061

30543062
static enum amd_ip_block_type ip_order[] = {
3055-
AMD_IP_BLOCK_TYPE_GMC,
30563063
AMD_IP_BLOCK_TYPE_COMMON,
3064+
AMD_IP_BLOCK_TYPE_GMC,
30573065
AMD_IP_BLOCK_TYPE_PSP,
30583066
AMD_IP_BLOCK_TYPE_IH,
30593067
};

0 commit comments

Comments
 (0)