gpu: nvgpu: cde: cancel delayed_work during suspend

During gpu suspend, cancel all pending delayed cde work
to avoid issues of scheduling this delayed work
during suspend/resume when gpu is not ready.

Bug 1574000

Change-Id: I2b6bfa489435a781dc576a077f9af01b1e1628ce
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: http://git-master/r/593557
Reviewed-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Tested-by: Prashant Gaikwad <pgaikwad@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2014-11-04 18:47:12 -08:00
committed by Dan Willemsen
parent c3661adef8
commit 797e4dd319
3 changed files with 24 additions and 0 deletions

View File

@@ -144,6 +144,26 @@ void gk20a_cde_destroy(struct gk20a *g)
mutex_unlock(&cde_app->mutex);
}
void gk20a_cde_suspend(struct gk20a *g)
{
struct gk20a_cde_app *cde_app = &g->cde_app;
struct gk20a_cde_ctx *cde_ctx, *cde_ctx_save;
if (!cde_app->initialised)
return;
list_for_each_entry_safe(cde_ctx, cde_ctx_save,
&cde_app->cde_ctx_lru, list) {
if (cde_ctx->is_temporary) {
mutex_lock(&cde_app->mutex);
cancel_delayed_work(&cde_ctx->ctx_deleter_work);
mutex_unlock(&cde_app->mutex);
}
}
}
static int gk20a_cde_allocate_contexts(struct gk20a *g)
{
struct gk20a_cde_app *cde_app = &g->cde_app;

View File

@@ -262,6 +262,7 @@ struct gk20a_cde_app {
};
void gk20a_cde_destroy(struct gk20a *g);
void gk20a_cde_suspend(struct gk20a *g);
int gk20a_init_cde_support(struct gk20a *g);
int gk20a_cde_reload(struct gk20a *g);
int gk20a_cde_convert(struct gk20a *g, struct dma_buf *dst,

View File

@@ -679,6 +679,9 @@ static int gk20a_pm_prepare_poweroff(struct device *dev)
if (ret)
return ret;
/* cancel any pending cde work */
gk20a_cde_suspend(g);
/*
* After this point, gk20a interrupts should not get
* serviced.