gpu: nvgpu: move runlist update timeout rc to common/rc

Move runlist update timeout recovery from runlist.c to
rc.c
Move RC_TYPE defines from fifo.h to rc.h

JIRA NVGPU-1314

Change-Id: I66925ca9fba904c523be69ad99808e3de33a7d46
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2093666
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seema Khowala
2019-04-09 13:51:12 -07:00
committed by mobile promotions
parent 9edd68ac52
commit 1882a7413d
10 changed files with 33 additions and 23 deletions

View File

@@ -26,6 +26,7 @@
#include <nvgpu/runlist.h>
#include <nvgpu/bug.h>
#include <nvgpu/dma.h>
#include <nvgpu/rc.h>
void nvgpu_fifo_lock_active_runlists(struct gk20a *g)
{
@@ -466,16 +467,6 @@ int nvgpu_fifo_reschedule_runlist(struct channel_gk20a *ch, bool preempt_next,
return ret;
}
static void gk20a_fifo_runlist_reset_engines(struct gk20a *g, u32 runlist_id)
{
u32 engines = g->ops.fifo.runlist_busy_engines(g, runlist_id);
if (engines != 0U) {
gk20a_fifo_recover(g, engines, ~(u32)0, false, false, true,
RC_TYPE_RUNLIST_UPDATE_TIMEOUT);
}
}
/* add/remove a channel from runlist
special cases below: runlist->active_channels will NOT be changed.
(ch == NULL && !add) means remove all active channels from runlist.
@@ -509,7 +500,7 @@ static int gk20a_runlist_update(struct gk20a *g, u32 runlist_id,
nvgpu_mutex_release(&runlist->runlist_lock);
if (ret == -ETIMEDOUT) {
gk20a_fifo_runlist_reset_engines(g, runlist_id);
nvgpu_rc_runlist_update(g, runlist_id);
}
return ret;

View File

@@ -27,6 +27,7 @@
#include <nvgpu/os_sched.h>
#include <nvgpu/channel.h>
#include <nvgpu/tsg.h>
#include <nvgpu/rc.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/error_notifier.h>
#include <nvgpu/gr/config.h>

View File

@@ -84,4 +84,14 @@ void nvgpu_rc_pbdma_fault(struct gk20a *g, struct fifo_gk20a *f,
} else {
nvgpu_err(g, "Invalid pbdma_status.id_type");
}
}
}
void nvgpu_rc_runlist_update(struct gk20a *g, u32 runlist_id)
{
u32 eng_bitmask = g->ops.fifo.runlist_busy_engines(g, runlist_id);
if (eng_bitmask != 0U) {
gk20a_fifo_recover(g, eng_bitmask, INVAL_ID, false, false, true,
RC_TYPE_RUNLIST_UPDATE_TIMEOUT);
}
}

View File

@@ -41,6 +41,7 @@
#include <nvgpu/io.h>
#include <nvgpu/utils.h>
#include <nvgpu/fifo.h>
#include <nvgpu/rc.h>
#include <nvgpu/runlist.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/channel.h>

View File

@@ -41,6 +41,7 @@
#include <nvgpu/io.h>
#include <nvgpu/utils.h>
#include <nvgpu/fifo.h>
#include <nvgpu/rc.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/channel.h>
#include <nvgpu/string.h>

View File

@@ -40,6 +40,7 @@
#include <nvgpu/io.h>
#include <nvgpu/utils.h>
#include <nvgpu/fifo.h>
#include <nvgpu/rc.h>
#include <nvgpu/runlist.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/channel.h>

View File

@@ -38,6 +38,7 @@
#include <nvgpu/channel.h>
#include <nvgpu/nvgpu_err.h>
#include <nvgpu/ltc.h>
#include <nvgpu/rc.h>
#include "gk20a/mm_gk20a.h"

View File

@@ -29,12 +29,12 @@
#include <nvgpu/tsg.h>
#include <nvgpu/nvgpu_err.h>
#include <nvgpu/error_notifier.h>
#include <nvgpu/rc.h>
#include <hal/fifo/fifo_intr_gk20a.h>
#include <hal/fifo/fifo_intr_gv11b.h>
#include <nvgpu/hw/gv11b/hw_fifo_gv11b.h>
#include <nvgpu/hw/gv11b/hw_pbdma_gv11b.h> /* TODO: remove */
static const char *const gv11b_sched_error_str[] = {
"xxx-0",

View File

@@ -25,16 +25,6 @@
#ifndef NVGPU_FIFO_COMMON_H
#define NVGPU_FIFO_COMMON_H
#define RC_TYPE_NO_RC 0U
#define RC_TYPE_MMU_FAULT 1U
#define RC_TYPE_PBDMA_FAULT 2U
#define RC_TYPE_GR_FAULT 3U
#define RC_TYPE_PREEMPT_TIMEOUT 4U
#define RC_TYPE_CTXSW_TIMEOUT 5U
#define RC_TYPE_RUNLIST_UPDATE_TIMEOUT 6U
#define RC_TYPE_FORCE_RESET 7U
#define RC_TYPE_SCHED_ERR 8U
#define INVAL_ID (~U32(0U))
#define CTXSW_TIMEOUT_PERIOD_MS 100U

View File

@@ -25,6 +25,18 @@
#include <nvgpu/types.h>
#define RC_TYPE_NO_RC 0U
#define RC_TYPE_MMU_FAULT 1U
#define RC_TYPE_PBDMA_FAULT 2U
#define RC_TYPE_GR_FAULT 3U
#define RC_TYPE_PREEMPT_TIMEOUT 4U
#define RC_TYPE_CTXSW_TIMEOUT 5U
#define RC_TYPE_RUNLIST_UPDATE_TIMEOUT 6U
#define RC_TYPE_FORCE_RESET 7U
#define RC_TYPE_SCHED_ERR 8U
#define INVAL_ID (~U32(0U))
struct gk20a;
struct tsg_gk20a;
struct fifo_gk20a;
@@ -35,4 +47,6 @@ void nvgpu_rc_ctxsw_timeout(struct gk20a *g, u32 eng_bitmask,
void nvgpu_rc_pbdma_fault(struct gk20a *g, struct fifo_gk20a *f,
u32 pbdma_id, u32 error_notifier);
void nvgpu_rc_runlist_update(struct gk20a *g, u32 runlist_id);
#endif /* NVGPU_RC_H */