From patchwork Sat Jul 2 08:25:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaktipriya Shridhar X-Patchwork-Id: 9210737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8407F60890 for ; Sat, 2 Jul 2016 08:26:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75F6928688 for ; Sat, 2 Jul 2016 08:26:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 672C4286CE; Sat, 2 Jul 2016 08:26:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFF76286C0 for ; Sat, 2 Jul 2016 08:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751401AbcGBIZ7 (ORCPT ); Sat, 2 Jul 2016 04:25:59 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35329 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbcGBIZr (ORCPT ); Sat, 2 Jul 2016 04:25:47 -0400 Received: by mail-pf0-f195.google.com with SMTP id t190so11881636pfb.2; Sat, 02 Jul 2016 01:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=lvfR2EniMluMYfUS+9vODtqoc0Yth31P4lGljKtYLjc=; b=D6TCfeB591hicVznafKJ6Czi1LdWqLXt5Kg0c91iwfeDzOA7MP4oDlDPBXzo/ikLTf OsOGYz5Jn8j1qiIEXR2jXBiVXDqvn0JHoJkwk1Bz05g4dMaBqMpo0Ao24tf3Px8lTpN0 UnyFJrGTcWl3sIb/mjPCaMHMAuaOX+6b/Vb2lsxnKOwyNeSDoCNc4YpwHGpOFO2HZtrr hsYXBR7X4A2tlg9I2mKra0Xrf4ONt6oRKawpfji07vqBsy6vBD5nedRnIDLc0TVxI0j7 ah2pmcB4u7mq7An8WoBARc9YjcHJHCUH2XXXbS7hOQbL5QhuGpiZRNfWJT+wUbv9GReo qgHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=lvfR2EniMluMYfUS+9vODtqoc0Yth31P4lGljKtYLjc=; b=SUva/bQ9XP5b4oVs9wDyOiWHa/rDljnfZX+UJOZxHijmUTDKSEOhOufihtrAUE7ctf Pkz3zS2HlR+q57dgsU3St6+s8ZF4M4bugz8tMHK/xzQZkZVEPBEcGxPhYMvlLl+LL+rG w0Tk6ECnk0GGFdOZRiSaZbRuv9Yh4LtGoHw2V46/NXA3qharieuroeRZI1LAQgopa6wb gx3UUsm0o/Gvr3SvjGxQGe7rz2ETYW8uUwhTALCRlNqyF/+yUtElrvqnZ18340ucyFba Z+eh7sYCGRSnZvx47u0d+vRwA7H9ZDtNtEQGLRRxc5dBo+OaXFT0JmEzDwUX4XCznjpL hBpA== X-Gm-Message-State: ALyK8tLgBBqqxa58Y3v//t//B30jDMT4BzGCqJitNngoaKdWpBKHVBmBbKJeGTpe0VkwJQ== X-Received: by 10.98.11.4 with SMTP id t4mr4205097pfi.159.1467447946026; Sat, 02 Jul 2016 01:25:46 -0700 (PDT) Received: from Karyakshetra ([2401:fa00:c:fd01:410d:2f25:536:9c8f]) by smtp.gmail.com with ESMTPSA id w63sm3197968pfi.9.2016.07.02.01.25.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Jul 2016 01:25:45 -0700 (PDT) Date: Sat, 2 Jul 2016 13:55:40 +0530 From: Bhaktipriya Shridhar To: Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Dave Airlie , Rob Clark Cc: tj@kernel.org, linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: [PATCH] omapfb: panel-dsi-cm: Remove deprecated create_singlethread_workqueue Message-ID: <20160702082540.GA26570@Karyakshetra> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The workqueue "workqueue" has only a single workitem(&ddata->ulps_work) and hence doesn't require ordering. Also, it is not being used on a memory reclaim path. Hence, the singlethreaded workqueue has been replaced with the use of system_wq. System workqueues have been able to handle high level of concurrency for a long time now and hence it's not required to have a singlethreaded workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue created with create_singlethread_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 guarantee unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. dsicm_remove() calls dsicm_cancel_ulps_work which uses cancel_delayed_work() to ensure that there are no pending tasks while disconnecting the driver. Signed-off-by: Bhaktipriya Shridhar --- drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c index 3414c26..281ac7e 100644 --- a/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c +++ b/drivers/video/fbdev/omap2/omapfb/displays/panel-dsi-cm.c @@ -76,8 +76,6 @@ struct panel_drv_data { bool intro_printed; - struct workqueue_struct *workqueue; - bool ulps_enabled; unsigned ulps_timeout; struct delayed_work ulps_work; @@ -233,7 +231,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, static void dsicm_queue_ulps_work(struct panel_drv_data *ddata) { if (ddata->ulps_timeout > 0) - queue_delayed_work(ddata->workqueue, &ddata->ulps_work, + schedule_delayed_work(&ddata->ulps_work, msecs_to_jiffies(ddata->ulps_timeout)); } @@ -1284,11 +1282,6 @@ static int dsicm_probe(struct platform_device *pdev) dev_dbg(dev, "Using GPIO TE\n"); } - ddata->workqueue = create_singlethread_workqueue("dsicm_wq"); - if (ddata->workqueue == NULL) { - dev_err(dev, "can't create workqueue\n"); - return -ENOMEM; - } INIT_DELAYED_WORK(&ddata->ulps_work, dsicm_ulps_work); dsicm_hw_reset(ddata); @@ -1302,7 +1295,7 @@ static int dsicm_probe(struct platform_device *pdev) dev, ddata, &dsicm_bl_ops, &props); if (IS_ERR(bldev)) { r = PTR_ERR(bldev); - goto err_bl; + goto err_reg; } ddata->bldev = bldev; @@ -1325,8 +1318,6 @@ static int dsicm_probe(struct platform_device *pdev) err_sysfs_create: if (bldev != NULL) backlight_device_unregister(bldev); -err_bl: - destroy_workqueue(ddata->workqueue); err_reg: return r; } @@ -1356,7 +1347,6 @@ static int __exit dsicm_remove(struct platform_device *pdev) omap_dss_put_device(ddata->in); dsicm_cancel_ulps_work(ddata); - destroy_workqueue(ddata->workqueue); /* reset, to be sure that the panel is in a valid state */ dsicm_hw_reset(ddata);