aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2011-05-16 05:47:07 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-16 06:31:09 -0400
commit49dbf5892fc67466ac2780c1d42d8a02726f5538 (patch)
tree2ba86202292057550cd8b3e12a1b9de5149b8ddb /drivers/video/omap2
parentb6cbb02ed0b834c6e1f876e9223736965795fd3d (diff)
OMAP: DSS2: DSI: Use system workqueue for delayed work instead of a private workqueue
In the previous DSI driver design, a private workqueue was needed to prevent a deadlock as explained in the commit : 0f16aa0ae6b84d7ae72fbe8999e6a94cb78edd4e . In the current design, the workqueue is only used for queueing delayed work in the case where we don't get a FRAMEDONE interrupt for 250 milliseconds. It is safe to remove the private workqueue amd use the system workqueue instead to schedule the delayed work with the new design where the deadlock can't occur. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dsi.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 091b3184948e..f04244bba76e 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -294,8 +294,6 @@ struct dsi_data {
294 bool te_enabled; 294 bool te_enabled;
295 bool ulps_enabled; 295 bool ulps_enabled;
296 296
297 struct workqueue_struct *workqueue;
298
299 void (*framedone_callback)(int, void *); 297 void (*framedone_callback)(int, void *);
300 void *framedone_data; 298 void *framedone_data;
301 299
@@ -3753,8 +3751,8 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
3753 3751
3754 dsi_perf_mark_start(dsidev); 3752 dsi_perf_mark_start(dsidev);
3755 3753
3756 r = queue_delayed_work(dsi->workqueue, &dsi->framedone_timeout_work, 3754 r = schedule_delayed_work(&dsi->framedone_timeout_work,
3757 msecs_to_jiffies(250)); 3755 msecs_to_jiffies(250));
3758 BUG_ON(r == 0); 3756 BUG_ON(r == 0);
3759 3757
3760 dss_start_update(dssdev); 3758 dss_start_update(dssdev);
@@ -4369,12 +4367,6 @@ static int dsi_init(struct platform_device *dsidev)
4369 mutex_init(&dsi->lock); 4367 mutex_init(&dsi->lock);
4370 sema_init(&dsi->bus_lock, 1); 4368 sema_init(&dsi->bus_lock, 1);
4371 4369
4372 dsi->workqueue = create_singlethread_workqueue(dev_name(&dsidev->dev));
4373 if (dsi->workqueue == NULL) {
4374 r = -ENOMEM;
4375 goto err1;
4376 }
4377
4378 INIT_DELAYED_WORK_DEFERRABLE(&dsi->framedone_timeout_work, 4370 INIT_DELAYED_WORK_DEFERRABLE(&dsi->framedone_timeout_work,
4379 dsi_framedone_timeout_work_callback); 4371 dsi_framedone_timeout_work_callback);
4380 4372
@@ -4387,26 +4379,26 @@ static int dsi_init(struct platform_device *dsidev)
4387 if (!dsi_mem) { 4379 if (!dsi_mem) {
4388 DSSERR("can't get IORESOURCE_MEM DSI\n"); 4380 DSSERR("can't get IORESOURCE_MEM DSI\n");
4389 r = -EINVAL; 4381 r = -EINVAL;
4390 goto err2; 4382 goto err1;
4391 } 4383 }
4392 dsi->base = ioremap(dsi_mem->start, resource_size(dsi_mem)); 4384 dsi->base = ioremap(dsi_mem->start, resource_size(dsi_mem));
4393 if (!dsi->base) { 4385 if (!dsi->base) {
4394 DSSERR("can't ioremap DSI\n"); 4386 DSSERR("can't ioremap DSI\n");
4395 r = -ENOMEM; 4387 r = -ENOMEM;
4396 goto err2; 4388 goto err1;
4397 } 4389 }
4398 dsi->irq = platform_get_irq(dsi->pdev, 0); 4390 dsi->irq = platform_get_irq(dsi->pdev, 0);
4399 if (dsi->irq < 0) { 4391 if (dsi->irq < 0) {
4400 DSSERR("platform_get_irq failed\n"); 4392 DSSERR("platform_get_irq failed\n");
4401 r = -ENODEV; 4393 r = -ENODEV;
4402 goto err3; 4394 goto err2;
4403 } 4395 }
4404 4396
4405 r = request_irq(dsi->irq, omap_dsi_irq_handler, IRQF_SHARED, 4397 r = request_irq(dsi->irq, omap_dsi_irq_handler, IRQF_SHARED,
4406 dev_name(&dsidev->dev), dsi->pdev); 4398 dev_name(&dsidev->dev), dsi->pdev);
4407 if (r < 0) { 4399 if (r < 0) {
4408 DSSERR("request_irq failed\n"); 4400 DSSERR("request_irq failed\n");
4409 goto err3; 4401 goto err2;
4410 } 4402 }
4411 4403
4412 /* DSI VCs initialization */ 4404 /* DSI VCs initialization */
@@ -4427,10 +4419,8 @@ static int dsi_init(struct platform_device *dsidev)
4427 enable_clocks(0); 4419 enable_clocks(0);
4428 4420
4429 return 0; 4421 return 0;
4430err3:
4431 iounmap(dsi->base);
4432err2: 4422err2:
4433 destroy_workqueue(dsi->workqueue); 4423 iounmap(dsi->base);
4434err1: 4424err1:
4435 kfree(dsi); 4425 kfree(dsi);
4436err0: 4426err0:
@@ -4454,7 +4444,6 @@ static void dsi_exit(struct platform_device *dsidev)
4454 free_irq(dsi->irq, dsi->pdev); 4444 free_irq(dsi->irq, dsi->pdev);
4455 iounmap(dsi->base); 4445 iounmap(dsi->base);
4456 4446
4457 destroy_workqueue(dsi->workqueue);
4458 kfree(dsi); 4447 kfree(dsi);
4459 4448
4460 DSSDBG("omap_dsi_exit\n"); 4449 DSSDBG("omap_dsi_exit\n");