All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Towle <william.towle@codethink.co.uk>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: William Towle <william.towle@codethink.co.uk>,
	Ben Hutchings <ben.hutchings@codethink.co.uk>,
	linux-media@vger.kernel.org, linux-kernel@codethink.co.uk,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>,
	Hans Verkuil <hverkuil@xs4all.nl>
Subject: Re: [RFC PATCH 5/5] media: rcar_vin: move buffer management to .stop_streaming handler
Date: Tue, 20 Jan 2015 12:27:52 +0000 (GMT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1501201211490.4535@xk120> (raw)
In-Reply-To: <Pine.LNX.4.64.1501191522190.27578@axis700.grange>



On Mon, 19 Jan 2015, Guennadi Liakhovetski wrote:
> On Mon, 19 Jan 2015, William Towle wrote:
>>   in the patchset Ben linked to above we think
>> we have the appropriate loops: a for loop for queue_buf[], and
>> list_for_each_safe() for anything left in priv->capture; this is
>> consistent with rcar_vin_fill_hw_slot() setting up queue_buf[] with
>> pointers unlinked from priv->capture. This in turn suggests that we
>> are right not to call list_del_init() in both of
>> rcar_vin_stop_streaming()'s loops ... as long as I've correctly
>> interpreted the code and everyone's feedback thus far.
>
> I'm referring to this comment by Hans Verkuil of 14 August last year:
>
>> I'm assuming all buffers that are queued to the driver via buf_queue() are
>> linked into priv->capture. So you would typically call vb2_buffer_done
>> when you are walking that list:
>>
>> 	list_for_each_safe(buf_head, tmp, &priv->capture) {
>> 		// usually you go from buf_head to the real buffer struct
>> 		// containing a vb2_buffer struct
>> 		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
>> 		list_del_init(buf_head);
>> 	}
>>
>> Please use this rather than looking into internal vb2_queue
>> datastructures.
>
> I think, that's the right way to implement that clean up loop.

Hi,
   I was describing the code in my latest patch; we start with
rcar_vin_stop_streaming() having a list_for_each_safe() loop like
that above, and leave that loop in place but add statements to it.

   I add another loop to rcar_vin_stop_streaming() [which you will
have seen -in the patch Ben published in my absence over Christmas-
was particularly inelegant initially], but it can't be rewritten in
the same way.  The new version is undeniably neater, though.

   We believe the latest patches take Hans' comment above into
account properly, and we are looking into his latest suggestion at
the moment.

Thanks again,
   Wills.

  reply	other threads:[~2015-01-20 12:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 14:47 [RFC PATCH 0/5] media: rcar_vin: Fixes for buffer management Ben Hutchings
2014-12-18 14:49 ` [RFC PATCH 1/5] media: rcar_vin: Dont aggressively retire buffers Ben Hutchings
2015-01-18 20:16   ` Guennadi Liakhovetski
2014-12-18 14:49 ` [RFC PATCH 2/5] media: rcar_vin: Ensure all in-flight buffers are returned to error state before stopping Ben Hutchings
2014-12-30 13:14   ` Sakari Ailus
2014-12-18 14:49 ` [RFC PATCH 3/5] media: rcar_vin: Fix race condition terminating stream Ben Hutchings
2014-12-18 17:40   ` Sergei Shtylyov
2015-01-18 20:34     ` Guennadi Liakhovetski
2014-12-18 14:49 ` [RFC PATCH 4/5] media: rcar_vin: Clean up rcar_vin_irq Ben Hutchings
2014-12-18 14:50 ` [RFC PATCH 5/5] media: rcar_vin: move buffer management to .stop_streaming handler Ben Hutchings
2014-12-18 17:33   ` Sergei Shtylyov
2015-01-18 21:23   ` Guennadi Liakhovetski
2015-01-19 10:50     ` Ben Hutchings
2015-01-19 11:11       ` Guennadi Liakhovetski
2015-01-19 14:11         ` William Towle
2015-01-19 14:25           ` Guennadi Liakhovetski
2015-01-20 12:27             ` William Towle [this message]
2015-01-19 14:52           ` Hans Verkuil
2014-12-18 17:36 ` [RFC PATCH 0/5] media: rcar_vin: Fixes for buffer management Sergei Shtylyov

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=alpine.DEB.2.02.1501201211490.4535@xk120 \
    --to=william.towle@codethink.co.uk \
    --cc=ben.hutchings@codethink.co.uk \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@codethink.co.uk \
    --cc=linux-media@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    /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.