mirror of
https://github.com/torvalds/linux.git
synced 2026-10-12 05:17:15 +02:00
drm/amdgpu: Remove faulty queue before resume
When driver already knows a bad queue but MES suspend_all is successful and MES hung queue detection doesn't detect it, remove this queue refore resume_all. Signed-off-by: Amber Lin <Amber.Lin@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
913c0d83be
commit
f401a2633e
|
|
@ -2244,7 +2244,8 @@ int amdgpu_gfx_reset_mes_compute(struct amdgpu_device *adev,
|
||||||
struct amdgpu_ring *ring,
|
struct amdgpu_ring *ring,
|
||||||
struct amdgpu_fence *guilty_fence,
|
struct amdgpu_fence *guilty_fence,
|
||||||
struct amdgpu_usermode_queue *uq,
|
struct amdgpu_usermode_queue *uq,
|
||||||
unsigned int *hung_queue_count)
|
unsigned int *hung_queue_count,
|
||||||
|
void *faulty_queue_input)
|
||||||
{
|
{
|
||||||
struct amdgpu_mes_hung_queue_hqd_info *hqd_info =
|
struct amdgpu_mes_hung_queue_hqd_info *hqd_info =
|
||||||
(struct amdgpu_mes_hung_queue_hqd_info *)
|
(struct amdgpu_mes_hung_queue_hqd_info *)
|
||||||
|
|
@ -2252,6 +2253,7 @@ int amdgpu_gfx_reset_mes_compute(struct amdgpu_device *adev,
|
||||||
int i, r, pipe, queue, queue_type;
|
int i, r, pipe, queue, queue_type;
|
||||||
unsigned int num_hung = 0;
|
unsigned int num_hung = 0;
|
||||||
bool use_mmio = adev->gfx.mec.use_mmio_for_reset;
|
bool use_mmio = adev->gfx.mec.use_mmio_for_reset;
|
||||||
|
struct mes_remove_queue_input *queue_input = (struct mes_remove_queue_input *)faulty_queue_input;
|
||||||
|
|
||||||
guard(mutex)(&adev->gfx.mec.reset_mutex);
|
guard(mutex)(&adev->gfx.mec.reset_mutex);
|
||||||
/* stop the drm schedulers for all compute queues */
|
/* stop the drm schedulers for all compute queues */
|
||||||
|
|
@ -2306,6 +2308,20 @@ int amdgpu_gfx_reset_mes_compute(struct amdgpu_device *adev,
|
||||||
if (r)
|
if (r)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* MES doesn't detect any hung queue but we have a known bad queue
|
||||||
|
* and it is not KCQ
|
||||||
|
*/
|
||||||
|
if (!num_hung && queue_input && !ring) {
|
||||||
|
/* MES suspend_all is successful means this bad queue is
|
||||||
|
* preempted successfuly. Remove it before resume all so it
|
||||||
|
* doesn't get mapped back
|
||||||
|
*/
|
||||||
|
amdgpu_mes_lock(&adev->mes);
|
||||||
|
r = adev->mes.funcs->remove_hw_queue(&adev->mes, queue_input);
|
||||||
|
amdgpu_mes_unlock(&adev->mes);
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* resume all will enable the non-hung queues */
|
/* resume all will enable the non-hung queues */
|
||||||
amdgpu_mes_resume(adev, 0);
|
amdgpu_mes_resume(adev, 0);
|
||||||
|
|
|
||||||
|
|
@ -651,7 +651,8 @@ int amdgpu_gfx_reset_mes_compute(struct amdgpu_device *adev,
|
||||||
struct amdgpu_ring *ring,
|
struct amdgpu_ring *ring,
|
||||||
struct amdgpu_fence *guilty_fence,
|
struct amdgpu_fence *guilty_fence,
|
||||||
struct amdgpu_usermode_queue *uq,
|
struct amdgpu_usermode_queue *uq,
|
||||||
unsigned int *hung_queue_count);
|
unsigned int *hung_queue_count,
|
||||||
|
void *faulty_queue_input);
|
||||||
void amdgpu_gfx_ras_error_func(struct amdgpu_device *adev,
|
void amdgpu_gfx_ras_error_func(struct amdgpu_device *adev,
|
||||||
void *ras_error_status,
|
void *ras_error_status,
|
||||||
void (*func)(struct amdgpu_device *adev, void *ras_error_status,
|
void (*func)(struct amdgpu_device *adev, void *ras_error_status,
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ static void amdgpu_userq_hang_detect_work(struct work_struct *work)
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (queue->queue_type == AMDGPU_HW_IP_COMPUTE)
|
if (queue->queue_type == AMDGPU_HW_IP_COMPUTE)
|
||||||
r = amdgpu_gfx_reset_mes_compute(adev, NULL, NULL, NULL, NULL);
|
r = amdgpu_gfx_reset_mes_compute(adev, NULL, NULL, NULL, NULL, NULL);
|
||||||
else
|
else
|
||||||
r = userq_funcs->reset(queue);
|
r = userq_funcs->reset(queue);
|
||||||
if (r)
|
if (r)
|
||||||
|
|
|
||||||
|
|
@ -6835,7 +6835,7 @@ static int gfx_v11_0_reset_kcq(struct amdgpu_ring *ring,
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
|
|
||||||
return amdgpu_gfx_reset_mes_compute(adev, ring, timedout_fence, NULL, NULL);
|
return amdgpu_gfx_reset_mes_compute(adev, ring, timedout_fence, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_v11_ip_print(struct amdgpu_ip_block *ip_block, struct drm_printer *p)
|
static void gfx_v11_ip_print(struct amdgpu_ip_block *ip_block, struct drm_printer *p)
|
||||||
|
|
|
||||||
|
|
@ -5261,7 +5261,7 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring,
|
||||||
{
|
{
|
||||||
struct amdgpu_device *adev = ring->adev;
|
struct amdgpu_device *adev = ring->adev;
|
||||||
|
|
||||||
return amdgpu_gfx_reset_mes_compute(adev, ring, timedout_fence, NULL, NULL);
|
return amdgpu_gfx_reset_mes_compute(adev, ring, timedout_fence, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_v12_0_ring_begin_use(struct amdgpu_ring *ring)
|
static void gfx_v12_0_ring_begin_use(struct amdgpu_ring *ring)
|
||||||
|
|
|
||||||
|
|
@ -464,7 +464,7 @@ static int reset_queues_mes(struct device_queue_manager *dqm)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
r = amdgpu_gfx_reset_mes_compute(adev, NULL, NULL, NULL, &num_hung);
|
r = amdgpu_gfx_reset_mes_compute(adev, NULL, NULL, NULL, &num_hung, NULL);
|
||||||
if (r)
|
if (r)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user