summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdkfd
diff options
context:
space:
mode:
authorYifan Zhang <yifan1.zhang@amd.com>2024-08-27 15:14:31 +0800
committerAlex Deucher <alexander.deucher@amd.com>2024-08-29 13:40:00 -0400
commit96316211eb5c4b58f34099e9e6f71fdfad7af01a (patch)
tree6ad6df11c842186bae8799b6ce373be71bcf2e8e /drivers/gpu/drm/amd/amdkfd
parent1125f95cd2455b51ad1c16d7f96ae39117083d20 (diff)
downloadlwn-96316211eb5c4b58f34099e9e6f71fdfad7af01a.tar.gz
lwn-96316211eb5c4b58f34099e9e6f71fdfad7af01a.zip
drm/amdkfd: Don't drain ih1 for APU
ih1 is not initialized for APUs. Don't drain it or NULL pointer error will be triggered. Fixes: 6ef29715ac06 ("drm/amdkfd: Change kfd/svm page fault drain handling") Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdkfd')
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_svm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index ce2a5d9f90d3..40c94c4cdd96 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -2464,11 +2464,14 @@ svm_range_unmap_from_cpu(struct mm_struct *mm, struct svm_range *prange,
adev = pdd->dev->adev;
/* Check and drain ih1 ring if cam not available */
- ih = &adev->irq.ih1;
- checkpoint_wptr = amdgpu_ih_get_wptr(adev, ih);
- if (ih->rptr != checkpoint_wptr) {
- svms->checkpoint_ts[i] = amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
- continue;
+ if (adev->irq.ih1.ring_size) {
+ ih = &adev->irq.ih1;
+ checkpoint_wptr = amdgpu_ih_get_wptr(adev, ih);
+ if (ih->rptr != checkpoint_wptr) {
+ svms->checkpoint_ts[i] =
+ amdgpu_ih_decode_iv_ts(adev, ih, checkpoint_wptr, -1);
+ continue;
+ }
}
/* check if dev->irq.ih_soft is not empty */