Re: [PATCH 15/31] media: dvb-frontend invoke enable/disable_source handlers

From: Shuah Khan
Date: Thu Jan 28 2016 - 11:59:47 EST

On 01/28/2016 09:07 AM, One Thousand Gnomes wrote:
> On Thu, 28 Jan 2016 13:53:04 -0200
> Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxx> wrote:
>> Em Wed, 6 Jan 2016 13:27:04 -0700
>> Shuah Khan <shuahkh@xxxxxxxxxxxxxxx> escreveu:
>>> Checking for tuner availability from frontend thread start
>>> disrupts video stream. Change to check for tuner and start
>>> pipeline from frontend open instead and stop pipeline from
>>> frontend release.
>> That's wrong, as DVB can be opened on read-only mode, where
>> it won't be changing anything.

Correct. Please check the code. Tuner availability check is
done when the device is opened in Write mode in the following

if ((file->f_flags & O_ACCMODE) != O_RDONLY) {

>> Also, I don't think POSIX allows to return an error like EBUSY
>> on open:
> It doesn't document all the errors you may return. Quite a lot of
> kernel drivers return EBUSY when they are "single open" things.
> POSIX documents certain cases that *must* error and what the error code
> is. It documents certain possible failures and what their error code is.
> Beyond that it's up to you.

Returning EBUSY clearly indicates the reason why the device
can't be opened in this case.

-- Shuah

Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@xxxxxxxxxxxxxxx | (970) 217-8978