diff options
| author | Christian König <christian.koenig@amd.com> | 2018-09-26 05:08:32 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-07 18:14:07 -0500 |
| commit | 2026057736e9134c524ad85b526005944034e00f (patch) | |
| tree | 8283c01edb7d2d2ab300220e468e700811c85f37 /drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | |
| parent | b408a548846f2343716351d55a6c9af9e73ec32c (diff) | |
drm/amdgpu: send IVs to the KFD only after processing them v3
This allows us to filter out VM faults in the GMC code.
v2: don't filter out all faults
v3: fix copy&paste typo, send all IV to the KFD, don't change message level
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c index 6b6524f04ce0..79b6f456f2c5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | |||
| @@ -149,9 +149,6 @@ static void amdgpu_irq_callback(struct amdgpu_device *adev, | |||
| 149 | if (!amdgpu_ih_prescreen_iv(adev)) | 149 | if (!amdgpu_ih_prescreen_iv(adev)) |
| 150 | return; | 150 | return; |
| 151 | 151 | ||
| 152 | /* Before dispatching irq to IP blocks, send it to amdkfd */ | ||
| 153 | amdgpu_amdkfd_interrupt(adev, (const void *) &ih->ring[ring_index]); | ||
| 154 | |||
| 155 | entry.iv_entry = (const uint32_t *)&ih->ring[ring_index]; | 152 | entry.iv_entry = (const uint32_t *)&ih->ring[ring_index]; |
| 156 | amdgpu_ih_decode_iv(adev, &entry); | 153 | amdgpu_ih_decode_iv(adev, &entry); |
| 157 | 154 | ||
| @@ -371,39 +368,38 @@ void amdgpu_irq_dispatch(struct amdgpu_device *adev, | |||
| 371 | unsigned client_id = entry->client_id; | 368 | unsigned client_id = entry->client_id; |
| 372 | unsigned src_id = entry->src_id; | 369 | unsigned src_id = entry->src_id; |
| 373 | struct amdgpu_irq_src *src; | 370 | struct amdgpu_irq_src *src; |
| 371 | bool handled = false; | ||
| 374 | int r; | 372 | int r; |
| 375 | 373 | ||
| 376 | trace_amdgpu_iv(entry); | 374 | trace_amdgpu_iv(entry); |
| 377 | 375 | ||
| 378 | if (client_id >= AMDGPU_IRQ_CLIENTID_MAX) { | 376 | if (client_id >= AMDGPU_IRQ_CLIENTID_MAX) { |
| 379 | DRM_DEBUG("Invalid client_id in IV: %d\n", client_id); | 377 | DRM_DEBUG("Invalid client_id in IV: %d\n", client_id); |
| 380 | return; | ||
| 381 | } | ||
| 382 | 378 | ||
| 383 | if (src_id >= AMDGPU_MAX_IRQ_SRC_ID) { | 379 | } else if (src_id >= AMDGPU_MAX_IRQ_SRC_ID) { |
| 384 | DRM_DEBUG("Invalid src_id in IV: %d\n", src_id); | 380 | DRM_DEBUG("Invalid src_id in IV: %d\n", src_id); |
| 385 | return; | ||
| 386 | } | ||
| 387 | 381 | ||
| 388 | if (adev->irq.virq[src_id]) { | 382 | } else if (adev->irq.virq[src_id]) { |
| 389 | generic_handle_irq(irq_find_mapping(adev->irq.domain, src_id)); | 383 | generic_handle_irq(irq_find_mapping(adev->irq.domain, src_id)); |
| 390 | } else { | ||
| 391 | if (!adev->irq.client[client_id].sources) { | ||
| 392 | DRM_DEBUG("Unregistered interrupt client_id: %d src_id: %d\n", | ||
| 393 | client_id, src_id); | ||
| 394 | return; | ||
| 395 | } | ||
| 396 | 384 | ||
| 397 | src = adev->irq.client[client_id].sources[src_id]; | 385 | } else if (!adev->irq.client[client_id].sources) { |
| 398 | if (!src) { | 386 | DRM_DEBUG("Unregistered interrupt client_id: %d src_id: %d\n", |
| 399 | DRM_DEBUG("Unhandled interrupt src_id: %d\n", src_id); | 387 | client_id, src_id); |
| 400 | return; | ||
| 401 | } | ||
| 402 | 388 | ||
| 389 | } else if ((src = adev->irq.client[client_id].sources[src_id])) { | ||
| 403 | r = src->funcs->process(adev, src, entry); | 390 | r = src->funcs->process(adev, src, entry); |
| 404 | if (r) | 391 | if (r < 0) |
| 405 | DRM_ERROR("error processing interrupt (%d)\n", r); | 392 | DRM_ERROR("error processing interrupt (%d)\n", r); |
| 393 | else if (r) | ||
| 394 | handled = true; | ||
| 395 | |||
| 396 | } else { | ||
| 397 | DRM_DEBUG("Unhandled interrupt src_id: %d\n", src_id); | ||
| 406 | } | 398 | } |
| 399 | |||
| 400 | /* Send it to amdkfd as well if it isn't already handled */ | ||
| 401 | if (!handled) | ||
| 402 | amdgpu_amdkfd_interrupt(adev, entry->iv_entry); | ||
| 407 | } | 403 | } |
| 408 | 404 | ||
| 409 | /** | 405 | /** |
