All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] omapfb: omapfb-main: Remove deprecated create_singlethread_workqueue
Date: Sat, 2 Jul 2016 14:00:56 +0530	[thread overview]
Message-ID: <20160702083056.GA26936@Karyakshetra> (raw)

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.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 23 +----------------------
 drivers/video/fbdev/omap2/omapfb/omapfb.h      |  1 -
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index d3af01c..5c6eec7 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -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);
 }

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb.h b/drivers/video/fbdev/omap2/omapfb/omapfb.h
index 623cd87..ff0cf79 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb.h
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb.h
@@ -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

WARNING: multiple messages have this Message-ID (diff)
From: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Tejun Heo <tj@kernel.org>,
	linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] omapfb: omapfb-main: Remove deprecated create_singlethread_workqueue
Date: Sat, 02 Jul 2016 08:42:56 +0000	[thread overview]
Message-ID: <20160702083056.GA26936@Karyakshetra> (raw)

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.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
 drivers/video/fbdev/omap2/omapfb/omapfb-main.c | 23 +----------------------
 drivers/video/fbdev/omap2/omapfb/omapfb.h      |  1 -
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
index d3af01c..5c6eec7 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -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);
 }

diff --git a/drivers/video/fbdev/omap2/omapfb/omapfb.h b/drivers/video/fbdev/omap2/omapfb/omapfb.h
index 623cd87..ff0cf79 100644
--- a/drivers/video/fbdev/omap2/omapfb/omapfb.h
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb.h
@@ -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


             reply	other threads:[~2016-07-02  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-02  8:30 Bhaktipriya Shridhar [this message]
2016-07-02  8:42 ` [PATCH] omapfb: omapfb-main: Remove deprecated create_singlethread_workqueue Bhaktipriya Shridhar
2016-07-02 11:34 ` Tejun Heo
2016-07-02 11:34   ` Tejun Heo
2016-08-10 10:50   ` Tomi Valkeinen
2016-08-10 10:50     ` Tomi Valkeinen
2016-08-10 10:50     ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160702083056.GA26936@Karyakshetra \
    --to=bhaktipriya96@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=plagnioj@jcrosoft.com \
    --cc=tj@kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.