All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: William Towle <william.towle@codethink.co.uk>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Ben Hutchings <ben.hutchings@codethink.co.uk>,
	linux-media@vger.kernel.org, linux-kernel@codethink.co.uk,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: Re: [RFC PATCH 5/5] media: rcar_vin: move buffer management to .stop_streaming handler
Date: Mon, 19 Jan 2015 15:52:45 +0100	[thread overview]
Message-ID: <54BD1A3D.7010001@xs4all.nl> (raw)
In-Reply-To: <alpine.DEB.2.02.1501191404570.4586@xk120>

On 01/19/2015 03:11 PM, William Towle wrote:
> 
> On Mon, 19 Jan 2015, Guennadi Liakhovetski wrote:
> 
>>>> On Thu, 18 Dec 2014, Ben Hutchings wrote:
>>> Well, I thought that too.  Will's submission from last week has that
>>> change:
>>> http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/87009
> 
>> Anyway, yes, that looks better! But I would still consider keeping buffers
>> on the list in .buf_clean(), in which case you can remove it. And walk the
>> list instead of the VB2 internal buffer array, as others have pointed out.
> 
> Hi Guennadi,
>    Thanks for the clarification. Ian (when he was with us) did say "it
> was particularly difficult to understand WTH this driver was doing".
> 
>    Regarding your first point, if it's safe to skip the actions left
> in rcar_vin_videobuf_release() then I will do a further rework to
> remove it completely.

Yes, that's safe. Just remove it altogether.

The buf_init and buf_release ops are matching ops that are normally only
used if you have to do per-buffer initialization and/or release. These
are only called when the buffer memory changes. In most drivers including
this one it's not needed at all.

The same is true for rcar_vin_videobuf_init: it's pointless since the
list initialization is done implicitly when you add the buffer to a
list with list_add_tail(). Just drop the function.

Regards,

	Hans

> 
>    Regarding your second, 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.
> 
> 
> Cheers,
>    Wills.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  parent reply	other threads:[~2015-01-19 14:53 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
2015-01-19 14:52           ` Hans Verkuil [this message]
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=54BD1A3D.7010001@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=ben.hutchings@codethink.co.uk \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-kernel@codethink.co.uk \
    --cc=linux-media@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=william.towle@codethink.co.uk \
    /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.