lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe4b4f77-1c90-a88a-f393-44e35f8f1466@linaro.org>
Date:   Thu, 17 Nov 2016 11:10:40 +0200
From:   Stanimir Varbanov <stanimir.varbanov@...aro.org>
To:     Hans Verkuil <hverkuil@...all.nl>,
        Stanimir Varbanov <stanimir.varbanov@...aro.org>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     Andy Gross <andy.gross@...aro.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Stephen Boyd <sboyd@...eaurora.org>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-msm@...r.kernel.org
Subject: Re: [PATCH v3 3/9] media: venus: adding core part and helper
 functions

Hi Hans,

On 11/14/2016 12:25 PM, Hans Verkuil wrote:
> On 11/14/2016 11:11 AM, Stanimir Varbanov wrote:
>> Hi Hans,
>>
>> <cut>
>>
>>>>>
>>>>>> +void vidc_vb2_stop_streaming(struct vb2_queue *q)
>>>>>> +{
>>>>>> +	struct venus_inst *inst = vb2_get_drv_priv(q);
>>>>>> +	struct venus_core *core = inst->core;
>>>>>> +	struct device *dev = core->dev;
>>>>>> +	struct vb2_queue *other_queue;
>>>>>> +	struct vidc_buffer *buf, *n;
>>>>>> +	enum vb2_buffer_state state;
>>>>>> +	int ret;
>>>>>> +
>>>>>> +	if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
>>>>>> +		other_queue = &inst->bufq_cap;
>>>>>> +	else
>>>>>> +		other_queue = &inst->bufq_out;
>>>>>> +
>>>>>> +	if (!vb2_is_streaming(other_queue))
>>>>>> +		return;
>>>>>
>>>>> This seems wrong to me: this return means that the buffers of queue q are never
>>>>> released. Either drop this 'if' or release both queues when the last queue
>>>>> stops streaming. I think dropping the 'if' is best.
>>>>
>>>> I have done this way because hfi_session_stop must be called only once,
>>>> and buffers will be released on first streamoff for both queues.
>>>
>>> Are you sure the buffers are released for both queues? I may have missed that when
>>> reviewing.
>>
>> yes, hfi_session_stop will instruct the firmware to stop using provided
>> buffers and return ownership to the host driver by fill_buf_done and
>> empty_buf_done callbacks.
>>
>>>
>>> I would recommend to call hfi_session_stop when the first stop_streaming is called,
>>> not when it is called for both queues. I say this because stopping streaming without
>>> releasing the buffers is likely to cause problems.
>>
>> this is what I tried to implement with above
>> !vb2_is_streaming(other_queue) thing.
> 
> That doesn't work: if the application calls STREAMON(CAPTURE) followed by STREAMOFF(CAPTURE)
> without ever starting the OUTPUT queue, this will not clean up the capture queue.

Yes this is a bug which should be fixed.

-- 
regards,
Stan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ