]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amdkfd: simplify svm_range_unmap_from_gpus()
authorYury Norov <ynorov@nvidia.com>
Wed, 14 Jan 2026 16:05:10 +0000 (11:05 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Jan 2026 19:24:19 +0000 (14:24 -0500)
The function calls bitmap_or() followed by for_each_set_bit().
Switch it to the dedicated for_each_or_bit() and drop the temporary
bitmap.

Signed-off-by: Yury Norov <ynorov@nvidia.com>
Signed-off-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c

index 35036d47657be178ed99ca9549cdb99b5bcf3856..fcddb54a439f99a0ff87c06dea52c6a3f82679db 100644 (file)
@@ -1372,7 +1372,6 @@ static int
 svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start,
                          unsigned long last, uint32_t trigger)
 {
-       DECLARE_BITMAP(bitmap, MAX_GPU_INSTANCE);
        struct kfd_process_device *pdd;
        struct dma_fence *fence = NULL;
        struct kfd_process *p;
@@ -1390,11 +1389,9 @@ svm_range_unmap_from_gpus(struct svm_range *prange, unsigned long start,
                prange->mapped_to_gpu = false;
        }
 
-       bitmap_or(bitmap, prange->bitmap_access, prange->bitmap_aip,
-                 MAX_GPU_INSTANCE);
        p = container_of(prange->svms, struct kfd_process, svms);
 
-       for_each_set_bit(gpuidx, bitmap, MAX_GPU_INSTANCE) {
+       for_each_or_bit(gpuidx, prange->bitmap_access, prange->bitmap_aip, MAX_GPU_INSTANCE) {
                pr_debug("unmap from gpu idx 0x%x\n", gpuidx);
                pdd = kfd_process_device_from_gpuidx(p, gpuidx);
                if (!pdd) {