diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index a4a808e64..e226b7c26 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -69,6 +69,8 @@ #include "channel_wdt.h" #include "channel_worker.h" +#define CHANNEL_MAX_GPFIFO_ENTRIES 0x80000000U + static void free_channel(struct nvgpu_fifo *f, struct nvgpu_channel *ch); static void channel_dump_ref_actions(struct nvgpu_channel *ch); @@ -1409,7 +1411,7 @@ static int channel_setup_bind_prechecks(struct nvgpu_channel *c, struct nvgpu_tsg *tsg; int err = 0; - if (args->num_gpfifo_entries > 0x80000000U) { + if (args->num_gpfifo_entries > CHANNEL_MAX_GPFIFO_ENTRIES) { nvgpu_err(g, "num_gpfifo_entries exceeds max limit of 2^31"); err = -EINVAL; diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h index e8d754ba0..1277877fc 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/channel.h +++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h @@ -831,6 +831,7 @@ int nvgpu_channel_suspend_all_serviceable_ch(struct gk20a *g); */ int nvgpu_channel_resume_all_serviceable_ch(struct gk20a *g); +#ifdef CONFIG_NVGPU_DETERMINISTIC_CHANNELS /** * @brief Stop deterministic channel activity for do_idle(). * @@ -857,6 +858,7 @@ void nvgpu_channel_deterministic_idle(struct gk20a *g); * @note Must be paired with #nvgpu_channel_deterministic_idle(). */ void nvgpu_channel_deterministic_unidle(struct gk20a *g); +#endif /** * @brief Get a reference to the channel.