From patchwork Fri Jan 28 07:46:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatolij Gustschin X-Patchwork-Id: 514321 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0S7i6Yf009674 for ; Fri, 28 Jan 2011 07:46:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753530Ab1A1HqX (ORCPT ); Fri, 28 Jan 2011 02:46:23 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:52839 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753304Ab1A1HqW (ORCPT ); Fri, 28 Jan 2011 02:46:22 -0500 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 5C6891C01F1F; Fri, 28 Jan 2011 08:46:20 +0100 (CET) X-Auth-Info: VD5Rx2JfAd/bbATHTK01UQMMpoHCZdmhBRHQguG5Nrk= Received: from wker (p4FE3EABB.dip.t-dialin.net [79.227.234.187]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA id B3D4B1C000E2; Fri, 28 Jan 2011 08:46:19 +0100 (CET) Date: Fri, 28 Jan 2011 08:46:55 +0100 From: Anatolij Gustschin To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski , Dan Williams , linux-arm-kernel@lists.infradead.org, Detlev Zundel , Markus Niebel Subject: Re: [PATCH 0/2] Fix issues with frame reception from CSI on i.MX31 Message-ID: <20110128084655.0e6eddb5@wker> In-Reply-To: <1296031789-1721-1-git-send-email-agust@denx.de> References: <1296031789-1721-1-git-send-email-agust@denx.de> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) Mime-Version: 1.0 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.6 (demeter1.kernel.org [140.211.167.41]); Fri, 28 Jan 2011 07:46:24 +0000 (UTC) diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index d696915..f9fa0b3 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c @@ -8,7 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - +#define DEBUG #include #include #include @@ -910,6 +910,8 @@ static dma_cookie_t idmac_tx_submit(struct dma_async_tx_descriptor *tx) goto dequeue; } + dump_idmac_reg(ipu); + if (ichan->status < IPU_CHANNEL_ENABLED) { ret = ipu_enable_channel(idmac, ichan); if (ret < 0) { @@ -1472,22 +1474,106 @@ static void idmac_terminate_all(struct dma_chan *chan) static irqreturn_t ic_sof_irq(int irq, void *dev_id) { struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); printk(KERN_DEBUG "Got SOF IRQ %d on Channel %d\n", irq, ichan->dma_chan.chan_id); - disable_irq_nosync(irq); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + /*disable_irq_nosync(irq);*/ return IRQ_HANDLED; } static irqreturn_t ic_eof_irq(int irq, void *dev_id) { struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); printk(KERN_DEBUG "Got EOF IRQ %d on Channel %d\n", irq, ichan->dma_chan.chan_id); - disable_irq_nosync(irq); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + /*disable_irq_nosync(irq);*/ + return IRQ_HANDLED; +} + +static irqreturn_t ic_nf_ack_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got NF ACK IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + return IRQ_HANDLED; +} + +static irqreturn_t ic_nfb4_eof_err_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got NF B4 EOF ERR IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + return IRQ_HANDLED; +} + +static irqreturn_t ic_bay_ovf_err_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got BAYER BUF OVF ERR IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + return IRQ_HANDLED; +} + +static irqreturn_t ic_enc_ovf_err_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got ENC BUF OVF ERR IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); return IRQ_HANDLED; } +static irqreturn_t ic_bay_frm_lost_err_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got BAYER FRM LOST ERR IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + return IRQ_HANDLED; +} + +static irqreturn_t ic_enc_frm_lost_err_irq(int irq, void *dev_id) +{ + struct idmac_channel *ichan = dev_id; + struct idmac *idmac = to_idmac(ichan->dma_chan.device); + struct ipu *ipu = to_ipu(idmac); + printk(KERN_DEBUG "Got ENC FRM LOST ERR IRQ %d on Channel %d\n", + irq, ichan->dma_chan.chan_id); + dump_idmac_reg(ipu); + printk(KERN_DEBUG "__________________________________________\n"); + return IRQ_HANDLED; +} + + static int ic_sof = -EINVAL, ic_eof = -EINVAL; +static int ic_nf_ack = -EINVAL, ic_nfb4_eof_err = -EINVAL; +static int ic_bay_ovf_err = -EINVAL, ic_enc_ovf_err = -EINVAL; +static int ic_bay_frm_lost_err = -EINVAL, ic_enc_frm_lost_err = -EINVAL; #endif static int idmac_alloc_chan_resources(struct dma_chan *chan) @@ -1526,12 +1612,33 @@ static int idmac_alloc_chan_resources(struct dma_chan *chan) #ifdef DEBUG if (chan->chan_id == IDMAC_IC_7) { + ic_nf_ack = ipu_irq_map(39); + if (ic_nf_ack > 0) + request_irq(ic_nf_ack, ic_nf_ack_irq, 0, "DMAIC NF ACK", ichan); ic_sof = ipu_irq_map(69); if (ic_sof > 0) request_irq(ic_sof, ic_sof_irq, 0, "IC SOF", ichan); ic_eof = ipu_irq_map(70); if (ic_eof > 0) request_irq(ic_eof, ic_eof_irq, 0, "IC EOF", ichan); + ic_nfb4_eof_err = ipu_irq_map(103); + if (ic_nfb4_eof_err > 0) + request_irq(ic_nfb4_eof_err, ic_nfb4_eof_err_irq, 0, "IC NFB4EOF ERR", ichan); + + ic_bay_ovf_err = ipu_irq_map(128); + if (ic_bay_ovf_err > 0) + request_irq(ic_bay_ovf_err, ic_bay_ovf_err_irq, 0, "BAYER BUF OVF ERR", ichan); + ic_enc_ovf_err = ipu_irq_map(129); + if (ic_enc_ovf_err > 0) + request_irq(ic_enc_ovf_err, ic_enc_ovf_err_irq, 0, "ENC BUF OVF ERR", ichan); + + ic_bay_frm_lost_err = ipu_irq_map(139); + if (ic_bay_frm_lost_err > 0) + request_irq(ic_bay_frm_lost_err, ic_bay_frm_lost_err_irq, 0, "BAYER FRM LOST ERR", ichan); + + ic_enc_frm_lost_err = ipu_irq_map(140); + if (ic_enc_frm_lost_err > 0) + request_irq(ic_enc_frm_lost_err, ic_enc_frm_lost_err_irq, 0, "ENC FRM LOST ERR", ichan); } #endif @@ -1562,6 +1669,11 @@ static void idmac_free_chan_resources(struct dma_chan *chan) if (ichan->status > IPU_CHANNEL_FREE) { #ifdef DEBUG if (chan->chan_id == IDMAC_IC_7) { + if (ic_nf_ack > 0) { + free_irq(ic_nf_ack, ichan); + ipu_irq_unmap(39); + ic_nf_ack = -EINVAL; + } if (ic_sof > 0) { free_irq(ic_sof, ichan); ipu_irq_unmap(69); @@ -1572,6 +1684,31 @@ static void idmac_free_chan_resources(struct dma_chan *chan) ipu_irq_unmap(70); ic_eof = -EINVAL; } + if (ic_nfb4_eof_err > 0) { + free_irq(ic_nfb4_eof_err, ichan); + ipu_irq_unmap(103); + ic_nfb4_eof_err = -EINVAL; + } + if (ic_bay_ovf_err > 0) { + free_irq(ic_bay_ovf_err, ichan); + ipu_irq_unmap(128); + ic_bay_ovf_err = -EINVAL; + } + if (ic_enc_ovf_err > 0) { + free_irq(ic_enc_ovf_err, ichan); + ipu_irq_unmap(129); + ic_enc_ovf_err = -EINVAL; + } + if (ic_bay_frm_lost_err > 0) { + free_irq(ic_bay_frm_lost_err, ichan); + ipu_irq_unmap(139); + ic_bay_frm_lost_err = -EINVAL; + } + if (ic_enc_frm_lost_err > 0) { + free_irq(ic_enc_frm_lost_err, ichan); + ipu_irq_unmap(140); + ic_enc_frm_lost_err = -EINVAL; + } } #endif free_irq(ichan->eof_irq, ichan); diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index 2322798..9e566dd 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -8,7 +8,7 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ - +#define DEBUG #include #include #include