From patchwork Wed Jul 22 22:42:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 6847611 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3B6C8C05AC for ; Wed, 22 Jul 2015 22:43:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AD7A2047D for ; Wed, 22 Jul 2015 22:43:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7BFD20465 for ; Wed, 22 Jul 2015 22:43:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752958AbbGVWm5 (ORCPT ); Wed, 22 Jul 2015 18:42:57 -0400 Received: from resqmta-po-03v.sys.comcast.net ([96.114.154.162]:47084 "EHLO resqmta-po-03v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbbGVWmm (ORCPT ); Wed, 22 Jul 2015 18:42:42 -0400 Received: from resomta-po-20v.sys.comcast.net ([96.114.154.244]) by resqmta-po-03v.sys.comcast.net with comcast id vaih1q00D5Geu2801aiiXo; Wed, 22 Jul 2015 22:42:42 +0000 Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-20v.sys.comcast.net with comcast id vaid1q00R1LXgTt01aigAY; Wed, 22 Jul 2015 22:42:41 +0000 Received: from lorien.internal (lorien-wl.internal [192.168.1.40]) by mail.gonehiking.org (Postfix) with ESMTP id C81D7120446; Wed, 22 Jul 2015 16:42:39 -0600 (MDT) From: Shuah Khan To: mchehab@osg.samsung.com, hans.verkuil@cisco.com, laurent.pinchart@ideasonboard.com, tiwai@suse.de, sakari.ailus@linux.intel.com, perex@perex.cz, crope@iki.fi, arnd@arndb.de, stefanr@s5r6.in-berlin.de, ruchandani.tina@gmail.com, chehabrafael@gmail.com, dan.carpenter@oracle.com, prabhakar.csengg@gmail.com, chris.j.arges@canonical.com, agoode@google.com, pierre-louis.bossart@linux.intel.com, gtmkramer@xs4all.nl, clemens@ladisch.de, daniel@zonque.org, vladcatoi@gmail.com, misterpib@gmail.com, damien@zamaudio.com, pmatilai@laiskiainen.org, takamichiho@gmail.com, normalperson@yhbt.net, bugzilla.frnkcg@spamgourmet.com, joe@oampo.co.uk, calcprogrammer1@gmail.com, jussi@sonarnerd.net, kyungmin.park@samsung.com, s.nawrocki@samsung.com, kgene@kernel.org, hyun.kwon@xilinx.com, michal.simek@xilinx.com, soren.brinkmann@xilinx.com, pawel@osciak.com, m.szyprowski@samsung.com, gregkh@linuxfoundation.org, skd08@gmail.com, nsekhar@ti.com, boris.brezillon@free-electrons.com, Julia.Lawall@lip6.fr, elfring@users.sourceforge.net, p.zabel@pengutronix.de, ricardo.ribalda@gmail.com Cc: Shuah Khan , linux-media@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devel@driverdev.osuosl.org Subject: [PATCH v2 06/19] media: platform exynos4-is: Update graph_mutex to graph_lock spinlock Date: Wed, 22 Jul 2015 16:42:07 -0600 Message-Id: <5a8cfe7719b00195cfca2d140ff1030eca5e9fbd.1437599281.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1437604962; bh=+MW8C0gX5+iautQEmg7IXVRAlViB/ObWil+rS10JduA=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=tViO3zvpdj6ByYEellbf80pta9JDIHBdcRA/eqAchoKJk6ATwZffg6xjOsAmZYyyh doAngviycKBSF8eV6e5QgPhiUvCzwK4H09KkMms3DceGkUha6tIb4sFAljgPU1LJJU Jqr4/n96ZHJMi+qTZQJdDQlkaXVZ9RygAZYhf//LlGbIoO2cOX3qX1Lw3/JcMkY8I5 Snb/qvuf61noljLfjhyaQK6+TZQB3E0pXsql5K++vczSihgd3I/JScWT6O5Q6k8sR6 CGRVSeOTnxWiBeuoSwjExQP4SPRZijhswI+QRj2zrnOrTbhcrxk5jWlRx3Bn124/tu R9ReJ8Pp4UHrg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update graph_mutex to graph_lock spinlock to be in sync with the Media Conttroller change for the same. Signed-off-by: Shuah Khan --- drivers/media/platform/exynos4-is/fimc-isp-video.c | 8 ++++---- drivers/media/platform/exynos4-is/fimc-lite.c | 8 ++++---- drivers/media/platform/exynos4-is/media-dev.c | 14 +++++++------- drivers/media/platform/exynos4-is/media-dev.h | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/media/platform/exynos4-is/fimc-isp-video.c b/drivers/media/platform/exynos4-is/fimc-isp-video.c index 76b6b4d..5ff0a54 100644 --- a/drivers/media/platform/exynos4-is/fimc-isp-video.c +++ b/drivers/media/platform/exynos4-is/fimc-isp-video.c @@ -288,7 +288,7 @@ static int isp_video_open(struct file *file) goto rel_fh; if (v4l2_fh_is_singular_file(file)) { - mutex_lock(&me->parent->graph_mutex); + spin_lock(&me->parent->graph_lock); ret = fimc_pipeline_call(ve, open, me, true); @@ -296,7 +296,7 @@ static int isp_video_open(struct file *file) if (ret == 0) me->use_count++; - mutex_unlock(&me->parent->graph_mutex); + spin_unlock(&me->parent->graph_lock); } if (!ret) goto unlock; @@ -326,9 +326,9 @@ static int isp_video_release(struct file *file) if (v4l2_fh_is_singular_file(file)) { fimc_pipeline_call(&ivc->ve, close); - mutex_lock(&mdev->graph_mutex); + spin_lock(&mdev->graph_lock); entity->use_count--; - mutex_unlock(&mdev->graph_mutex); + spin_unlock(&mdev->graph_lock); } pm_runtime_put(&isp->pdev->dev); diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c index ca6261a..cb1ea29 100644 --- a/drivers/media/platform/exynos4-is/fimc-lite.c +++ b/drivers/media/platform/exynos4-is/fimc-lite.c @@ -500,7 +500,7 @@ static int fimc_lite_open(struct file *file) atomic_read(&fimc->out_path) != FIMC_IO_DMA) goto unlock; - mutex_lock(&me->parent->graph_mutex); + spin_lock(&me->parent->graph_lock); ret = fimc_pipeline_call(&fimc->ve, open, me, true); @@ -508,7 +508,7 @@ static int fimc_lite_open(struct file *file) if (ret == 0) me->use_count++; - mutex_unlock(&me->parent->graph_mutex); + spin_unlock(&me->parent->graph_lock); if (!ret) { fimc_lite_clear_event_counters(fimc); @@ -541,9 +541,9 @@ static int fimc_lite_release(struct file *file) fimc_pipeline_call(&fimc->ve, close); clear_bit(ST_FLITE_IN_USE, &fimc->state); - mutex_lock(&entity->parent->graph_mutex); + spin_lock(&entity->parent->graph_lock); entity->use_count--; - mutex_unlock(&entity->parent->graph_mutex); + spin_unlock(&entity->parent->graph_lock); } _vb2_fop_release(file, NULL); diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 4f5586a..3e296e8 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -1046,7 +1046,7 @@ static int __fimc_md_modify_pipeline(struct media_entity *entity, bool enable) return ret; } -/* Locking: called with entity->parent->graph_mutex mutex held. */ +/* Locking: called with entity->parent->graph_lock lock held. */ static int __fimc_md_modify_pipelines(struct media_entity *entity, bool enable) { struct media_entity *entity_err = entity; @@ -1305,7 +1305,7 @@ static int subdev_notifier_complete(struct v4l2_async_notifier *notifier) struct fimc_md *fmd = notifier_to_fimc_md(notifier); int ret; - mutex_lock(&fmd->media_dev.graph_mutex); + spin_lock(&fmd->media_dev.graph_lock); ret = fimc_md_create_links(fmd); if (ret < 0) @@ -1313,7 +1313,7 @@ static int subdev_notifier_complete(struct v4l2_async_notifier *notifier) ret = v4l2_device_register_subdev_nodes(&fmd->v4l2_dev); unlock: - mutex_unlock(&fmd->media_dev.graph_mutex); + spin_unlock(&fmd->media_dev.graph_lock); return ret; } @@ -1371,21 +1371,21 @@ static int fimc_md_probe(struct platform_device *pdev) platform_set_drvdata(pdev, fmd); /* Protect the media graph while we're registering entities */ - mutex_lock(&fmd->media_dev.graph_mutex); + spin_lock(&fmd->media_dev.graph_lock); ret = fimc_md_register_platform_entities(fmd, dev->of_node); if (ret) { - mutex_unlock(&fmd->media_dev.graph_mutex); + spin_unlock(&fmd->media_dev.graph_lock); goto err_clk; } ret = fimc_md_register_sensor_entities(fmd); if (ret) { - mutex_unlock(&fmd->media_dev.graph_mutex); + spin_unlock(&fmd->media_dev.graph_lock); goto err_m_ent; } - mutex_unlock(&fmd->media_dev.graph_mutex); + spin_unlock(&fmd->media_dev.graph_lock); ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode); if (ret) diff --git a/drivers/media/platform/exynos4-is/media-dev.h b/drivers/media/platform/exynos4-is/media-dev.h index 0321454..91edd9b 100644 --- a/drivers/media/platform/exynos4-is/media-dev.h +++ b/drivers/media/platform/exynos4-is/media-dev.h @@ -175,12 +175,12 @@ static inline struct fimc_md *notifier_to_fimc_md(struct v4l2_async_notifier *n) static inline void fimc_md_graph_lock(struct exynos_video_entity *ve) { - mutex_lock(&ve->vdev.entity.parent->graph_mutex); + spin_lock(&ve->vdev.entity.parent->graph_lock); } static inline void fimc_md_graph_unlock(struct exynos_video_entity *ve) { - mutex_unlock(&ve->vdev.entity.parent->graph_mutex); + spin_unlock(&ve->vdev.entity.parent->graph_lock); } int fimc_md_set_camclk(struct v4l2_subdev *sd, bool on);