All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API
Date: Thu, 07 Jul 2011 14:46:18 -0300	[thread overview]
Message-ID: <4E15F0EA.4080003@redhat.com> (raw)
In-Reply-To: <201107071928.57090.hverkuil@xs4all.nl>

Em 07-07-2011 14:28, Hans Verkuil escreveu:
> On Thursday, July 07, 2011 19:15:24 Mauro Carvalho Chehab wrote:
>> Em 07-07-2011 12:29, Hans Verkuil escreveu:
>>> On Wednesday, July 06, 2011 20:03:52 Mauro Carvalho Chehab wrote:
>>>> Instead of having their own generic error codes at the MC API, move
>>>> its section to the generic one and be sure that all media ioctl's
>>>> will point to it.
>>>>
>>>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>>>>
>>>> diff --git a/Documentation/DocBook/media/v4l/gen-errors.xml b/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> index 6ef476a..a7f73c9 100644
>>>> --- a/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> +++ b/Documentation/DocBook/media/v4l/gen-errors.xml
>>>> @@ -5,6 +5,11 @@
>>>>    <tgroup cols="2">
>>>>      &cs-str;
>>>>      <tbody valign="top">
>>>> +	<!-- Keep it ordered alphabetically -->
>>>> +      <row>
>>>> +	<entry>EBADF</entry>
>>>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
>>>> +      </row>
>>>>        <row>
>>>>  	<entry>EBUSY</entry>
>>>>  	<entry>The ioctl can't be handled because the device is busy. This is
>>>> @@ -15,7 +20,16 @@
>>>>  	       problem first (typically: stop the stream before retrying).</entry>
>>>>        </row>
>>>>        <row>
>>>> +	<entry>EFAULT</entry>
>>>> +	<entry><parameter>fd</parameter> is not a valid open file descriptor.</entry>
>>>
>>> This seems to be a copy-and-paste error. The original text in media-func-ioctl.xml says this:
>>>
>>> 	  <para><parameter>argp</parameter> references an inaccessible memory
>>> 	  area.</para>
>>
>> Ah, yes. Anyway, a latter patch changes it to:
> 
> OK, I missed that. It was a bit confusing to review.

Yeah. Documentation patches are harder to handle than normal patches. I did several
changes on the existing patches, but perfecting each patch individually will probably
take forever.

>>
>> 	<entry>EFAULT</entry>
>> 	<entry>There was a failure while copying data from/to userspace.</entry>
>>       </row>
>>
>> referencing a parameter name there is a bad thing anyway, as this is now at the common
>> ioctl error code.
>>
>> Instead of just using a posix-like error code:
>> 	EFAULT          Bad address (POSIX.1)
>>
>> I opted to use a more valuable description, explaining the reason for such error,
>> e. g. that there was a failure at the data copy from/to userspace.
>>
>> It may be better to change it to:
>>
>> 	<entry>EFAULT</entry>
>> 	<entry>There was a failure while copying data from/to userspace, probably
>> 		caused by an invalid pointer reference.</entry>
>>
>> I think I'll add the above description at the latter patch.
>>
>> I was intending to add there the other possible error causes found at V4L/DVB API's
>> and drivers, but the changes I did took me a longer time than I was expecting
>> originally.  I'll eventually do that when I have more time. 
>>
>> It would be really great if we could find some volunteer to help syncing 
>> the media API specs with the code.
>>
>>>> +      </row>
>>>> +      <row>
>>>>  	<entry>EINVAL</entry>
>>>> +	<entry>One or more of the ioctl parameters are invalid. This is a widely
>>>
>>> widely -> widely used
>>>
>>>> +	       error code. see the individual ioctl requests for actual causes.</entry>
>>>
>>> see -> See
>>
>> Fixed. 
> 
> OK, with these changes you have my
> 
> Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
> 
> as well for this patch.

Thanks!

> Just for my understanding: do you plan on merging this for 3.1? I have no objection to
> that. Together with the querycap version changes it is easy to add compatibility support
> to libv4l should that be necessary. I'm not convinced there won't be any fallout from
> this change, but at least there is a decent way of working around it if needed. And there
> is no doubt that -ENOTTY is a much better return code.

Yes, that's my plan. Having both patch series merged together seemed a good idea to me, as
it becomes easier for applications to benefit of that.
> 
> When this is merged I'll modify v4l2-compliance, v4l2-ctl (if necessary) and qv4l2.

OK.

> 
> Regards,
> 
> 	Hans


  reply	other threads:[~2011-07-07 17:46 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1309974026.git.mchehab@redhat.com>
2011-07-06 18:03 ` [PATCH RFCv3 17/17] [media] return -ENOTTY for unsupported ioctl's at legacy drivers Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-07 16:44   ` Mike Isely
2011-07-11 11:03   ` Laurent Pinchart
2011-07-06 18:03 ` [PATCH RFCv3 01/17] [media] DocBook: Add a chapter to describe media errors Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 02/17] [media] DocBook: Use the generic ioctl error codes for all V4L ioctl's Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 03/17] [media] DocBook: Use the generic error code page also for MC API Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-07 15:29   ` Hans Verkuil
2011-07-07 17:15     ` Mauro Carvalho Chehab
2011-07-07 17:28       ` Hans Verkuil
2011-07-07 17:46         ` Mauro Carvalho Chehab [this message]
2011-07-06 18:03 ` [PATCH RFCv3 04/17] [media] DocBook/media-ioc-setup-link.xml: Remove EBUSY Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 05/17] [media] DocBook: Remove V4L generic error description for ioctl() Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 06/17] [media] DocBook: Add an error code session for LIRC interface Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 07/17] [media] DocBook: Add return error codes to LIRC ioctl session Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 10/17] [media] DVB: Point to the generic error chapter Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 11/17] [media] DocBook/audio.xml: Remove generic errors Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 12/17] [media] DocBook/demux.xml: " Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 09/17] [media] nxt6000: i2c bus error should return -EIO Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:03 ` [PATCH RFCv3 13/17] [media] dvb-bt8xx: Don't return -EFAULT when a device is not found Mauro Carvalho Chehab
2011-07-06 18:03   ` Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 08/17] [media] siano: bad parameter is -EINVAL and not -EFAULT Mauro Carvalho Chehab
2011-07-06 18:04   ` Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 14/17] [media] DocBook/dvb: Use generic descriptions for the frontend API Mauro Carvalho Chehab
2011-07-06 18:04   ` Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 16/17] [media] v4l2 core: return -ENOTTY if an ioctl doesn't exist Mauro Carvalho Chehab
2011-07-06 18:04   ` Mauro Carvalho Chehab
2011-07-06 18:04 ` [PATCH RFCv3 15/17] [media] DocBook/dvb: Use generic descriptions for the video API Mauro Carvalho Chehab
2011-07-06 18:04   ` Mauro Carvalho Chehab

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=4E15F0EA.4080003@redhat.com \
    --to=mchehab@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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.