gpu: nvgpu: isolate channel watchdog unit

Move the definition of struct nvgpu_channel_wdt to watchdog.c. Adjust
users of it to access it via an unified interface instead of poking
directly at the channel internals.

Jira NVGPU-5494

Change-Id: Ie11826e6732a8b98e72c4f81dd06bd7e49848121
Signed-off-by: Konsta Hölttä <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2345935
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Konsta Hölttä
2020-05-07 15:53:06 +03:00
committed by Alex Waterman
parent 21e02878f4
commit 16fb7654a5
8 changed files with 176 additions and 95 deletions

View File

@@ -29,6 +29,7 @@
#include <nvgpu/channel.h>
#include <nvgpu/channel_sync.h>
#include <nvgpu/channel_sync_syncpt.h>
#include <nvgpu/watchdog.h>
#include <nvgpu/job.h>
#include <nvgpu/priv_cmdbuf.h>
#include <nvgpu/bug.h>
@@ -551,7 +552,7 @@ static int nvgpu_submit_deterministic(struct nvgpu_channel *c,
#ifdef CONFIG_NVGPU_CHANNEL_WDT
/* the watchdog needs periodic job cleanup */
if (c->wdt.enabled) {
if (nvgpu_channel_wdt_enabled(c->wdt)) {
return -EINVAL;
}
#endif
@@ -666,7 +667,8 @@ static int nvgpu_submit_nondeterministic(struct nvgpu_channel *c,
!skip_buffer_refcounting);
#ifdef CONFIG_NVGPU_CHANNEL_WDT
need_job_tracking = need_job_tracking || c->wdt.enabled;
need_job_tracking = need_job_tracking ||
nvgpu_channel_wdt_enabled(c->wdt);
#endif
if (need_job_tracking) {