mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: replace tsgid input variable with pointer to a struct tsg_gk20a
replace tsgid with a pointer to a struct tsg_gk20a in the function gk20a_fifo_tsg_abort(). gk20a_fifo_tsg_abort needs to enumerate through all the channels within the tsg as well as pass the tsg pointer to other functions, qualifying the need to use a pointer instead as an input parameter. Jira NVGPU-1461 Change-Id: I59cec05d5d778f733d0c3e9ffadf46e74e249080 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1956567 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ede1d184cf
commit
e5bebd880f
@@ -232,10 +232,12 @@ bool gk20a_channel_check_timedout(struct channel_gk20a *ch)
|
||||
|
||||
void gk20a_channel_abort(struct channel_gk20a *ch, bool channel_preempt)
|
||||
{
|
||||
struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch);
|
||||
|
||||
nvgpu_log_fn(ch->g, " ");
|
||||
|
||||
if (gk20a_is_channel_marked_as_tsg(ch)) {
|
||||
return gk20a_fifo_abort_tsg(ch->g, ch->tsgid, channel_preempt);
|
||||
if (tsg != NULL) {
|
||||
return gk20a_fifo_abort_tsg(ch->g, tsg, channel_preempt);
|
||||
}
|
||||
|
||||
/* make sure new kickoffs are prevented */
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <nvgpu/bug.h>
|
||||
#include <nvgpu/kmem.h>
|
||||
#include <nvgpu/log.h>
|
||||
#include <nvgpu/os_sched.h>
|
||||
@@ -149,18 +150,21 @@ int gk20a_tsg_bind_channel(struct tsg_gk20a *tsg,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The caller must ensure that channel belongs to a tsg */
|
||||
int gk20a_tsg_unbind_channel(struct channel_gk20a *ch)
|
||||
{
|
||||
struct gk20a *g = ch->g;
|
||||
struct tsg_gk20a *tsg = &g->fifo.tsg[ch->tsgid];
|
||||
struct tsg_gk20a *tsg = tsg_gk20a_from_ch(ch);
|
||||
int err;
|
||||
|
||||
nvgpu_assert(tsg != NULL);
|
||||
|
||||
err = g->ops.fifo.tsg_unbind_channel(ch);
|
||||
if (err != 0) {
|
||||
nvgpu_err(g, "Channel %d unbind failed, tearing down TSG %d",
|
||||
ch->chid, tsg->tsgid);
|
||||
|
||||
gk20a_fifo_abort_tsg(ch->g, ch->tsgid, true);
|
||||
gk20a_fifo_abort_tsg(ch->g, tsg, true);
|
||||
/* If channel unbind fails, channel is still part of runlist */
|
||||
channel_gk20a_update_runlist(ch, false);
|
||||
|
||||
|
||||
@@ -1453,17 +1453,16 @@ void gk20a_fifo_set_ctx_mmu_error_tsg(struct gk20a *g,
|
||||
|
||||
}
|
||||
|
||||
void gk20a_fifo_abort_tsg(struct gk20a *g, u32 tsgid, bool preempt)
|
||||
void gk20a_fifo_abort_tsg(struct gk20a *g, struct tsg_gk20a *tsg, bool preempt)
|
||||
{
|
||||
struct tsg_gk20a *tsg = &g->fifo.tsg[tsgid];
|
||||
struct channel_gk20a *ch;
|
||||
struct channel_gk20a *ch = NULL;
|
||||
|
||||
nvgpu_log_fn(g, " ");
|
||||
|
||||
g->ops.fifo.disable_tsg(tsg);
|
||||
|
||||
if (preempt) {
|
||||
g->ops.fifo.preempt_tsg(g, tsgid);
|
||||
g->ops.fifo.preempt_tsg(g, tsg->tsgid);
|
||||
}
|
||||
|
||||
nvgpu_rwsem_down_read(&tsg->ch_list_lock);
|
||||
@@ -1710,7 +1709,7 @@ static bool gk20a_fifo_handle_mmu_fault_locked(
|
||||
tsg);
|
||||
}
|
||||
verbose = gk20a_fifo_error_tsg(g, tsg);
|
||||
gk20a_fifo_abort_tsg(g, tsg->tsgid, false);
|
||||
gk20a_fifo_abort_tsg(g, tsg, false);
|
||||
}
|
||||
|
||||
/* put back the ref taken early above */
|
||||
@@ -1902,7 +1901,7 @@ void gk20a_fifo_recover_tsg(struct gk20a *g, u32 tsgid, bool verbose,
|
||||
gk20a_debug_dump(g);
|
||||
}
|
||||
|
||||
gk20a_fifo_abort_tsg(g, tsgid, false);
|
||||
gk20a_fifo_abort_tsg(g, tsg, false);
|
||||
}
|
||||
|
||||
gr_gk20a_enable_ctxsw(g);
|
||||
|
||||
@@ -310,7 +310,7 @@ u32 gk20a_fifo_get_failing_engine_data(struct gk20a *g,
|
||||
u32 *__id, bool *__is_tsg);
|
||||
void gk20a_fifo_set_ctx_mmu_error_tsg(struct gk20a *g,
|
||||
struct tsg_gk20a *tsg);
|
||||
void gk20a_fifo_abort_tsg(struct gk20a *g, u32 tsgid, bool preempt);
|
||||
void gk20a_fifo_abort_tsg(struct gk20a *g, struct tsg_gk20a *tsg, bool preempt);
|
||||
void gk20a_fifo_set_ctx_mmu_error_ch(struct gk20a *g,
|
||||
struct channel_gk20a *refch);
|
||||
bool gk20a_fifo_error_tsg(struct gk20a *g, struct tsg_gk20a *tsg);
|
||||
|
||||
@@ -1013,7 +1013,7 @@ static void gv11b_fifo_locked_abort_runlist_active_tsgs(struct gk20a *g,
|
||||
rlid);
|
||||
}
|
||||
|
||||
gk20a_fifo_abort_tsg(g, tsg->tsgid, false);
|
||||
gk20a_fifo_abort_tsg(g, tsg, false);
|
||||
|
||||
nvgpu_log(g, gpu_dbg_info, "aborted tsg id %lu", tsgid);
|
||||
}
|
||||
@@ -1224,7 +1224,7 @@ void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask,
|
||||
gk20a_fifo_set_ctx_mmu_error_tsg(g, tsg);
|
||||
}
|
||||
|
||||
gk20a_fifo_abort_tsg(g, tsg->tsgid, false);
|
||||
gk20a_fifo_abort_tsg(g, tsg, false);
|
||||
}
|
||||
} else {
|
||||
gv11b_fifo_locked_abort_runlist_active_tsgs(g, rc_type,
|
||||
|
||||
Reference in New Issue
Block a user