From patchwork Wed Feb 6 05:46:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaik Ameer Basha X-Patchwork-Id: 2101821 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 45875DFE82 for ; Wed, 6 Feb 2013 05:44:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751584Ab3BFFol (ORCPT ); Wed, 6 Feb 2013 00:44:41 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:53366 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427Ab3BFFol (ORCPT ); Wed, 6 Feb 2013 00:44:41 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MHS005ZPALFULP0@mailout3.samsung.com> for linux-media@vger.kernel.org; Wed, 06 Feb 2013 14:44:39 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 45.D4.03880.7CDE1115; Wed, 06 Feb 2013 14:44:39 +0900 (KST) X-AuditID: cbfee61b-b7fb06d000000f28-34-5111edc74ec3 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 15.D4.03880.7CDE1115; Wed, 06 Feb 2013 14:44:39 +0900 (KST) Received: from shaik-linux.sisodomain.com ([107.108.207.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MHS00KORAM28HS0@mmp1.samsung.com> for linux-media@vger.kernel.org; Wed, 06 Feb 2013 14:44:39 +0900 (KST) From: Shaik Ameer Basha To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com Subject: [PATCH] [media] exynos-gsc: send valid m2m ctx to gsc_m2m_job_finish Date: Wed, 06 Feb 2013 11:16:18 +0530 Message-id: <1360129578-22705-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsWyRsSkWvf4W8FAg0ML1C16NmxldWD0+LxJ LoAxissmJTUnsyy1SN8ugStj0rzfLAXzeSvW3l3O2MDYxN3FyMkhIWAi8enlaRYIW0ziwr31 bCC2kMBSRokfi1VgapqvtgPFuYDiixglTtxtZYJw1jBJLDv1ggmkik3AUGL7vSusILaIgLzE k94bYJOYBaQkrm9czQ5iCwv4SrRMOcEIYrMIqEpMPDEPrJdXwF1i1d7/QPUcQNsUJOZMsgGZ LyGwhU1i47K9LBD1AhLfJh9igaiRldh0gBniOEmJgytusExgFFzAyLCKUTS1ILmgOCk910iv ODG3uDQvXS85P3cTIzCgTv97Jr2DcVWDxSFGAQ5GJR7eG3qCgUKsiWXFlbmHGCU4mJVEeBW2 AYV4UxIrq1KL8uOLSnNSiw8xJgMtn8gsJZqcDwz2vJJ4Q2MTc1NjU0sjIzNTU9KElcR5GU89 CRASSE8sSc1OTS1ILYLZwsTBKdXAOP2QWdn16xkMFTM9J+z1S7CLPh7hwtEnelrg5vL3kYpl h+c2MhpOmrjcQGh3sJjxF5WJF63ygzI2qM9KZF7+hjXSdLveibTtSTqVmvVbzO6GVr/5/2i2 zpn9flXLNCN6Pc53TVkmUf5Thacy2Teg5OWCrjLxm8IGnM80vTRW/VDxNOYyurpWiaU4I9FQ i7moOBEAtM6K6WwCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkkeLIzCtJLcpLzFFi42I5/e+xgO7xt4KBBi1zZC16NmxldWD0+LxJ LoAxqoHRJiM1MSW1SCE1Lzk/JTMv3VbJOzjeOd7UzMBQ19DSwlxJIS8xN9VWycUnQNctMwdo qpJCWWJOKVAoILG4WEnfDtOE0BA3XQuYxghd35AguB4jAzSQsIYxY9K83ywF83kr1t5dztjA 2MTdxcjJISFgItF8tZ0NwhaTuHBvPZDNxSEksIhR4sTdViYIZw2TxLJTL5hAqtgEDCW237vC CmKLCMhLPOm9AdbNLCAlcX3janYQW1jAV6JlyglGEJtFQFVi4ol5YL28Au4Sq/b+B6rnANqm IDFnks0ERu4FjAyrGEVTC5ILipPSc430ihNzi0vz0vWS83M3MYID9pn0DsZVDRaHGAU4GJV4 eG/oCQYKsSaWFVfmHmKU4GBWEuFV2AYU4k1JrKxKLcqPLyrNSS0+xJgMtHwis5Rocj4wmvJK 4g2NTcxNjU0tTSxMzCxJE1YS52U89SRASCA9sSQ1OzW1ILUIZgsTB6dUA+Nc36dGM0WFpvlL X3n13aHMKjlAbceOSYbPPsyvP7Hp1vwXFw+rL+N5sUW7VdGD576udoK+fZ5xQwC/z+zlsuef vZav39bNwdjgIWonJlieFruhI73ZZ8eiLX7yf2MStm8P+P9f0WrFh8OmddOe3n3KtL14SrOW cwuPnmR5tr6b9Z/IExYFOUosxRmJhlrMRcWJAPgjcgmcAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org gsc_m2m_job_finish() has to be called with the m2m context for the necessary cleanup while resume. But currently gsc_m2m_job_finish() always passes m2m context as NULL. This patch preserves the context before making it null, for necessary cleanup. Use gsc_m2m_opened() instead gsc_m2m_active() in gsc_resume(). Signed-off-by: Shaik Ameer Basha --- drivers/media/platform/exynos-gsc/gsc-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 99b841d..4d10845 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -1054,16 +1054,18 @@ static int gsc_m2m_suspend(struct gsc_dev *gsc) static int gsc_m2m_resume(struct gsc_dev *gsc) { + struct gsc_ctx *ctx; unsigned long flags; spin_lock_irqsave(&gsc->slock, flags); /* Clear for full H/W setup in first run after resume */ + ctx = gsc->m2m.ctx; gsc->m2m.ctx = NULL; spin_unlock_irqrestore(&gsc->slock, flags); if (test_and_clear_bit(ST_M2M_SUSPENDED, &gsc->state)) - gsc_m2m_job_finish(gsc->m2m.ctx, - VB2_BUF_STATE_ERROR); + gsc_m2m_job_finish(ctx, VB2_BUF_STATE_ERROR); + return 0; } @@ -1206,7 +1208,7 @@ static int gsc_resume(struct device *dev) /* Do not resume if the device was idle before system suspend */ spin_lock_irqsave(&gsc->slock, flags); if (!test_and_clear_bit(ST_SUSPEND, &gsc->state) || - !gsc_m2m_active(gsc)) { + !gsc_m2m_opened(gsc)) { spin_unlock_irqrestore(&gsc->slock, flags); return 0; }