]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: Allow kfd CRIU with no buffer objects
authorDavid Francis <David.Francis@amd.com>
Wed, 19 Feb 2025 15:01:32 +0000 (10:01 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 2 Sep 2025 19:53:56 +0000 (15:53 -0400)
The kfd CRIU checkpoint ioctl would return an error if trying
to checkpoint a process with no kfd buffer objects.

This is a normal case and should not be an error.

Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: David Francis <David.Francis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c

index 43115a3744694337204b9a1dbc7a769de7195833..8535a52a62cab7d0a9441de1a3c8c67a7c29351e 100644 (file)
@@ -2571,8 +2571,8 @@ static int criu_restore(struct file *filep,
        pr_debug("CRIU restore (num_devices:%u num_bos:%u num_objects:%u priv_data_size:%llu)\n",
                 args->num_devices, args->num_bos, args->num_objects, args->priv_data_size);
 
-       if (!args->bos || !args->devices || !args->priv_data || !args->priv_data_size ||
-           !args->num_devices || !args->num_bos)
+       if ((args->num_bos > 0 && !args->bos) || !args->devices || !args->priv_data ||
+           !args->priv_data_size || !args->num_devices)
                return -EINVAL;
 
        mutex_lock(&p->mutex);