From 7b8a08af7af3b116f3b40bff78cfb061c18ff7ad Mon Sep 17 00:00:00 2001 From: Richard Zhao Date: Tue, 16 Jun 2020 18:09:59 -0700 Subject: [PATCH] gpu: nvgpu: check ch->wdt on wdt restart all channels ch->wdt is not always initialized. For example it's not initialized on gpu server, since the channel wdt is managed on client side. Bug 2833924 Signed-off-by: Richard Zhao Change-Id: Idb06f7de6a15e093bbb08be16454777b9d7582b9 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2361978 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Peter Daifuku Reviewed-by: Konsta Holtta Reviewed-by: automaticguardword Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/fifo/watchdog.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/common/fifo/watchdog.c b/drivers/gpu/nvgpu/common/fifo/watchdog.c index 3fe0328a2..02f55cfa1 100644 --- a/drivers/gpu/nvgpu/common/fifo/watchdog.c +++ b/drivers/gpu/nvgpu/common/fifo/watchdog.c @@ -230,7 +230,8 @@ void nvgpu_channel_wdt_restart_all_channels(struct gk20a *g) struct nvgpu_channel *ch = nvgpu_channel_from_id(g, chid); if (ch != NULL) { - if (!nvgpu_channel_check_unserviceable(ch)) { + if ((ch->wdt != NULL) && + (!nvgpu_channel_check_unserviceable(ch))) { nvgpu_channel_wdt_rewind(ch->wdt, ch); } nvgpu_channel_put(ch);