mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/amdgpu: stop unmapping MQD for kernel queues v3
This looks unnecessary and actually extremely harmful since using kmap() is not possible while inside the ring reset. Remove all the extra mapping and unmapping of the MQDs. v2: also fix debugfs v3: fix coding style typo Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
510a16d995
commit
1f86f4125e
@@ -3001,37 +3001,19 @@ static int gfx_v12_0_kgq_init_queue(struct amdgpu_ring *ring, bool reset)
|
||||
|
||||
static int gfx_v12_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
|
||||
{
|
||||
int r, i;
|
||||
struct amdgpu_ring *ring;
|
||||
int i, r;
|
||||
|
||||
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
|
||||
ring = &adev->gfx.gfx_ring[i];
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0))
|
||||
goto done;
|
||||
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
|
||||
if (!r) {
|
||||
r = gfx_v12_0_kgq_init_queue(ring, false);
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
ring->mqd_ptr = NULL;
|
||||
}
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
r = gfx_v12_0_kgq_init_queue(&adev->gfx.gfx_ring[i], false);
|
||||
if (r)
|
||||
goto done;
|
||||
return r;
|
||||
}
|
||||
|
||||
r = amdgpu_gfx_enable_kgq(adev, 0);
|
||||
if (r)
|
||||
goto done;
|
||||
return r;
|
||||
|
||||
r = gfx_v12_0_cp_gfx_start(adev);
|
||||
if (r)
|
||||
goto done;
|
||||
|
||||
done:
|
||||
return r;
|
||||
return gfx_v12_0_cp_gfx_start(adev);
|
||||
}
|
||||
|
||||
static int gfx_v12_0_compute_mqd_init(struct amdgpu_device *adev, void *m,
|
||||
@@ -3344,57 +3326,25 @@ static int gfx_v12_0_kcq_init_queue(struct amdgpu_ring *ring, bool reset)
|
||||
|
||||
static int gfx_v12_0_kiq_resume(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_ring *ring;
|
||||
int r;
|
||||
|
||||
ring = &adev->gfx.kiq[0].ring;
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0))
|
||||
return r;
|
||||
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
|
||||
if (unlikely(r != 0)) {
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
return r;
|
||||
}
|
||||
|
||||
gfx_v12_0_kiq_init_queue(ring);
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
ring->mqd_ptr = NULL;
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
ring->sched.ready = true;
|
||||
gfx_v12_0_kiq_init_queue(&adev->gfx.kiq[0].ring);
|
||||
adev->gfx.kiq[0].ring.sched.ready = true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_v12_0_kcq_resume(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_ring *ring = NULL;
|
||||
int r = 0, i;
|
||||
int i, r;
|
||||
|
||||
if (!amdgpu_async_gfx_ring)
|
||||
gfx_v12_0_cp_compute_enable(adev, true);
|
||||
|
||||
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
|
||||
ring = &adev->gfx.compute_ring[i];
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0))
|
||||
goto done;
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
|
||||
if (!r) {
|
||||
r = gfx_v12_0_kcq_init_queue(ring, false);
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
ring->mqd_ptr = NULL;
|
||||
}
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
r = gfx_v12_0_kcq_init_queue(&adev->gfx.compute_ring[i], false);
|
||||
if (r)
|
||||
goto done;
|
||||
return r;
|
||||
}
|
||||
|
||||
r = amdgpu_gfx_enable_kcq(adev, 0);
|
||||
done:
|
||||
return r;
|
||||
return amdgpu_gfx_enable_kcq(adev, 0);
|
||||
}
|
||||
|
||||
static int gfx_v12_0_cp_resume(struct amdgpu_device *adev)
|
||||
@@ -5224,20 +5174,9 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring, unsigned int vmid)
|
||||
return r;
|
||||
}
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0)) {
|
||||
dev_err(adev->dev, "fail to resv mqd_obj\n");
|
||||
return r;
|
||||
}
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
|
||||
if (!r) {
|
||||
r = gfx_v12_0_kgq_init_queue(ring, true);
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
ring->mqd_ptr = NULL;
|
||||
}
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
r = gfx_v12_0_kgq_init_queue(ring, true);
|
||||
if (r) {
|
||||
DRM_ERROR("fail to unresv mqd_obj\n");
|
||||
dev_err(adev->dev, "failed to init kgq\n");
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -5264,20 +5203,9 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring, unsigned int vmid)
|
||||
return r;
|
||||
}
|
||||
|
||||
r = amdgpu_bo_reserve(ring->mqd_obj, false);
|
||||
if (unlikely(r != 0)) {
|
||||
DRM_ERROR("fail to resv mqd_obj\n");
|
||||
return r;
|
||||
}
|
||||
r = amdgpu_bo_kmap(ring->mqd_obj, (void **)&ring->mqd_ptr);
|
||||
if (!r) {
|
||||
r = gfx_v12_0_kcq_init_queue(ring, true);
|
||||
amdgpu_bo_kunmap(ring->mqd_obj);
|
||||
ring->mqd_ptr = NULL;
|
||||
}
|
||||
amdgpu_bo_unreserve(ring->mqd_obj);
|
||||
r = gfx_v12_0_kcq_init_queue(ring, true);
|
||||
if (r) {
|
||||
DRM_ERROR("fail to unresv mqd_obj\n");
|
||||
dev_err(adev->dev, "failed to init kcq\n");
|
||||
return r;
|
||||
}
|
||||
r = amdgpu_mes_map_legacy_queue(adev, ring);
|
||||
|
||||
Reference in New Issue
Block a user