diff options
author | David Nieto <dmartineznie@nvidia.com> | 2017-02-06 18:44:55 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-14 14:46:38 -0400 |
commit | 403874fa75dbb00e974a8d0f88b6e92be01ba42e (patch) | |
tree | 0492e82ded3c4ce7ee4438b29bcadc2db9472279 /drivers/gpu/nvgpu/gk20a/gk20a.c | |
parent | 4deb494ad114088f5253d02d9ec31f9aaeb2778a (diff) |
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index d07918b0..e995dcbf 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -697,12 +697,6 @@ static irqreturn_t gk20a_intr_thread_stall(int irq, void *dev_id) | |||
697 | return g->ops.mc.isr_thread_stall(g); | 697 | return g->ops.mc.isr_thread_stall(g); |
698 | } | 698 | } |
699 | 699 | ||
700 | static irqreturn_t gk20a_intr_thread_nonstall(int irq, void *dev_id) | ||
701 | { | ||
702 | struct gk20a *g = dev_id; | ||
703 | return g->ops.mc.isr_thread_nonstall(g); | ||
704 | } | ||
705 | |||
706 | void gk20a_remove_support(struct device *dev) | 700 | void gk20a_remove_support(struct device *dev) |
707 | { | 701 | { |
708 | struct gk20a *g = get_gk20a(dev); | 702 | struct gk20a *g = get_gk20a(dev); |
@@ -717,6 +711,12 @@ void gk20a_remove_support(struct device *dev) | |||
717 | 711 | ||
718 | gk20a_channel_cancel_pending_sema_waits(g); | 712 | gk20a_channel_cancel_pending_sema_waits(g); |
719 | 713 | ||
714 | if (g->nonstall_work_queue) { | ||
715 | cancel_work_sync(&g->nonstall_fn_work); | ||
716 | destroy_workqueue(g->nonstall_work_queue); | ||
717 | g->nonstall_work_queue = NULL; | ||
718 | } | ||
719 | |||
720 | if (g->pmu.remove_support) | 720 | if (g->pmu.remove_support) |
721 | g->pmu.remove_support(&g->pmu); | 721 | g->pmu.remove_support(&g->pmu); |
722 | 722 | ||
@@ -932,6 +932,13 @@ int gk20a_pm_finalize_poweron(struct device *dev) | |||
932 | if (g->ops.clk.disable_slowboot) | 932 | if (g->ops.clk.disable_slowboot) |
933 | g->ops.clk.disable_slowboot(g); | 933 | g->ops.clk.disable_slowboot(g); |
934 | 934 | ||
935 | /* Enable interrupt workqueue */ | ||
936 | if (!g->nonstall_work_queue) { | ||
937 | g->nonstall_work_queue = alloc_workqueue("%s", | ||
938 | WQ_HIGHPRI, 1, "mc_nonstall"); | ||
939 | INIT_WORK(&g->nonstall_fn_work, g->ops.mc.isr_nonstall_cb); | ||
940 | } | ||
941 | |||
935 | gk20a_enable_priv_ring(g); | 942 | gk20a_enable_priv_ring(g); |
936 | 943 | ||
937 | /* TBD: move this after graphics init in which blcg/slcg is enabled. | 944 | /* TBD: move this after graphics init in which blcg/slcg is enabled. |
@@ -1617,10 +1624,9 @@ static int gk20a_probe(struct platform_device *dev) | |||
1617 | gk20a->irq_stall); | 1624 | gk20a->irq_stall); |
1618 | return err; | 1625 | return err; |
1619 | } | 1626 | } |
1620 | err = devm_request_threaded_irq(&dev->dev, | 1627 | err = devm_request_irq(&dev->dev, |
1621 | gk20a->irq_nonstall, | 1628 | gk20a->irq_nonstall, |
1622 | gk20a_intr_isr_nonstall, | 1629 | gk20a_intr_isr_nonstall, |
1623 | gk20a_intr_thread_nonstall, | ||
1624 | 0, "gk20a_nonstall", gk20a); | 1630 | 0, "gk20a_nonstall", gk20a); |
1625 | if (err) { | 1631 | if (err) { |
1626 | dev_err(&dev->dev, | 1632 | dev_err(&dev->dev, |