diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index aea277aeb..6b3d60bc9 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -1,7 +1,7 @@ /* * GK20A Graphics channel * - * Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2023, 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"), @@ -441,9 +441,13 @@ clean_up: static inline u32 channel_update_gpfifo_get(struct gk20a *g, struct nvgpu_channel *c) { - u32 new_get = g->ops.userd.gp_get(g, c); + u32 new_get = 0U; + + if (g->ops.userd.gp_get != NULL) { + new_get = g->ops.userd.gp_get(g, c); + c->gpfifo.get = new_get; + } - c->gpfifo.get = new_get; return new_get; } diff --git a/drivers/gpu/nvgpu/common/fifo/channel_wdt.c b/drivers/gpu/nvgpu/common/fifo/channel_wdt.c index 2d6382dde..92794ea6c 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel_wdt.c +++ b/drivers/gpu/nvgpu/common/fifo/channel_wdt.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2023, 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"), @@ -51,8 +51,13 @@ static struct nvgpu_channel_wdt_state nvgpu_channel_collect_wdt_state( * accesses. The kernel mem for userd may not even exist; this * channel could be in usermode submit mode. */ - state.gp_get = g->ops.userd.gp_get(g, ch); - state.pb_get = g->ops.userd.pb_get(g, ch); + if (g->ops.userd.gp_get != NULL) { + state.gp_get = g->ops.userd.gp_get(g, ch); + } + + if (g->ops.userd.pb_get != NULL) { + state.pb_get = g->ops.userd.pb_get(g, ch); + } } return state;