Skip to content

Commit 8c2bbfb

Browse files
alexdeuchergregkh
authored andcommitted
drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega
commit e3163bc upstream. This mirrors what we do for other asics and this way we are sure the sdma doorbell range is properly initialized. There is a comment about the way doorbells on gfx9 work that requires that they are initialized for other IPs before GFX is initialized. However, the statement says that it applies to multimedia as well, but the VCN code currently initializes doorbells after GFX and there are no known issues there. In my testing at least I don't see any problems on SDMA. This is a prerequisite for fixing the Unsupported Request error reported through AER during driver load. 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] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0a7d86f commit 8c2bbfb

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,11 @@ static int sdma_v4_0_start(struct amdgpu_device *adev)
15071507
WREG32_SDMA(i, mmSDMA0_CNTL, temp);
15081508

15091509
if (!amdgpu_sriov_vf(adev)) {
1510+
ring = &adev->sdma.instance[i].ring;
1511+
adev->nbio.funcs->sdma_doorbell_range(adev, i,
1512+
ring->use_doorbell, ring->doorbell_index,
1513+
adev->doorbell_index.sdma_doorbell_range);
1514+
15101515
/* unhalt engine */
15111516
temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL);
15121517
temp = REG_SET_FIELD(temp, SDMA0_F32_CNTL, HALT, 0);

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,22 +1416,6 @@ static int soc15_common_sw_fini(void *handle)
14161416
return 0;
14171417
}
14181418

1419-
static void soc15_doorbell_range_init(struct amdgpu_device *adev)
1420-
{
1421-
int i;
1422-
struct amdgpu_ring *ring;
1423-
1424-
/* sdma/ih doorbell range are programed by hypervisor */
1425-
if (!amdgpu_sriov_vf(adev)) {
1426-
for (i = 0; i < adev->sdma.num_instances; i++) {
1427-
ring = &adev->sdma.instance[i].ring;
1428-
adev->nbio.funcs->sdma_doorbell_range(adev, i,
1429-
ring->use_doorbell, ring->doorbell_index,
1430-
adev->doorbell_index.sdma_doorbell_range);
1431-
}
1432-
}
1433-
}
1434-
14351419
static int soc15_common_hw_init(void *handle)
14361420
{
14371421
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1451,12 +1435,6 @@ static int soc15_common_hw_init(void *handle)
14511435

14521436
/* enable the doorbell aperture */
14531437
soc15_enable_doorbell_aperture(adev, true);
1454-
/* HW doorbell routing policy: doorbell writing not
1455-
* in SDMA/IH/MM/ACV range will be routed to CP. So
1456-
* we need to init SDMA/IH/MM/ACV doorbell range prior
1457-
* to CP ip block init and ring test.
1458-
*/
1459-
soc15_doorbell_range_init(adev);
14601438

14611439
return 0;
14621440
}

0 commit comments

Comments
 (0)