From patchwork Sat Jun 18 09:06:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaktipriya Shridhar X-Patchwork-Id: 637440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3rWrpR6GYnz9t0M for ; Sat, 18 Jun 2016 19:06:39 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=tt42Gl8s; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750985AbcFRJGi (ORCPT ); Sat, 18 Jun 2016 05:06:38 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:36373 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750864AbcFRJGg (ORCPT ); Sat, 18 Jun 2016 05:06:36 -0400 Received: by mail-pa0-f67.google.com with SMTP id fg1so7311502pad.3; Sat, 18 Jun 2016 02:06:36 -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=w2D19NO4DnqnbnkqEpCXvsM6BZjGGCwhz6LyxR+gyEE=; b=tt42Gl8s3HcfbtR+UWzFREjruxuxouIUKhLzjUMwAfUt4Fnw8JVstE+Yk0ogoez+gv WGYpyDw5Tw7nP9cjCOUX1hDoqhYNd6NINritAbvOTpvdfZoAcMmsphx0T2M6FH3ycoSI deWQLQ/vVmiBBaL6s6cyvhrQa6t/uQQVWIko83DHD/a9ID82py8/evnJ/kkXCYZZoXFm 1BFJvO/QNVv+krEVKWQloAVgiMUHCkihDZ2q3kdxsmfIpiGzqxRdYoXcDz2qv4msoEVC r4QfvFcX4Vxl8CExEeHtTs2GpgW3Zri6Ju98k2aQc+QZQQDGKY1WofDQEOMsXjefM7Qy qRPQ== 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=w2D19NO4DnqnbnkqEpCXvsM6BZjGGCwhz6LyxR+gyEE=; b=E3ENr+EcOqVbSHPlOf6J95khYRPLitfJB20xkQNwcH87Tz+kt5zCO00rYHqBeB7Xe9 qgaS84RFMgrZnOq2TzHxSC6F9fkGdK44jUOcBNOvo0OLJhtA/1oI+pzMotmeXvfyEhIH 47QHZkZSniH1UIzfZ20ltbiZRgJIGsCH0BNOfHRevz4Yf1lwNBonELpD+aDWlpsXh6LT 2+3dbJnrvKN3eXvOtmvPGIla7hJn006KLKQnml61iQxFqFilCbsMD3Mrip8yAz1USry5 w4Kk2sI29rJ7lCPm5FdUiCAE90KU5K0iXgqOTGwPpX+BVISpVvOPWW89neah45YjC5jN AGkQ== X-Gm-Message-State: ALyK8tIaZ0Ms0B5SopZmM6xZF5N96uW2xkO5GmQLSzsnKKUCvO4uqiw3zydyI/KzVDByeg== X-Received: by 10.66.63.35 with SMTP id d3mr7757337pas.69.1466240795720; Sat, 18 Jun 2016 02:06:35 -0700 (PDT) Received: from Karyakshetra ([2401:fa00:c:fd01:6944:e62:a30a:47c2]) by smtp.gmail.com with ESMTPSA id d8sm73885653pfg.72.2016.06.18.02.06.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Jun 2016 02:06:35 -0700 (PDT) Date: Sat, 18 Jun 2016 14:36:32 +0530 From: Bhaktipriya Shridhar To: Thierry Reding , Srinivas Kandagatla , Arnd Bergmann Cc: Tejun Heo , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] gpu: host1x: hw: intr_hw: Remove create_workqueue Message-ID: <20160618090632.GA11246@Karyakshetra> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org System workqueues have been able to handle high level of concurrency for a long time now and there's no reason to use dedicated workqueues just to gain concurrency. Since the workqueue host->intr_wq is involved in sync point interrupts, and sync point wait and is not being used on a memory reclaim path, dedicated host->intr_wq has been replaced with the use of system_wq. Unlike a dedicated per-cpu workqueue created with create_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 guarantees unless the target CPU is explicitly specified and thus the increase of local concurrency shouldn't make any difference. cancel_work_sync() has been used in _host1x_free_syncpt_irq() to ensure that no work is pending by the time exit path runs. Signed-off-by: Bhaktipriya Shridhar Acked-by: Tejun Heo --- Changes in v2: -Changed commit description drivers/gpu/host1x/dev.h | 1 - drivers/gpu/host1x/hw/intr_hw.c | 8 ++++++-- drivers/gpu/host1x/intr.c | 4 ---- 3 files changed, 6 insertions(+), 7 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" 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/gpu/host1x/dev.h b/drivers/gpu/host1x/dev.h index dace124..136c3a9 100644 --- a/drivers/gpu/host1x/dev.h +++ b/drivers/gpu/host1x/dev.h @@ -109,7 +109,6 @@ struct host1x { struct clk *clk; struct mutex intr_mutex; - struct workqueue_struct *intr_wq; int intr_syncpt_irq; const struct host1x_syncpt_ops *syncpt_op; diff --git a/drivers/gpu/host1x/hw/intr_hw.c b/drivers/gpu/host1x/hw/intr_hw.c index e1e31e9..10f8168 100644 --- a/drivers/gpu/host1x/hw/intr_hw.c +++ b/drivers/gpu/host1x/hw/intr_hw.c @@ -38,7 +38,7 @@ static void host1x_intr_syncpt_handle(struct host1x_syncpt *syncpt) host1x_sync_writel(host, BIT_MASK(id), HOST1X_SYNC_SYNCPT_THRESH_CPU0_INT_STATUS(BIT_WORD(id))); - queue_work(host->intr_wq, &syncpt->intr.work); + schedule_work(&syncpt->intr.work); } static irqreturn_t syncpt_thresh_isr(int irq, void *dev_id) @@ -127,8 +127,12 @@ static void _host1x_intr_disable_syncpt_intr(struct host1x *host, u32 id) static int _host1x_free_syncpt_irq(struct host1x *host) { + int i; + devm_free_irq(host->dev, host->intr_syncpt_irq, host); - flush_workqueue(host->intr_wq); + + for (i = 0; i < host->info->nb_pts; i++) + cancel_work_sync(&host->syncpt[i].intr.work); return 0; } diff --git a/drivers/gpu/host1x/intr.c b/drivers/gpu/host1x/intr.c index 2491bf8..81de286 100644 --- a/drivers/gpu/host1x/intr.c +++ b/drivers/gpu/host1x/intr.c @@ -277,9 +277,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync) mutex_init(&host->intr_mutex); host->intr_syncpt_irq = irq_sync; - host->intr_wq = create_workqueue("host_syncpt"); - if (!host->intr_wq) - return -ENOMEM; for (id = 0; id < nb_pts; ++id) { struct host1x_syncpt *syncpt = host->syncpt + id; @@ -299,7 +296,6 @@ int host1x_intr_init(struct host1x *host, unsigned int irq_sync) void host1x_intr_deinit(struct host1x *host) { host1x_intr_stop(host); - destroy_workqueue(host->intr_wq); } void host1x_intr_start(struct host1x *host)