From patchwork Tue Apr 23 10:51:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katsuya Matsubara X-Patchwork-Id: 2477011 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 7F3413FCA5 for ; Tue, 23 Apr 2013 10:52:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756147Ab3DWKwg (ORCPT ); Tue, 23 Apr 2013 06:52:36 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:51285 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755506Ab3DWKwf (ORCPT ); Tue, 23 Apr 2013 06:52:35 -0400 Received: by mail-pa0-f50.google.com with SMTP id bg4so411889pad.23 for ; Tue, 23 Apr 2013 03:52:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=7ZazGI2zZVTxFvGu0/b9DN/+XHbKGDBkMqDRuhBZUD8=; b=VTux0ZeM2n76zTT1Ibso5ElHk+s8ivBrLrz18AaRGHlZzggJv1KPQDLPWtvAJM1KnU aVaqnhwCGWKoYrweNZvKW3gJMhf+t4VKW3r5mIobrtWytzHQJDKBEyeuPdxVAPcsSib2 P7/8JTtzeGBWM7Tgn0KeVcKd+TWPlzDBWDeE7zeBCGyUxqfPwk0AUywzM/h44u2K0vv3 yQGWYL8mM8QMrwDdI/RO9XEqwuvY/J1QGsB3LID7UE3cVJkJ80v057LuFBR/vPKGUco3 BeLrwtBYoI28wtq9gntxuaZV5zU2UaH6HFmqTAoaSBPaTciqUlhwR6CffZ9TS1Dn6J27 K6Sw== X-Received: by 10.68.254.167 with SMTP id aj7mr39209484pbd.98.1366714354567; Tue, 23 Apr 2013 03:52:34 -0700 (PDT) Received: from localhost.localdomain ([219.106.231.132]) by mx.google.com with ESMTPS id ih1sm26463098pbb.44.2013.04.23.03.52.32 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Apr 2013 03:52:33 -0700 (PDT) From: Katsuya Matsubara To: Guennadi Liakhovetski Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-sh@vger.kernel.org, Katsuya Matsubara Subject: [PATCH 2/3] [media] sh_veu: keep power supply until the m2m context is released Date: Tue, 23 Apr 2013 19:51:36 +0900 Message-Id: <1366714297-2784-3-git-send-email-matsu@igel.co.jp> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1366714297-2784-1-git-send-email-matsu@igel.co.jp> References: <1366714297-2784-1-git-send-email-matsu@igel.co.jp> X-Gm-Message-State: ALoCoQmvnoyD10+5BC62qXj83M+Gp/s1IF61bslhSJ/9c+1H9VGiXCVETDOZ/nEU1NhwXoG9ELSd Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org In the sh_veu driver, only the interrupt handler 'sh_veu_bh' can invoke the v4l2_m2m_job_finish() function. So the hardware must be alive for handling interrupts until returning from v4l2_m2m_ctx_release(). Signed-off-by: Katsuya Matsubara --- drivers/media/platform/sh_veu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c index f88c0e8..fa86c6f 100644 --- a/drivers/media/platform/sh_veu.c +++ b/drivers/media/platform/sh_veu.c @@ -1032,8 +1032,6 @@ static int sh_veu_release(struct file *file) dev_dbg(veu->dev, "Releasing instance %p\n", veu_file); - pm_runtime_put(veu->dev); - if (veu_file == veu->capture) { veu->capture = NULL; vb2_queue_release(v4l2_m2m_get_vq(veu->m2m_ctx, V4L2_BUF_TYPE_VIDEO_CAPTURE)); @@ -1049,6 +1047,8 @@ static int sh_veu_release(struct file *file) veu->m2m_ctx = NULL; } + pm_runtime_put(veu->dev); + kfree(veu_file); return 0;