All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: mike@compulab.co.il,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 2/4] pxa_camera: Redesign DMA handling
Date: Wed, 11 Mar 2009 20:45:00 +0100	[thread overview]
Message-ID: <87k56vyhc3.fsf@free.fr> (raw)
In-Reply-To: <Pine.LNX.4.64.0903111313320.4818@axis700.grange> (Guennadi Liakhovetski's message of "Wed\, 11 Mar 2009 19\:25\:53 +0100 \(CET\)")

Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:

> On Tue, 10 Mar 2009, Robert Jarzmik wrote:
>
>> The DMA transfers in pxa_camera showed some weaknesses in
>> multiple queued buffers context :
>>  - poll/select problem
>>    The order between list pcdev->capture and DMA chain was
>>    not the same. This creates a discrepancy between video
>>    buffers marked as "done" by the IRQ handler, and the
>>    really finished video buffer.
>
> Double-check. I still do not see how the order can be swapped. But don't 
> worry, this doesn't diminish the value of your work, I'm just trying to be 
> fair to the existing driver:-)
Yes :) I thought I had sent a mail to apologize for the remaining comment ... I
have fully removed the order issue, I only left the poll/select issue.
And yes, it's not fair to the previous code, you're perfectly right.

>> @@ -324,7 +324,7 @@ static int calculate_dma_sglen(struct scatterlist *sglist, int sglen,
>>   * Prepares the pxa dma descriptors to transfer one camera channel.
>>   * Beware sg_first and sg_first_ofs are both input and output parameters.
>>   *
>> - * Returns 0
>> + * Returns 0 or -ENOMEM si no coherent memory is available
>
> s/si/if/ s'il vous plait:-)
Argh. I was sure I had amended that ... urg.

> Nice, how about putting this in Documentation/video4linux/pxa_camera.txt 
> and a reference to it in the comment?
Yes, it will make the code lighter, won't it ? I'll need a bit of help to
correct my english here ...

>> +	for (i = 0; i < pcdev->channels; i++) {
>> +		pcdev->sg_tail[i] = buf->dmas[i].sg_cpu + buf->dmas[i].sglen;
>> +		pcdev->sg_tail[i]->ddadr = DDADR_STOP;

> This function is now called "live" with running DMA, and you first append 
> the chain, and only then terminate it... It should be ok because it is 
> done with switched off IRQs, and DMA must be still at tail - 1 to 
> automatically continue onto the appended chain, so, you should have enough 
> time in 100% of cases, still it would look better to first terminate the 
> chain and then append it.
Correct. I'll invert the 2 assignments.

>
>> +static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev)
>> +{
>> +	unsigned long cicr0, cifr;
>> +
>> +	dev_dbg(pcdev->dev, "%s\n", __func__);
>
> <quote>
> I originally had a "reset the FIFOs" comment here, wouldn't hurt to add it 
> now too.
> </quote>
Yes. I re-added it. I added also your "Enable End-Of-Frame Interrupt" back.

>> @@ -524,81 +659,19 @@ static void pxa_videobuf_queue(struct videobuf_queue *vq,
>>  	struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent);
>>  	struct pxa_camera_dev *pcdev = ici->priv;
>>  	struct pxa_buffer *buf = container_of(vb, struct pxa_buffer, vb);
>> -	struct pxa_buffer *active;
>>  	unsigned long flags;
>> -	int i;
>>  
>> -	dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
>> -		vb, vb->baddr, vb->bsize);
>> -	spin_lock_irqsave(&pcdev->lock, flags);
>> +	dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d active=%p\n", __func__,
>> +		vb, vb->baddr, vb->bsize, pcdev->active);
>>  
>> +	spin_lock_irqsave(&pcdev->lock, flags);
>>  	list_add_tail(&vb->queue, &pcdev->capture);
>
> I can understand adding an empty line between dev_dbg() and 
> spin_lock_irqsave(), but I do not understand why you removed one between 
> spin_lock_irqsave() and list_add_tail().
My bad. I had a mdelay() around to test the corner case :) I'll amend that.

Cheers.

--
Robert

  reply	other threads:[~2009-03-11 19:45 UTC|newest]

Thread overview: 29+ 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
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 [this message]
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
     [not found] <1817982448.2932771236676188034.JavaMail.root@zimbra20-e3.priv.proxad.net>
2009-03-10  9:11 ` [PATCH 2/4] pxa_camera: Redesign DMA handling robert.jarzmik
2009-03-10  9:35   ` Guennadi Liakhovetski
     [not found] <1214153377.2956891236680608913.JavaMail.root@zimbra20-e3.priv.proxad.net>
2009-03-10 10:25 ` robert.jarzmik

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=87k56vyhc3.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    --cc=mike@compulab.co.il \
    /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.