mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
gpu: nvgpu: add safety build flag CONFIG_NVGPU_SW_SEMAPHORE
Added the safety build flag CONFIG_NVGPU_SW_SEMAPHORE to compile out sw semaphore implementation in NVGPU. sw semaphore is only used for presilicon bringup of GPU and hence is not needed for safety build. Jira NVGPU-3172 Change-Id: I6a46ef22f1e2059437f710198f4ea49a47656fef Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2164216 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: Sagar Kamble <skamble@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
feb3ba3d59
commit
92d009e796
@@ -322,8 +322,7 @@ done:
|
||||
#define F_CHANNEL_CLOSE_AS_BOUND BIT(7)
|
||||
#define F_CHANNEL_CLOSE_FREE_SUBCTX BIT(8)
|
||||
#define F_CHANNEL_CLOSE_USER_SYNC BIT(9)
|
||||
#define F_CHANNEL_CLOSE_HW_SEMA BIT(10)
|
||||
#define F_CHANNEL_CLOSE_LAST BIT(11)
|
||||
#define F_CHANNEL_CLOSE_LAST BIT(10)
|
||||
|
||||
/* nvgpu_tsg_unbind_channel always return 0 */
|
||||
|
||||
@@ -338,7 +337,6 @@ static const char *f_channel_close[] = {
|
||||
"as_bound",
|
||||
"free_subctx",
|
||||
"user_sync",
|
||||
"hw_sema",
|
||||
};
|
||||
|
||||
static void stub_os_channel_close(struct nvgpu_channel *ch, bool force)
|
||||
@@ -365,12 +363,8 @@ static bool channel_close_pruned(u32 branches, u32 final)
|
||||
if ((branches & F_CHANNEL_CLOSE_AS_BOUND) == 0) {
|
||||
branches &= ~F_CHANNEL_CLOSE_FREE_SUBCTX;
|
||||
branches &= ~F_CHANNEL_CLOSE_USER_SYNC;
|
||||
branches &= ~F_CHANNEL_CLOSE_HW_SEMA;
|
||||
}
|
||||
|
||||
/* TODO: add semaphore pool init to support this */
|
||||
branches &= ~F_CHANNEL_CLOSE_HW_SEMA;
|
||||
|
||||
if (branches < branches_init) {
|
||||
return true;
|
||||
}
|
||||
@@ -418,7 +412,6 @@ static int test_channel_close(struct unit_module *m,
|
||||
ch = gk20a_open_new_channel(g, runlist_id,
|
||||
privileged, getpid(), getpid());
|
||||
assert(ch != NULL);
|
||||
assert(ch->hw_sema == NULL);
|
||||
|
||||
ch->usermode_submit_enabled = true;
|
||||
|
||||
@@ -460,11 +453,6 @@ static int test_channel_close(struct unit_module *m,
|
||||
assert(err == 0);
|
||||
}
|
||||
|
||||
if (branches & F_CHANNEL_CLOSE_HW_SEMA) {
|
||||
err = nvgpu_hw_semaphore_init(ch);
|
||||
assert(err == 0);
|
||||
}
|
||||
|
||||
if (branches & F_CHANNEL_CLOSE_ALREADY_FREED) {
|
||||
nvgpu_channel_close(ch);
|
||||
}
|
||||
@@ -527,7 +515,6 @@ static int test_channel_close(struct unit_module *m,
|
||||
assert(nvgpu_ref_put_return(&vm.ref, NULL));
|
||||
|
||||
assert(ch->user_sync == NULL);
|
||||
assert(ch->hw_sema == NULL);
|
||||
|
||||
unbind:
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user