Skip to content

Commit e3163bc

Browse files
committed
drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega
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]
1 parent dc1d85c commit e3163bc

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
@@ -1504,6 +1504,11 @@ static int sdma_v4_0_start(struct amdgpu_device *adev)
15041504
WREG32_SDMA(i, mmSDMA0_CNTL, temp);
15051505

15061506
if (!amdgpu_sriov_vf(adev)) {
1507+
ring = &adev->sdma.instance[i].ring;
1508+
adev->nbio.funcs->sdma_doorbell_range(adev, i,
1509+
ring->use_doorbell, ring->doorbell_index,
1510+
adev->doorbell_index.sdma_doorbell_range);
1511+
15071512
/* unhalt engine */
15081513
temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL);
15091514
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
@@ -1211,22 +1211,6 @@ static int soc15_common_sw_fini(void *handle)
12111211
return 0;
12121212
}
12131213

1214-
static void soc15_doorbell_range_init(struct amdgpu_device *adev)
1215-
{
1216-
int i;
1217-
struct amdgpu_ring *ring;
1218-
1219-
/* sdma/ih doorbell range are programed by hypervisor */
1220-
if (!amdgpu_sriov_vf(adev)) {
1221-
for (i = 0; i < adev->sdma.num_instances; i++) {
1222-
ring = &adev->sdma.instance[i].ring;
1223-
adev->nbio.funcs->sdma_doorbell_range(adev, i,
1224-
ring->use_doorbell, ring->doorbell_index,
1225-
adev->doorbell_index.sdma_doorbell_range);
1226-
}
1227-
}
1228-
}
1229-
12301214
static int soc15_common_hw_init(void *handle)
12311215
{
12321216
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -1246,12 +1230,6 @@ static int soc15_common_hw_init(void *handle)
12461230

12471231
/* enable the doorbell aperture */
12481232
soc15_enable_doorbell_aperture(adev, true);
1249-
/* HW doorbell routing policy: doorbell writing not
1250-
* in SDMA/IH/MM/ACV range will be routed to CP. So
1251-
* we need to init SDMA/IH/MM/ACV doorbell range prior
1252-
* to CP ip block init and ring test.
1253-
*/
1254-
soc15_doorbell_range_init(adev);
12551233

12561234
return 0;
12571235
}

0 commit comments

Comments
 (0)