gpu: nvgpu: do not suspend/resume recovered channel

Already torn down channels should not be suspended or
resumed. A channel reference could still be available
even if it is recovered but not closed. Use ch_timedout
status to check if channel is already recovered/aborted.

Bug 2404865

Change-Id: I718eab6032ee94a9322da7a239a978b388de2b01
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929338
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
(cherry picked from commit 88cff206ae
in dev-kernel)
Reviewed-on: https://git-master.nvidia.com/r/2016994
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seema Khowala
2018-10-17 14:23:38 -07:00
committed by mobile promotions
parent 220860d043
commit f78918fd6c

View File

@@ -2291,7 +2291,13 @@ int gk20a_channel_suspend(struct gk20a *g)
for (chid = 0; chid < f->num_channels; chid++) {
struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
if (ch != NULL) {
if (ch == NULL) {
continue;
}
if (gk20a_channel_check_timedout(ch)) {
nvgpu_log_info(g, "do not suspend recovered "
"channel %d", chid);
} else {
nvgpu_log_info(g, "suspend channel %d", chid);
/* disable channel */
gk20a_disable_channel_tsg(g, ch);
@@ -2304,10 +2310,9 @@ int gk20a_channel_suspend(struct gk20a *g)
channels_in_use = true;
active_runlist_ids |= BIT(ch->runlist_id);
gk20a_channel_put(ch);
active_runlist_ids |= (u32) BIT64(ch->runlist_id);
}
gk20a_channel_put(ch);
}
if (channels_in_use) {
@@ -2317,7 +2322,13 @@ int gk20a_channel_suspend(struct gk20a *g)
struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
if (ch != NULL) {
g->ops.fifo.unbind_channel(ch);
if (gk20a_channel_check_timedout(ch)) {
nvgpu_log_info(g, "do not unbind "
"recovered channel %d",
chid);
} else {
g->ops.fifo.unbind_channel(ch);
}
gk20a_channel_put(ch);
}
}
@@ -2339,13 +2350,19 @@ int gk20a_channel_resume(struct gk20a *g)
for (chid = 0; chid < f->num_channels; chid++) {
struct channel_gk20a *ch = gk20a_channel_from_id(g, chid);
if (ch != NULL) {
if (ch == NULL) {
continue;
}
if (gk20a_channel_check_timedout(ch)) {
nvgpu_log_info(g, "do not resume recovered "
"channel %d", chid);
} else {
nvgpu_log_info(g, "resume channel %d", chid);
g->ops.fifo.bind_channel(ch);
channels_in_use = true;
active_runlist_ids |= BIT(f->channel[chid].runlist_id);
gk20a_channel_put(ch);
active_runlist_ids |= (u32) BIT64(ch->runlist_id);
}
gk20a_channel_put(ch);
}
if (channels_in_use) {