From patchwork Sat Jul 2 08:39:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaktipriya Shridhar X-Patchwork-Id: 9210747 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 9047360571 for ; Sat, 2 Jul 2016 08:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BD9A286D4 for ; Sat, 2 Jul 2016 08:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D5D928571; Sat, 2 Jul 2016 08:39:51 +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 DD3DC28571 for ; Sat, 2 Jul 2016 08:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750987AbcGBIja (ORCPT ); Sat, 2 Jul 2016 04:39:30 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33445 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbcGBIj1 (ORCPT ); Sat, 2 Jul 2016 04:39:27 -0400 Received: by mail-pf0-f195.google.com with SMTP id c74so11926746pfb.0; Sat, 02 Jul 2016 01:39:27 -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=0G2laga22zDiZBMRZ4CYBq47LmQerN+msgY+T9mr0sA=; b=QiIkKubnZheWfAthkge0pC7QYwXxwFLYQS+SH3JdcbeYwkBkB6H8hY6rCoKijNIor0 lnGTZkBi8TCq0RRd3wRgFDjVXrQjPmEnq6efPMv8akcmB02JbGyWqZ9PU0sw1Sk3rSp4 UxsH9DBLCAkqpOJTqBDh+IrRmzcuyxebC8qxj+WzHdx6oIlIwrVP37C4Y9WQQuezv1Jp imxUIqHuAOUCIQg7Vhbo3aD1NLf+ixbVcyIEI3SrBvRMy+TDEZ3uY8dqS4YFWPu7xqG8 8+4lhu4pTp/PnfAqoUB2o0Ev0HN1VEXLi1KrtCc6kGFeFmDy4HaYSPi2/qnjEdQwGFag ar3g== 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=0G2laga22zDiZBMRZ4CYBq47LmQerN+msgY+T9mr0sA=; b=bCBZ91uCdPrpzRPPDJcvpqkOrz9JvBY3spnqfGcLbxC//G8YcZSVLzTOIqV/rhyydw UCLGS8M8DTgSsImq/EMo7gTL9dWo5AT3+MIpGSa4EFQ2NZVp1SeWfifrtr/z/AGxUx87 x0MRfS+ceGzjdWYJJrxZas68ofa1qM4A9wJPvVbag07bhl2+hfPFOxB9UKEEtrPnWfhH olwMKbxMI8ix57Vm/eFJmEnqvIGMslR+94//83S6YPAoG/3xbk/blqozS6MN8SHHeYJG n8zY1uGyEkyYuUk+96UnsYAB84rLyj803Gr8Pj7QIuh2FfxYGGutt8b3TGHjDXaT+Vbl jqJg== X-Gm-Message-State: ALyK8tIy4BFp6FY+hjKANgISnWvPR9nXwoTOC4Blql3j0EJpwOWmBtg7LqsrMpsHlOKNvQ== X-Received: by 10.98.196.18 with SMTP id y18mr4214426pff.163.1467448766910; Sat, 02 Jul 2016 01:39:26 -0700 (PDT) Received: from Karyakshetra ([2401:fa00:c:fd01:410d:2f25:536:9c8f]) by smtp.gmail.com with ESMTPSA id bw1sm3201336pab.17.2016.07.02.01.39.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 02 Jul 2016 01:39:26 -0700 (PDT) Date: Sat, 2 Jul 2016 14:09:23 +0530 From: Bhaktipriya Shridhar To: Tomi Valkeinen , Jean-Christophe Plagniol-Villard Cc: Tejun Heo , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: Remove deprecated create_singlethread_workqueue Message-ID: <20160702083923.GA27352@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 "esd_wq" has only a single workitem(&md->esd_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. mipid_esd_stop_check () calls cancel_delayed_work() in mipid_cleanup() to ensure that there are no pending tasks while disconnecting the driver. Signed-off-by: Bhaktipriya Shridhar Acked-by: Tejun Heo --- drivers/video/fbdev/omap/lcd_mipid.c | 9 +-------- 1 file changed, 1 insertion(+), 8 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/omap/lcd_mipid.c b/drivers/video/fbdev/omap/lcd_mipid.c index 0e4cee9..c81f150 100644 --- a/drivers/video/fbdev/omap/lcd_mipid.c +++ b/drivers/video/fbdev/omap/lcd_mipid.c @@ -60,7 +60,6 @@ struct mipid_device { struct mutex mutex; struct lcd_panel panel; - struct workqueue_struct *esd_wq; struct delayed_work esd_work; void (*esd_check)(struct mipid_device *m); }; @@ -390,7 +389,7 @@ static void ls041y3_esd_check(struct mipid_device *md) static void mipid_esd_start_check(struct mipid_device *md) { if (md->esd_check != NULL) - queue_delayed_work(md->esd_wq, &md->esd_work, + schedule_delayed_work(&md->esd_work, MIPID_ESD_CHECK_PERIOD); } @@ -476,11 +475,6 @@ static int mipid_init(struct lcd_panel *panel, struct mipid_device *md = to_mipid_device(panel); md->fbdev = fbdev; - md->esd_wq = create_singlethread_workqueue("mipid_esd"); - if (md->esd_wq == NULL) { - dev_err(&md->spi->dev, "can't create ESD workqueue\n"); - return -ENOMEM; - } INIT_DELAYED_WORK(&md->esd_work, mipid_esd_work); mutex_init(&md->mutex); @@ -500,7 +494,6 @@ static void mipid_cleanup(struct lcd_panel *panel) if (md->enabled) mipid_esd_stop_check(md); - destroy_workqueue(md->esd_wq); } static struct lcd_panel mipid_panel = {