mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: enable clk_arb for dGPU safety
Enable CONFIG_NVGPU_CLK_ARB for dGPU safety build. Use CONFIG_NVGPU_NON_FUSA for invocation of non-safe functions: - nvgpu_hr_timestamp - nvgpu_hr_timestamp_us Jira NVGPU-4661 Jira NVGPU-5235 (for addressing usage of above functions). Change-Id: I271fdbc45c1e4d01cb70d50dcf63d15b9df33c76 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2317842 Reviewed-by: automaticguardword <automaticguardword@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User 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> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Alex Waterman
parent
401d4cbc5f
commit
88c774e5d1
@@ -120,6 +120,9 @@ NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_USE_3LSS_ERR_INJECTION
|
||||
|
||||
CONFIG_NVGPU_LS_PMU := 1
|
||||
NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_LS_PMU
|
||||
|
||||
CONFIG_NVGPU_CLK_ARB := 1
|
||||
NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_CLK_ARB
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
@@ -72,11 +72,14 @@ static void nvgpu_clk_arb_queue_notification(struct gk20a *g,
|
||||
u32 alarm_mask) {
|
||||
|
||||
u32 queue_index;
|
||||
u64 timestamp;
|
||||
u64 timestamp = 0U;
|
||||
|
||||
queue_index = U32(nvgpu_atomic_inc_return(&queue->tail)) % queue->size;
|
||||
|
||||
#ifdef CONFIG_NVGPU_NON_FUSA
|
||||
/* get current timestamp */
|
||||
timestamp = (u64) nvgpu_hr_timestamp();
|
||||
#endif
|
||||
|
||||
queue->clk_q_notifications[queue_index].timestamp = timestamp;
|
||||
queue->clk_q_notifications[queue_index].clk_notification = alarm_mask;
|
||||
|
||||
@@ -262,6 +262,7 @@ int tu104_init_clk_support(struct gk20a *g)
|
||||
}
|
||||
|
||||
u32 tu104_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) {
|
||||
#ifdef CONFIG_NVGPU_NON_FUSA
|
||||
u32 cntr = 0;
|
||||
u64 cntr_start = 0;
|
||||
u64 cntr_stop = 0;
|
||||
@@ -310,6 +311,7 @@ u32 tu104_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) {
|
||||
}
|
||||
|
||||
nvgpu_mutex_release(&clk->clk_mutex);
|
||||
#endif
|
||||
/* too many iterations, bail out */
|
||||
nvgpu_err(g, "failed to get clk rate");
|
||||
return -EBUSY;
|
||||
|
||||
Reference in New Issue
Block a user