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: 6851281 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 25D299FD76 for ; Thu, 23 Jul 2015 06:15:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21C3220768 for ; Thu, 23 Jul 2015 06:15:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BCA8E20694 for ; Thu, 23 Jul 2015 06:15:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8C83826148F; Thu, 23 Jul 2015 08:15:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 877A32657BA; Thu, 23 Jul 2015 08:08:49 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 79684265450; Thu, 23 Jul 2015 00:42:58 +0200 (CEST) Received: from resqmta-po-02v.sys.comcast.net (resqmta-po-02v.sys.comcast.net [96.114.154.161]) by alsa0.perex.cz (Postfix) with ESMTP id 02F5026148F for ; Thu, 23 Jul 2015 00:42:42 +0200 (CEST) Received: from resomta-po-20v.sys.comcast.net ([96.114.154.244]) by resqmta-po-02v.sys.comcast.net with comcast id vaiR1q0035Geu2801aihPq; 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 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=ndwWxn320mHoHOxkTg809Xlbc/q+FK8/mL9tz9ZUxLwIj9B0NCqwyA99nv65BiCqg ZQGXJBcsLIMxL7U7eDOIpmKH1R/b4JCAMSnsOw+qGl21zFAJnwzDOWddi1pHfkqC/X 1wDqe0N6bLI8eCMrJZ4XLgg4k0ng0KRqi1y8XGFcGxc42QjffZxBagYgawj+VTMhhP Ncul5JkimNRJ/JJD73pBdZpisMAj1aB2dV2jcWN8LboRfQLLq6YmoVW85hiNXmRZyT HRYBsu3iBXNxSFwskT5y9/K4nY6/Z3PLSmdJoHvw7L96uhpj3PgiGWJvwlpRCuSI2h EaxkyFIkAbCDg== X-Mailman-Approved-At: Thu, 23 Jul 2015 08:08:33 +0200 Cc: devel@driverdev.osuosl.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: [alsa-devel] [PATCH v2 06/19] media: platform exynos4-is: Update graph_mutex to graph_lock spinlock X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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);