From 440cf0c75e10170acc88fdc8a4c204ec37c6e0d8 Mon Sep 17 00:00:00 2001 From: prsethi Date: Tue, 2 Aug 2022 14:07:02 +0000 Subject: [PATCH] gpu: nvgpu: nvs: supporting changes to plug nvs with QNX - Remove '()' from logging macro to fix compilation issue with QNX - Add NSEC_PER_MSEC which is missing for QNX. Jira NVGPU-8619 Change-Id: I0bc5c5a9c6979a0a78e29d26a40ca7927b25e5d0 Signed-off-by: prsethi Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2754721 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/common/nvs/nvs_sched.c | 5 ++++- drivers/gpu/nvgpu/include/external-nvs/impl.h | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c index 960d0705e..188e67333 100644 --- a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c +++ b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c @@ -34,6 +34,9 @@ static struct nvs_sched_ops nvgpu_nvs_ops = { .recover = NULL, }; +#ifndef NSEC_PER_MSEC +#define NSEC_PER_MSEC 1000000U +#endif /* * TODO: make use of worker items when * 1) the active domain gets modified @@ -321,7 +324,7 @@ static void nvgpu_nvs_worker_wakeup_post_process(struct nvgpu_worker *worker) if (next_timeout_ns != 0U) { nvs_worker->current_timeout = - (next_timeout_ns + NSEC_PER_MSEC - 1) / NSEC_PER_MSEC; + (next_timeout_ns + NSEC_PER_MSEC - 1U) / NSEC_PER_MSEC; } nvgpu_timeout_init_cpu_timer_sw(g, &nvs_worker->timeout, diff --git a/drivers/gpu/nvgpu/include/external-nvs/impl.h b/drivers/gpu/nvgpu/include/external-nvs/impl.h index c821121a4..c8cd97f4e 100644 --- a/drivers/gpu/nvgpu/include/external-nvs/impl.h +++ b/drivers/gpu/nvgpu/include/external-nvs/impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2021-2022 NVIDIA Corporation. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -42,7 +42,7 @@ #define nvs_log(sched, fmt, args...) \ nvgpu_log((struct gk20a *)(sched)->priv, \ - gpu_dbg_nvs_internal, (fmt), ##args) + gpu_dbg_nvs_internal, fmt, ##args) #endif