mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: require deterministic for usermode
Deterministic mode has always been a requirement for usermode submit; enforce it in the setup_bind path. Adjust tests to use the flag. QNX uses NVGPU_SETUP_BIND_FLAGS_SUPPORT_DETERMINISTIC only if CONFIG_NVGPU_IOCTL_NON_FUSA is set, so guard the check with that for now. Jira NVGPU-5582 Change-Id: Idedd01a3a24420b45195a472e8ca5c9f32f4ef46 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2369818 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
b86d5461c3
commit
a04525ece8
@@ -1640,6 +1640,22 @@ static int channel_setup_bind_prechecks(struct nvgpu_channel *c,
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* FUSA build for now assumes that the deterministic flag is not useful */
|
||||
#ifdef CONFIG_NVGPU_IOCTL_NON_FUSA
|
||||
if ((args->flags & NVGPU_SETUP_BIND_FLAGS_USERMODE_SUPPORT) != 0U &&
|
||||
(args->flags & NVGPU_SETUP_BIND_FLAGS_SUPPORT_DETERMINISTIC) == 0U) {
|
||||
/*
|
||||
* Usermode submit shares various preconditions with
|
||||
* deterministic mode. Require that it's explicitly set to
|
||||
* avoid surprises.
|
||||
*/
|
||||
nvgpu_err(g, "need deterministic for usermode submit");
|
||||
err = -EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
fail:
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -821,6 +821,8 @@ int test_channel_setup_bind(struct unit_module *m, struct gk20a *g, void *vargs)
|
||||
bind_args.flags &=
|
||||
~NVGPU_SETUP_BIND_FLAGS_USERMODE_SUPPORT;
|
||||
} else {
|
||||
bind_args.flags |=
|
||||
NVGPU_SETUP_BIND_FLAGS_SUPPORT_DETERMINISTIC;
|
||||
bind_args.flags |=
|
||||
NVGPU_SETUP_BIND_FLAGS_USERMODE_SUPPORT;
|
||||
}
|
||||
@@ -1705,6 +1707,7 @@ int test_channel_semaphore_wakeup(struct unit_module *m,
|
||||
memset(&bind_args, 0, sizeof(bind_args));
|
||||
bind_args.num_gpfifo_entries = 32;
|
||||
|
||||
bind_args.flags |= NVGPU_SETUP_BIND_FLAGS_SUPPORT_DETERMINISTIC;
|
||||
bind_args.flags |= NVGPU_SETUP_BIND_FLAGS_USERMODE_SUPPORT;
|
||||
|
||||
err = nvgpu_channel_setup_bind(ch, &bind_args);
|
||||
|
||||
Reference in New Issue
Block a user