Commit 49dbf589 authored by Archit Taneja's avatar Archit Taneja Committed by Tomi Valkeinen

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 : 0f16aa0a
. 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: default avatarArchit Taneja <archit@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent b6cbb02e
...@@ -294,8 +294,6 @@ struct dsi_data { ...@@ -294,8 +294,6 @@ struct dsi_data {
bool te_enabled; bool te_enabled;
bool ulps_enabled; bool ulps_enabled;
struct workqueue_struct *workqueue;
void (*framedone_callback)(int, void *); void (*framedone_callback)(int, void *);
void *framedone_data; void *framedone_data;
...@@ -3753,8 +3751,8 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev, ...@@ -3753,8 +3751,8 @@ static void dsi_update_screen_dispc(struct omap_dss_device *dssdev,
dsi_perf_mark_start(dsidev); dsi_perf_mark_start(dsidev);
r = queue_delayed_work(dsi->workqueue, &dsi->framedone_timeout_work, r = schedule_delayed_work(&dsi->framedone_timeout_work,
msecs_to_jiffies(250)); msecs_to_jiffies(250));
BUG_ON(r == 0); BUG_ON(r == 0);
dss_start_update(dssdev); dss_start_update(dssdev);
...@@ -4369,12 +4367,6 @@ static int dsi_init(struct platform_device *dsidev) ...@@ -4369,12 +4367,6 @@ static int dsi_init(struct platform_device *dsidev)
mutex_init(&dsi->lock); mutex_init(&dsi->lock);
sema_init(&dsi->bus_lock, 1); sema_init(&dsi->bus_lock, 1);
dsi->workqueue = create_singlethread_workqueue(dev_name(&dsidev->dev));
if (dsi->workqueue == NULL) {
r = -ENOMEM;
goto err1;
}
INIT_DELAYED_WORK_DEFERRABLE(&dsi->framedone_timeout_work, INIT_DELAYED_WORK_DEFERRABLE(&dsi->framedone_timeout_work,
dsi_framedone_timeout_work_callback); dsi_framedone_timeout_work_callback);
...@@ -4387,26 +4379,26 @@ static int dsi_init(struct platform_device *dsidev) ...@@ -4387,26 +4379,26 @@ static int dsi_init(struct platform_device *dsidev)
if (!dsi_mem) { if (!dsi_mem) {
DSSERR("can't get IORESOURCE_MEM DSI\n"); DSSERR("can't get IORESOURCE_MEM DSI\n");
r = -EINVAL; r = -EINVAL;
goto err2; goto err1;
} }
dsi->base = ioremap(dsi_mem->start, resource_size(dsi_mem)); dsi->base = ioremap(dsi_mem->start, resource_size(dsi_mem));
if (!dsi->base) { if (!dsi->base) {
DSSERR("can't ioremap DSI\n"); DSSERR("can't ioremap DSI\n");
r = -ENOMEM; r = -ENOMEM;
goto err2; goto err1;
} }
dsi->irq = platform_get_irq(dsi->pdev, 0); dsi->irq = platform_get_irq(dsi->pdev, 0);
if (dsi->irq < 0) { if (dsi->irq < 0) {
DSSERR("platform_get_irq failed\n"); DSSERR("platform_get_irq failed\n");
r = -ENODEV; r = -ENODEV;
goto err3; goto err2;
} }
r = request_irq(dsi->irq, omap_dsi_irq_handler, IRQF_SHARED, r = request_irq(dsi->irq, omap_dsi_irq_handler, IRQF_SHARED,
dev_name(&dsidev->dev), dsi->pdev); dev_name(&dsidev->dev), dsi->pdev);
if (r < 0) { if (r < 0) {
DSSERR("request_irq failed\n"); DSSERR("request_irq failed\n");
goto err3; goto err2;
} }
/* DSI VCs initialization */ /* DSI VCs initialization */
...@@ -4427,10 +4419,8 @@ static int dsi_init(struct platform_device *dsidev) ...@@ -4427,10 +4419,8 @@ static int dsi_init(struct platform_device *dsidev)
enable_clocks(0); enable_clocks(0);
return 0; return 0;
err3:
iounmap(dsi->base);
err2: err2:
destroy_workqueue(dsi->workqueue); iounmap(dsi->base);
err1: err1:
kfree(dsi); kfree(dsi);
err0: err0:
...@@ -4454,7 +4444,6 @@ static void dsi_exit(struct platform_device *dsidev) ...@@ -4454,7 +4444,6 @@ static void dsi_exit(struct platform_device *dsidev)
free_irq(dsi->irq, dsi->pdev); free_irq(dsi->irq, dsi->pdev);
iounmap(dsi->base); iounmap(dsi->base);
destroy_workqueue(dsi->workqueue);
kfree(dsi); kfree(dsi);
DSSDBG("omap_dsi_exit\n"); DSSDBG("omap_dsi_exit\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment