From patchwork Thu Apr 25 18:35:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 10917621 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A64A41390 for ; Thu, 25 Apr 2019 18:37:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9993C28CF5 for ; Thu, 25 Apr 2019 18:37:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D69328CC4; Thu, 25 Apr 2019 18:37:05 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY 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 2010428CF5 for ; Thu, 25 Apr 2019 18:37:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730673AbfDYShD (ORCPT ); Thu, 25 Apr 2019 14:37:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35420 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729070AbfDYShD (ORCPT ); Thu, 25 Apr 2019 14:37:03 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id C66FF282BC9 From: Ezequiel Garcia To: Philipp Zabel , linux-media@vger.kernel.org, Hans Verkuil Cc: kernel@collabora.com, Ezequiel Garcia Subject: [PATCH 4/5] media: coda: Remove pic_run_work worker Date: Thu, 25 Apr 2019 15:35:45 -0300 Message-Id: <20190425183546.16244-5-ezequiel@collabora.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190425183546.16244-1-ezequiel@collabora.com> References: <20190425183546.16244-1-ezequiel@collabora.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There isn't any reason to run the mem2mem job on a separate worker, because the mem2mem framework guarantees that device_run will never run in interrupt context. Therefore, get rid of the extra pic_run_work worker, and instead run the job in the context of .device_run itself. Signed-off-by: Ezequiel Garcia --- drivers/media/platform/coda/coda-common.c | 9 --------- drivers/media/platform/coda/coda.h | 1 - 2 files changed, 10 deletions(-) diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c index 617d4547ec82..e0227593a649 100644 --- a/drivers/media/platform/coda/coda-common.c +++ b/drivers/media/platform/coda/coda-common.c @@ -1306,14 +1306,6 @@ static void coda_device_run(void *m2m_priv) { struct coda_ctx *ctx = m2m_priv; struct coda_dev *dev = ctx->dev; - - queue_work(dev->workqueue, &ctx->pic_run_work); -} - -static void coda_pic_run_work(struct work_struct *work) -{ - struct coda_ctx *ctx = container_of(work, struct coda_ctx, pic_run_work); - struct coda_dev *dev = ctx->dev; int ret; mutex_lock(&ctx->buffer_mutex); @@ -2233,7 +2225,6 @@ static int coda_open(struct file *file) ctx->ops = ctx->cvd->ops; ctx->use_bit = !ctx->cvd->direct; init_completion(&ctx->completion); - INIT_WORK(&ctx->pic_run_work, coda_pic_run_work); if (ctx->ops->seq_end_work) INIT_WORK(&ctx->seq_end_work, ctx->ops->seq_end_work); v4l2_fh_init(&ctx->fh, video_devdata(file)); diff --git a/drivers/media/platform/coda/coda.h b/drivers/media/platform/coda/coda.h index 31c80bda2c0b..6870edeb6324 100644 --- a/drivers/media/platform/coda/coda.h +++ b/drivers/media/platform/coda/coda.h @@ -194,7 +194,6 @@ struct coda_context_ops { struct coda_ctx { struct coda_dev *dev; struct mutex buffer_mutex; - struct work_struct pic_run_work; struct work_struct seq_end_work; struct completion completion; const struct coda_video_device *cvd;