aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>2016-06-18 05:06:32 -0400
committerThierry Reding <treding@nvidia.com>2016-06-23 05:59:22 -0400
commit57574bd779852bb7328ade70c951b681b54a7ece (patch)
treefc14d862a4c6197548664b50ee31ae6bd095a2eb
parentdfa7573e84b53081e9d16083123475fe3312fbcb (diff)
gpu: host1x: hw: intr_hw: Remove create_workqueue
System workqueues have been able to handle high level of concurrency for a long time now and there's no reason to use dedicated workqueues just to gain concurrency. Since the workqueue host->intr_wq is involved in sync point interrupts, and sync point wait and is not being used on a memory reclaim path, dedicated host->intr_wq has been replaced with the use of system_wq. Unlike a dedicated per-cpu workqueue created with create_workqueue(), system_wq allows multiple work items to overlap executions even on the same CPU; however, a per-cpu workqueue doesn't have any CPU locality or global ordering guarantees unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. cancel_work_sync() has been used in _host1x_free_syncpt_irq() to ensure that no work is pending by the time exit path runs. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/host1x/dev.h1
-rw-r--r--drivers/gpu/host1x/hw/intr_hw.c8
-rw-r--r--drivers/gpu/host1x/intr.c4
3 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h
index dace124994bb..136c3a9d4997 100644
--- a/drivers/gpu/host1x/dev.h
+++ b/drivers/gpu/host1x/dev.h
@@ -109,7 +109,6 @@ struct host1x {
109 struct clk *clk; 109 struct clk *clk;
110 110
111 struct mutex intr_mutex; 111 struct mutex intr_mutex;
112 struct workqueue_struct *intr_wq;
113 int intr_syncpt_irq; 112 int intr_syncpt_irq;
114 113
115 const struct host1x_syncpt_ops *syncpt_op; 114 const struct host1x_syncpt_ops *syncpt_op;
diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c
index e1e31e9e67cd..10f81687b566 100644
--- a/drivers/gpu/host1x/hw/intr_hw.c
+++ b/drivers/gpu/host1x/hw/intr_hw.c
@@ -38,7 +38,7 @@ static void host1x_intr_syncpt_handle(struct host1x_syncpt *syncpt)
38 host1x_sync_writel(host, BIT_MASK(id), 38 host1x_sync_writel(host, BIT_MASK(id),
39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id))); 39 HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id)));
40 40
41 queue_work(host->intr_wq, &syncpt->intr.work); 41 schedule_work(&syncpt->intr.work);
42} 42}
43 43
44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id) 44static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id)
@@ -127,8 +127,12 @@ static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id)
127 127
128static int _host1x_free_syncpt_irq(struct host1x *host) 128static int _host1x_free_syncpt_irq(struct host1x *host)
129{ 129{
130 int i;
131
130 devm_free_irq(host->dev, host->intr_syncpt_irq, host); 132 devm_free_irq(host->dev, host->intr_syncpt_irq, host);
131 flush_workqueue(host->intr_wq); 133
134 for (i = 0; i < host->info->nb_pts; i++)
135 cancel_work_sync(&host->syncpt[i].intr.work);
132 return 0; 136 return 0;
133} 137}
134 138
diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c
index 2491bf82e30c..81de286a2f60 100644
--- a/drivers/gpu/host1x/intr.c
+++ b/drivers/gpu/host1x/intr.c
@@ -277,9 +277,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
277 277
278 mutex_init(&host->intr_mutex); 278 mutex_init(&host->intr_mutex);
279 host->intr_syncpt_irq = irq_sync; 279 host->intr_syncpt_irq = irq_sync;
280 host->intr_wq = create_workqueue("host_syncpt");
281 if (!host->intr_wq)
282 return -ENOMEM;
283 280
284 for (id = 0; id < nb_pts; ++id) { 281 for (id = 0; id < nb_pts; ++id) {
285 struct host1x_syncpt *syncpt = host->syncpt + id; 282 struct host1x_syncpt *syncpt = host->syncpt + id;
@@ -299,7 +296,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync)
299void host1x_intr_deinit(struct host1x *host) 296void host1x_intr_deinit(struct host1x *host)
300{ 297{
301 host1x_intr_stop(host); 298 host1x_intr_stop(host);
302 destroy_workqueue(host->intr_wq);
303} 299}
304 300
305void host1x_intr_start(struct host1x *host) 301void host1x_intr_start(struct host1x *host)