From patchwork Tue Jun 28 17:18:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaktipriya Shridhar X-Patchwork-Id: 9204197 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 28BD260757 for ; Wed, 29 Jun 2016 01:09:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 19C8328339 for ; Wed, 29 Jun 2016 01:09:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B1A728630; Wed, 29 Jun 2016 01:09:14 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B669528339 for ; Wed, 29 Jun 2016 01:09:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DB736E68C; Wed, 29 Jun 2016 01:09:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id B883E6E622 for ; Tue, 28 Jun 2016 17:18:57 +0000 (UTC) Received: by mail-pf0-x244.google.com with SMTP id i123so2228178pfg.3 for ; Tue, 28 Jun 2016 10:18:57 -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=LH3iy6OiIKPL84PQhUS6OvxXVKPVKvHMCy5iMvLfmxM=; b=H+2fvMrfGG5OI8TrQpPi8h44CjzUAvOCqxy3i7ghMfpFwfyrYO1UP5EmQyYycfzYCd RWzArqXjtu9G6HdSmSTCESd5yrgG8ii7sqSCsl3XLZuHKP4+3VCq2CuNGp1QMYyQN1tb OaitJHDP6w4bZbz/q+JQYP+X1bysv026hbtGuGbDYGPOiA8170vAN+5vDSDboGmcm21U 4T0jsng1+jbcNssnMT3axMIk5sM1nMLqwtcnW3YblYd3Q+E5SoeKtn5iPp2tuWjaRkOb ui0/p2rXBxBSc4sKrJFlPnxW/cvalOs2TIcI5n4AM9tN7pt8MynliEDe0zdq76uOYK+7 T8xg== 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=LH3iy6OiIKPL84PQhUS6OvxXVKPVKvHMCy5iMvLfmxM=; b=WAZC9BD6z51vAigh3IozTEBwGComeAW3ctm4xiOROdYKcEbTYRbBqIzlK8DyA1qQ8w fg/HkAO6k0MdIwQzQsAZOnqEJ+/TlB6QT23fNXTaQqzA0+NjxGpNfgHxN+YHoJiQprb7 Bho3oCXGjHzkSUhXakgyucVhBlnZfbThsMxvrSxBpND65ivO3vCCA6+TGGZvHyPBwscf es3kivqJksUr2ofyS9idz17o3CvFyDJ/P3CL0thrLO8oYvTlT3CsVqoEY8Q4XBdbGi7c Cc17Pg8Z4GgPTRGavSMGTMa5OurxtpztE9hn66zlTcF2hXvFwIYuVkzB2nffBDucmm9q nTPw== X-Gm-Message-State: ALyK8tKkdjB24qVHQu/+yojUJGwhscY4bRlQiAqVM1m3nujhNTEte4NyPRdC97PQ0K0hHA== X-Received: by 10.98.9.68 with SMTP id e65mr3759362pfd.121.1467134336758; Tue, 28 Jun 2016 10:18:56 -0700 (PDT) Received: from Karyakshetra ([14.139.82.6]) by smtp.gmail.com with ESMTPSA id z189sm6409213pfb.34.2016.06.28.10.18.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Jun 2016 10:18:56 -0700 (PDT) Date: Tue, 28 Jun 2016 22:48:53 +0530 From: Bhaktipriya Shridhar To: David Airlie Subject: [PATCH] drm/exynos: Remove deprecated create_singlethread_workqueue Message-ID: <20160628171853.GA5788@Karyakshetra> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-Mailman-Approved-At: Wed, 29 Jun 2016 01:06:22 +0000 Cc: Tejun Heo , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The workqueue g2d_workq has only a single workitem(&g2d->runqueue_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. Occurences of the label err_destroy_workqueue have also been removed because with the usage of system_wq, calls to destroy_workqueue() have been dropped, which makes the label unnecessary. Work item has been flushed in g2d_remove() to ensure that nothing is pending when the driver disconnects. Signed-off-by: Bhaktipriya Shridhar --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) -- 2.1.4 diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 4935523..defb9d0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -224,7 +224,6 @@ struct g2d_data { struct clk *gate_clk; void __iomem *regs; int irq; - struct workqueue_struct *g2d_workq; struct work_struct runqueue_work; struct exynos_drm_subdrv subdrv; bool suspended; @@ -921,7 +920,7 @@ static irqreturn_t g2d_irq_handler(int irq, void *dev_id) } if (pending & G2D_INTP_ACMD_FIN) - queue_work(g2d->g2d_workq, &g2d->runqueue_work); + schedule_work(&g2d->runqueue_work); return IRQ_HANDLED; } @@ -1380,13 +1379,6 @@ static int g2d_probe(struct platform_device *pdev) g2d->dev = dev; - g2d->g2d_workq = create_singlethread_workqueue("g2d"); - if (!g2d->g2d_workq) { - dev_err(dev, "failed to create workqueue\n"); - ret = -EINVAL; - goto err_destroy_slab; - } - INIT_WORK(&g2d->runqueue_work, g2d_runqueue_worker); INIT_LIST_HEAD(&g2d->free_cmdlist); INIT_LIST_HEAD(&g2d->runqueue); @@ -1398,7 +1390,7 @@ static int g2d_probe(struct platform_device *pdev) if (IS_ERR(g2d->gate_clk)) { dev_err(dev, "failed to get gate clock\n"); ret = PTR_ERR(g2d->gate_clk); - goto err_destroy_workqueue; + goto err_destroy_slab; } pm_runtime_enable(dev); @@ -1449,8 +1441,6 @@ static int g2d_probe(struct platform_device *pdev) err_put_clk: pm_runtime_disable(dev); -err_destroy_workqueue: - destroy_workqueue(g2d->g2d_workq); err_destroy_slab: kmem_cache_destroy(g2d->runqueue_slab); return ret; @@ -1471,7 +1461,7 @@ static int g2d_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); g2d_fini_cmdlist(g2d); - destroy_workqueue(g2d->g2d_workq); + flush_work(&g2d->runqueue_work); kmem_cache_destroy(g2d->runqueue_slab); return 0;