All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: mike@compulab.co.il,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 4/4] pxa_camera: Fix overrun condition on last buffer
Date: Mon, 9 Mar 2009 12:39:42 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.64.0903091236540.3992@axis700.grange> (raw)
In-Reply-To: <1236282351-28471-5-git-send-email-robert.jarzmik@free.fr>

On Thu, 5 Mar 2009, Robert Jarzmik wrote:

> The last buffer queued will often overrun, as the DMA chain
> is finished, and the time the dma irq handler is activated,

s/and the time/and during the time/ ?

> the QIF fifos are filled by the sensor.
> 
> The fix is to ignore the overrun condition on the last
> queued buffer, and restart the capture only on intermediate
> buffers of the chain.
> 
> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
> ---
>  drivers/media/video/pxa_camera.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 16bf0a3..dd56c35 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -734,14 +734,18 @@ static void pxa_camera_dma_irq(int channel, struct pxa_camera_dev *pcdev,
>  		status & DCSR_ENDINTR ? "EOF " : "", vb, DDADR(channel));
>  
>  	if (status & DCSR_ENDINTR) {
> -		if (camera_status & overrun) {
> +		/*
> +		 * It's normal if the last frame creates an overrun, as there
> +		 * are no more DMA descriptors to fetch from QIF fifos
> +		 */
> +		if (camera_status & overrun
> +		    && !list_is_last(pcdev->capture.next, &pcdev->capture)) {
>  			dev_dbg(pcdev->dev, "FIFO overrun! CISR: %x\n",
>  				camera_status);
>  			pxa_camera_stop_capture(pcdev);
>  			pxa_camera_start_capture(pcdev);
>  			goto out;
>  		}
> -
>  		buf->active_dma &= ~act_dma;

This empty like removal doesn't belong to the fix, I'll remove it when 
committing, and amend the commit message as above. Please, comment if you 
disagree.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

  reply	other threads:[~2009-03-09 11:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 19:45 [PATCH 0/4] pxa_camera: Redesign DMA handling Robert Jarzmik
2009-03-05 19:45 ` [PATCH 1/4] pxa_camera: Remove YUV planar formats hole Robert Jarzmik
2009-03-05 19:45   ` [PATCH 2/4] pxa_camera: Redesign DMA handling Robert Jarzmik
2009-03-05 19:45     ` [PATCH 3/4] pxa_camera: Coding style sweeping Robert Jarzmik
2009-03-05 19:45       ` [PATCH 4/4] pxa_camera: Fix overrun condition on last buffer Robert Jarzmik
2009-03-09 11:39         ` Guennadi Liakhovetski [this message]
2009-03-09 19:16           ` Robert Jarzmik
2009-03-11 18:31         ` Guennadi Liakhovetski
2009-03-12 21:36           ` Robert Jarzmik
2009-03-12 22:12             ` Guennadi Liakhovetski
2009-03-09 11:35     ` [PATCH 2/4] pxa_camera: Redesign DMA handling Guennadi Liakhovetski
2009-03-09 20:50       ` Robert Jarzmik
2009-03-09 23:14         ` Guennadi Liakhovetski
2009-03-10 21:46           ` Robert Jarzmik
2009-03-11 18:25             ` Guennadi Liakhovetski
2009-03-11 19:45               ` Robert Jarzmik
2009-03-11 20:24                 ` Robert Jarzmik
2009-03-11 21:21             ` Robert Jarzmik
2009-03-05 20:29   ` [PATCH 1/4] pxa_camera: Remove YUV planar formats hole Guennadi Liakhovetski
2009-03-05 21:10     ` Robert Jarzmik
2009-03-05 21:22       ` Trent Piepho
2009-03-05 22:15         ` Guennadi Liakhovetski
2009-03-06  9:30           ` Trent Piepho
2009-03-09 10:45   ` Guennadi Liakhovetski
2009-03-09 19:13     ` Robert Jarzmik
2009-03-10 18:33       ` Trent Piepho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0903091236540.3992@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mike@compulab.co.il \
    --cc=robert.jarzmik@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.