Skip to contentSkip to conversation

omapfb: omapfb-main: Remove deprecated create_singlethread_workqueue

PATCH In review Bhaktipriya Shridhar 3 participants 3 messages Jul 2, 2016 – Aug 10, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 omapfb: omapfb-main: Remove deprecated create_singlethread_workqueue

The workqueue auto_update_work is involved in auto updating mode for manual-update displays. omapfb driver uses a delayed work item to update the display at a constant rate.

Since these long-running work items aren't involved in memory reclaim in any way, system_long_wq has been used.

Work item has been sync cancelled in omapfb_stop_auto_update() which gets called in omapfb_free_resources() to ensure that nothing is pending when the driver is disconnected.

---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 23 +----------------------
 drivers/video/fbdev/omap2/omapfb/omapfb.h      |  1 -
 2 files changed, 1 insertion(+), 23 deletions(-)
drivers/video/fbdev/omap2/omapfb/omapfb-main.c +1 -22
index d3af01c..5c6eec7 100644
@@ -1693,8 +1693,7 @@ static void omapfb_auto_update_work(struct work_struct *work)
 	freq = auto_update_freq;
 	if (freq == 0)
 		freq = 20;
-	queue_delayed_work(fbdev->auto_update_wq,
-			&d->auto_update_work, HZ / freq);
+	queue_delayed_work(system_long_wq, &d->auto_update_work, HZ / freq);
 }
 
 void omapfb_start_auto_update(struct omapfb2_device *fbdev,
@@ -1702,20 +1701,6 @@ void omapfb_start_auto_update(struct omapfb2_device *fbdev,
 {
 	struct omapfb_display_data *d;
 
-	if (fbdev->auto_update_wq == NULL) {
-		struct workqueue_struct *wq;
-
-		wq = create_singlethread_workqueue("omapfb_auto_update");
-
-		if (wq == NULL) {
-			dev_err(fbdev->dev, "Failed to create workqueue for "
-					"auto-update\n");
-			return;
-		}
-
-		fbdev->auto_update_wq = wq;
-	}
-
 	d = get_display_data(fbdev, display);
 
 	INIT_DELAYED_WORK(&d->auto_update_work, omapfb_auto_update_work);
@@ -1867,12 +1852,6 @@ static void omapfb_free_resources(struct omapfb2_device *fbdev)
 		omap_dss_put_device(dssdev);
 	}
 
-	if (fbdev->auto_update_wq != NULL) {
-		flush_workqueue(fbdev->auto_update_wq);
-		destroy_workqueue(fbdev->auto_update_wq);
-		fbdev->auto_update_wq = NULL;
-	}
-
 	dev_set_drvdata(fbdev->dev, NULL);
 }
 
drivers/video/fbdev/omap2/omapfb/omapfb.h +0 -1
index 623cd87..ff0cf79 100644
@@ -106,7 +106,6 @@ struct omapfb2_device {
 	unsigned num_managers;
 	struct omap_overlay_manager *managers[10];
 
-	struct workqueue_struct *auto_update_wq;
 };
 
 struct omapfb_colormode {

--
2.1.4

#1 lore raw
Quoted 6 lines · Bhaktipriya Shridhar

The workqueue auto_update_work is involved in auto updating mode for manual-update displays. omapfb driver uses a delayed work item to update the display at a constant rate.

Since these long-running work items aren't involved in memory reclaim in any way, system_long_wq has been used.

Can you please explain why this is long-running?

Thanks.

Signature · 1 line
tejun
#2 lore raw
Quoted 9 lines · Tejun Heo
Quoted 6 lines · Bhaktipriya Shridhar

The workqueue auto_update_work is involved in auto updating mode for manual-update displays. omapfb driver uses a delayed work item to update the display at a constant rate.

Since these long-running work items aren't involved in memory reclaim in any way, system_long_wq has been used.

Can you please explain why this is long-running?

It shouldn't be long-running. update() should only start the transfer to the display.

Although if something is not right (the user sets the auto-update frequency to too high), the work could end up waiting for the previous update to finish...

It's a debugging feature, so maybe that's not an issue.

Tomi