gpu: nvgpu: refactor interrupt handling

JIRA: EVLR-1004

(*) Refactor the non-stalling interrupt path to execute clear on the
top half, so on dGPU case processing of stalling interrupts does not
block non-stalling one.
(*) Use a worker thread to do semaphore wakeups and allow batching of
the non-stalling operations.
(*) Fix a bug where some gpus will not properly track the completion
of interrupts, preventing safe driver unloads

Change-Id: Icc90a3acba544c97ec6a9285ab235d337ab9eefa
Signed-off-by: David Nieto <dmartineznie@nvidia.com>
Reviewed-on: http://git-master/r/1312796
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: Navneet Kumar <navneetk@nvidia.com>
This commit is contained in:
David Nieto
2017-02-06 15:44:55 -08:00
committed by mobile promotions
parent 4deb494ad1
commit 403874fa75
13 changed files with 139 additions and 126 deletions

View File

@@ -697,12 +697,6 @@ static irqreturn_t gk20a_intr_thread_stall(int irq, void *dev_id)
return g->ops.mc.isr_thread_stall(g);
}
static irqreturn_t gk20a_intr_thread_nonstall(int irq, void *dev_id)
{
struct gk20a *g = dev_id;
return g->ops.mc.isr_thread_nonstall(g);
}
void gk20a_remove_support(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
@@ -717,6 +711,12 @@ void gk20a_remove_support(struct device *dev)
gk20a_channel_cancel_pending_sema_waits(g);
if (g->nonstall_work_queue) {
cancel_work_sync(&g->nonstall_fn_work);
destroy_workqueue(g->nonstall_work_queue);
g->nonstall_work_queue = NULL;
}
if (g->pmu.remove_support)
g->pmu.remove_support(&g->pmu);
@@ -932,6 +932,13 @@ int gk20a_pm_finalize_poweron(struct device *dev)
if (g->ops.clk.disable_slowboot)
g->ops.clk.disable_slowboot(g);
/* Enable interrupt workqueue */
if (!g->nonstall_work_queue) {
g->nonstall_work_queue = alloc_workqueue("%s",
WQ_HIGHPRI, 1, "mc_nonstall");
INIT_WORK(&g->nonstall_fn_work, g->ops.mc.isr_nonstall_cb);
}
gk20a_enable_priv_ring(g);
/* TBD: move this after graphics init in which blcg/slcg is enabled.
@@ -1617,10 +1624,9 @@ static int gk20a_probe(struct platform_device *dev)
gk20a->irq_stall);
return err;
}
err = devm_request_threaded_irq(&dev->dev,
err = devm_request_irq(&dev->dev,
gk20a->irq_nonstall,
gk20a_intr_isr_nonstall,
gk20a_intr_thread_nonstall,
0, "gk20a_nonstall", gk20a);
if (err) {
dev_err(&dev->dev,