From patchwork Tue Jul 27 12:06:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 114518 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6RC7Cxn023822 for ; Tue, 27 Jul 2010 12:07:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410Ab0G0MHL (ORCPT ); Tue, 27 Jul 2010 08:07:11 -0400 Received: from tango.tkos.co.il ([62.219.50.35]:41514 "EHLO tango.tkos.co.il" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753046Ab0G0MHK (ORCPT ); Tue, 27 Jul 2010 08:07:10 -0400 Received: from jasper (89-139-46-109.bb.netvision.net.il [89.139.46.109]) (authenticated bits=0) by tango.tkos.co.il (8.14.4/8.12.11) with ESMTP id o6RC6aEq030070; Tue, 27 Jul 2010 15:06:43 +0300 From: Baruch Siach To: Linux Media Mailing List Cc: Michael Grzeschik , linux-arm-kernel@lists.infradead.org, Sascha Hauer , Baruch Siach Subject: [PATCH 4/4] mx2_camera: implement forced termination of active buffer for mx25 Date: Tue, 27 Jul 2010 15:06:10 +0300 Message-Id: <967af81dac1c4c7627b18b5eec23a258ac7d9cd2.1280229966.git.baruch@tkos.co.il> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: X-Spam-Level: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.62 on 62.219.50.35 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 27 Jul 2010 12:07:13 +0000 (UTC) diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index d327d11..396542b 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -648,15 +648,27 @@ static void mx2_videobuf_release(struct videobuf_queue *vq, * Terminate only queued but inactive buffers. Active buffers are * released when they become inactive after videobuf_waiton(). * - * FIXME: implement forced termination of active buffers, so that the - * user won't get stuck in an uninterruptible state. This requires a - * specific handling for each of the three DMA types that this driver - * supports. + * FIXME: implement forced termination of active buffers for mx27 and + * mx27 eMMA, so that the user won't get stuck in an uninterruptible + * state. This requires a specific handling for each of the these DMA + * types. */ spin_lock_irqsave(&pcdev->lock, flags); if (vb->state == VIDEOBUF_QUEUED) { list_del(&vb->queue); vb->state = VIDEOBUF_ERROR; + } else if (cpu_is_mx25() && vb->state == VIDEOBUF_ACTIVE) { + if (pcdev->fb1_active == buf) { + pcdev->csicr1 &= ~CSICR1_FB1_DMA_INTEN; + writel(0, pcdev->base_csi + CSIDMASA_FB1); + pcdev->fb1_active = NULL; + } else if (pcdev->fb2_active == buf) { + pcdev->csicr1 &= ~CSICR1_FB2_DMA_INTEN; + writel(0, pcdev->base_csi + CSIDMASA_FB2); + pcdev->fb2_active = NULL; + } + writel(pcdev->csicr1, pcdev->base_csi + CSICR1); + vb->state = VIDEOBUF_ERROR; } spin_unlock_irqrestore(&pcdev->lock, flags);