From patchwork Fri Jan 18 10:01: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: 2000371 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 9E388DF280 for ; Fri, 18 Jan 2013 09:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075Ab3ARJjy (ORCPT ); Fri, 18 Jan 2013 04:39:54 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:33585 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032Ab3ARJjw (ORCPT ); Fri, 18 Jan 2013 04:39:52 -0500 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MGT00C77EUE9DW0@mailout1.samsung.com> for linux-media@vger.kernel.org; Fri, 18 Jan 2013 18:39:50 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.126]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 51.D3.12699.66819F05; Fri, 18 Jan 2013 18:39:50 +0900 (KST) X-AuditID: cbfee61b-b7f616d00000319b-1e-50f91866fc3a Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 21.D3.12699.66819F05; Fri, 18 Jan 2013 18:39:50 +0900 (KST) Received: from chrome-ubuntu.sisodomain.com ([107.108.73.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 <0MGT00HHDETSPZ00@mmp1.samsung.com> for linux-media@vger.kernel.org; Fri, 18 Jan 2013 18:39:50 +0900 (KST) From: Shaik Ameer Basha To: linux-media@vger.kernel.org Cc: s.nawrocki@samsung.com Subject: [PATCH] s5p-fimc: set m2m context to null at the end of fimc_m2m_resume Date: Fri, 18 Jan 2013 05:01:18 -0500 Message-id: <1358503278-13414-1-git-send-email-shaik.ameer@samsung.com> X-Mailer: git-send-email 1.8.0 DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrELMWRmVeSWpSXmKPExsWyRsSkTjdN4meAwYFfhhY9G7ayOjB6fN4k F8AYxWWTkpqTWZZapG+XwJXRM6+LreABZ8XSpRwNjLM4uhg5OSQETCTOvZzGCGGLSVy4t56t i5GLQ0hgKaPEi4ufWGGKGj5/BLOFBBYxSryakgJRtJZJoun8PBaQBJuAocT2e1fAikQE5CWe 9N5gA7GZBaQkrm9czQ5iCwsESKxa3wFmswioSsx6vQSsl1fAXWJCVzfUFXISH/Y8gqoRkPg2 +RBQDQdQXFZi0wFmkL0SAlvYJHofdjBB1EtKHFxxg2UCo+ACRoZVjKKpBckFxUnpuUZ6xYm5 xaV56XrJ+bmbGIEBdfrfM+kdjKsaLA4xCnAwKvHwblT5ESDEmlhWXJl7iFGCg1lJhLf1IFCI NyWxsiq1KD++qDQntfgQow/QJROZpUST84HBnlcSb2hsYm5qbGppZGRmaopDWEmcl/HUkwAh gfTEktTs1NSC1CKYcUwcnFINjDNvucQcu6Mqtk1qVYGE97Rbsa8FnM5+naTvGdl78Xlyvn3o scNH22KXr7VUlv0itX4RZ9HT9y8Yurz1L79mXighzNHc+FhnW9en9uWMV1y81jF+WdvxQ0Nf oLd/d+GNiQ71NxzuvFt2uCX+bnHQLH32wx71BluTH9d/dAo4s75hg2RWs3LDLyWW4oxEQy3m ouJEAPggb3JVAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrILMWRmVeSWpSXmKPExsVy+t9jAd00iZ8BBme/a1r0bNjK6sDo8XmT XABjVAOjTUZqYkpqkUJqXnJ+SmZeuq2Sd3C8c7ypmYGhrqGlhbmSQl5ibqqtkotPgK5bZg7Q VCWFssScUqBQQGJxsZK+HaYJoSFuuhYwjRG6viFBcD1GBmggYQ1jRs+8LraCB5wVS5dyNDDO 4uhi5OSQEDCRaPj8kRXCFpO4cG89G4gtJLCIUeLVlJQuRi4gey2TRNP5eSwgCTYBQ4nt966A NYgIyEs86b0B1sAsICVxfeNqdhBbWCBAYtX6DjCbRUBVYtbrJWC9vALuEhO6uhkhlslJfNjz iH0CI/cCRoZVjKKpBckFxUnpuUZ6xYm5xaV56XrJ+bmbGMHh+kx6B+OqBotDjAIcjEo8vBtV fgQIsSaWFVfmHmKU4GBWEuFtPQgU4k1JrKxKLcqPLyrNSS0+xOgDtH0is5Rocj4wlvJK4g2N TcxNjU0tTSxMzCxxCCuJ8zKeehIgJJCeWJKanZpakFoEM46Jg1OqgTF0r4rcrd3T1yqVMh8X Z2aN+GyX8bD1jlqb7u6nk2ryS3d6vJC5GVD1ruj+/8uqbUYJG+edK2p5+GFlof56jdtam7j1 Nnj8mZIoYVMTwbJQdMaVux7NL2qcvs64/PXm6/L1t7Nbzi7cF1X15ht/p7A+rxDj5PboGvmE /ntvd5/+U5HIFuG5+4QSS3FGoqEWc1FxIgCw+JTghAIAAA== X-CFilter-Loop: Reflected Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org fimc_m2m_job_finish() has to be called with the m2m context for the necessary cleanup while resume. But currently fimc_m2m_job_finish() always passes fimc->m2m.ctx as NULL. This patch changes the order of the calls for proper cleanup while resume. Signed-off-by: Shaik Ameer Basha --- drivers/media/platform/s5p-fimc/fimc-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/s5p-fimc/fimc-core.c b/drivers/media/platform/s5p-fimc/fimc-core.c index 2a1558a..5b11544 100644 --- a/drivers/media/platform/s5p-fimc/fimc-core.c +++ b/drivers/media/platform/s5p-fimc/fimc-core.c @@ -868,14 +868,15 @@ static int fimc_m2m_resume(struct fimc_dev *fimc) { unsigned long flags; + if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state)) + fimc_m2m_job_finish(fimc->m2m.ctx, + VB2_BUF_STATE_ERROR); + spin_lock_irqsave(&fimc->slock, flags); /* Clear for full H/W setup in first run after resume */ fimc->m2m.ctx = NULL; spin_unlock_irqrestore(&fimc->slock, flags); - if (test_and_clear_bit(ST_M2M_SUSPENDED, &fimc->state)) - fimc_m2m_job_finish(fimc->m2m.ctx, - VB2_BUF_STATE_ERROR); return 0; }