alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Re: [RFC/PATCH v7 01/12] media: Media device node support
@ 2011-01-07  0:24 Andy Walls
  2011-01-07  0:31 ` Greg KH
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Walls @ 2011-01-07  0:24 UTC (permalink / raw)
  To: Hans Verkuil, Greg KH
  Cc: Laurent Pinchart, linux-media, linux-kernel, alsa-devel, broonie,
	clemens, sakari.ailus

Why, yes, there is a standard:

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html

A somewhat verbose description of the errnos is in section 2.3.

-Andy

Hans Verkuil <hverkuil@xs4all.nl> wrote:

>On Thursday, January 06, 2011 23:19:12 Greg KH wrote:
>
><snip>
>
>> > > > +static ssize_t media_read(struct file *filp, char __user *buf,
>> > > > +		size_t sz, loff_t *off)
>> > > > +{
>> > > > +	struct media_devnode *mdev = media_devnode_data(filp);
>> > > > +
>> > > > +	if (!mdev->fops->read)
>> > > > +		return -EINVAL;
>> > > > +	if (!media_devnode_is_registered(mdev))
>> > > > +		return -EIO;
>> > > 
>> > > How could this happen?
>> > 
>> > This can happen when a USB device is disconnected for instance.
>> 
>> But what's to keep that from happening on the next line as well?
>
>Nothing.
>
>> That
>> doesn't seem like a check you can ever be sure about, so I wouldn't do
>> it at all.
>
>Actually, there is a reason why this was done for v4l (and now the media
>API): typically, once a USB disconnect happens V4L drivers will call
>video_unregister_device() which calls device_unregister. Afterwards the
>device node should reject any new file operations except for release().
>
>Obviously, this check can be done in the driver as well, but doing this
>check in the V4L core has the advantage of 1) consistent return codes and
>2) drivers no longer have to check.
>
>Of course, since the disconnect can happen at any time drivers still need
>to be able to handle errors from the USB subsystem due to disconnects, but
>that is something they always have to do.
>
>> 
>> > > And are you sure -EIO is correct?
>> > 
>> > -ENXIO is probably better (I always confuse that with -ENODEV).
>
>I wondered why V4L uses -EIO and I think it is related to the V4L2 specification
>of the read() function:
>
>EIO
>I/O error. This indicates some hardware problem or a failure to communicate with
>a remote device (USB camera etc.).
>
>Well, I guess a disconnect can be seen as a failure to communicate :-)
>
>I think that ENODEV is much better. After all, there is no device
>anymore after a disconnect.
>
>Is there some standard for this?
>
>Regards,
>
>	Hans
>
>-- 
>Hans Verkuil - video4linux developer - sponsored by Cisco
>--
>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

^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: [RFC/PATCH v7 01/12] media: Media device node support
@ 2011-01-07  1:04 Andy Walls
  0 siblings, 0 replies; 12+ messages in thread
From: Andy Walls @ 2011-01-07  1:04 UTC (permalink / raw)
  To: Greg KH
  Cc: Hans Verkuil, Laurent Pinchart, linux-media, linux-kernel,
	alsa-devel, broonie, clemens, sakari.ailus

Yeah well, lame-o default email client on my Android phone.

-Andy

Greg KH <gregkh@suse.de> wrote:

>
>
>A: No.
>Q: Should I include quotations after my reply?
>
>http://daringfireball.net/2007/07/on_top
>
>On Thu, Jan 06, 2011 at 07:24:27PM -0500, Andy Walls wrote:
>> Why, yes, there is a standard:
>> 
>> http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_03.html
>> 
>> A somewhat verbose description of the errnos is in section 2.3.
>
>Ah, so perhaps -ENXIO is the correct thing to return with here.
>
>thanks,
>
>greg k-h
>--
>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

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [RFC/PATCH v7 00/12] Media controller (core and V4L2)
@ 2010-12-20 11:36 Laurent Pinchart
  2010-12-20 11:36 ` [RFC/PATCH v7 01/12] media: Media device node support Laurent Pinchart
  0 siblings, 1 reply; 12+ messages in thread
From: Laurent Pinchart @ 2010-12-20 11:36 UTC (permalink / raw)
  To: linux-media, linux-kernel, alsa-devel
  Cc: broonie, clemens, gregkh, sakari.ailus

Hi everybody,

Here is the seventh version of the media controller core and V4L2 patches.
the first one to be sent outside of the linux-media mailing list.

Quick reminder for those who missed the previous version. let me quote the
documentation (Documentation/DocBook/v4l/media-controller.xml).

"Discovering a [media] device internal topology, and configuring it at runtime,
is one of the goals of the media controller API. To achieve this, hardware
devices are modelled as an oriented graph of building blocks called entities
connected through pads."

The code has been extensively reviewed by the V4L community, and this version
is the first one to incorporate comments from the ALSA community (big thanks
to Mark Brown and Clemens Ladisch). Two issues are not fully addressed yet,
namely power management (I need to discuss this some more with the ALSA
developers to really understand their requirements) and entities type names.
I'm still posting this for review, as other developers have showed interest in
commenting on the code.

I want to emphasize once again that the media controller API does not replace
the V4L, DVB or ALSA APIs. It complements them.

The first user of the media controller API is the OMAP3 ISP driver. You can
find it (as well as these patches and other V4L-specific patches) in a git tree
at http://git.linuxtv.org/pinchartl/media.git (media-0004-omap3isp branch). The
OMAP3 ISP driver patches are regularly posted for review on the linux-media
list.

Laurent Pinchart (10):
  media: Media device node support
  media: Media device
  media: Entities, pads and links
  media: Media device information query
  media: Entities, pads and links enumeration
  media: Links setup
  media: Pipelines and media streams
  v4l: Add a media_device pointer to the v4l2_device structure
  v4l: Make video_device inherit from media_entity
  v4l: Make v4l2_subdev inherit from media_entity

Sakari Ailus (2):
  media: Entity graph traversal
  media: Reference count and power handling

 Documentation/DocBook/media-entities.tmpl          |   24 +
 Documentation/DocBook/media.tmpl                   |    3 +
 Documentation/DocBook/v4l/media-controller.xml     |   89 +++
 Documentation/DocBook/v4l/media-func-close.xml     |   59 ++
 Documentation/DocBook/v4l/media-func-ioctl.xml     |  116 ++++
 Documentation/DocBook/v4l/media-func-open.xml      |   94 +++
 .../DocBook/v4l/media-ioc-device-info.xml          |  133 ++++
 .../DocBook/v4l/media-ioc-enum-entities.xml        |  308 +++++++++
 Documentation/DocBook/v4l/media-ioc-enum-links.xml |  207 ++++++
 Documentation/DocBook/v4l/media-ioc-setup-link.xml |   93 +++
 Documentation/media-framework.txt                  |  383 +++++++++++
 Documentation/video4linux/v4l2-framework.txt       |   72 ++-
 drivers/media/Kconfig                              |   13 +
 drivers/media/Makefile                             |   10 +-
 drivers/media/media-device.c                       |  382 +++++++++++
 drivers/media/media-devnode.c                      |  321 +++++++++
 drivers/media/media-entity.c                       |  690 ++++++++++++++++++++
 drivers/media/video/v4l2-dev.c                     |   49 ++-
 drivers/media/video/v4l2-device.c                  |   52 ++-
 drivers/media/video/v4l2-subdev.c                  |   41 ++-
 include/linux/Kbuild                               |    1 +
 include/linux/media.h                              |  132 ++++
 include/media/media-device.h                       |   92 +++
 include/media/media-devnode.h                      |   97 +++
 include/media/media-entity.h                       |  148 +++++
 include/media/v4l2-dev.h                           |    7 +
 include/media/v4l2-device.h                        |    4 +
 include/media/v4l2-subdev.h                        |   10 +
 28 files changed, 3603 insertions(+), 27 deletions(-)
 create mode 100644 Documentation/DocBook/v4l/media-controller.xml
 create mode 100644 Documentation/DocBook/v4l/media-func-close.xml
 create mode 100644 Documentation/DocBook/v4l/media-func-ioctl.xml
 create mode 100644 Documentation/DocBook/v4l/media-func-open.xml
 create mode 100644 Documentation/DocBook/v4l/media-ioc-device-info.xml
 create mode 100644 Documentation/DocBook/v4l/media-ioc-enum-entities.xml
 create mode 100644 Documentation/DocBook/v4l/media-ioc-enum-links.xml
 create mode 100644 Documentation/DocBook/v4l/media-ioc-setup-link.xml
 create mode 100644 Documentation/media-framework.txt
 create mode 100644 drivers/media/media-device.c
 create mode 100644 drivers/media/media-devnode.c
 create mode 100644 drivers/media/media-entity.c
 create mode 100644 include/linux/media.h
 create mode 100644 include/media/media-device.h
 create mode 100644 include/media/media-devnode.h
 create mode 100644 include/media/media-entity.h

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-01-11  0:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-07  0:24 [RFC/PATCH v7 01/12] media: Media device node support Andy Walls
2011-01-07  0:31 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2011-01-07  1:04 Andy Walls
2010-12-20 11:36 [RFC/PATCH v7 00/12] Media controller (core and V4L2) Laurent Pinchart
2010-12-20 11:36 ` [RFC/PATCH v7 01/12] media: Media device node support Laurent Pinchart
2010-12-23  3:32   ` Greg KH
2010-12-24 11:59     ` Laurent Pinchart
2011-01-06 22:19       ` Greg KH
2011-01-06 23:27         ` Hans Verkuil
2011-01-06 23:46           ` Greg KH
2011-01-10 14:09         ` Laurent Pinchart
2011-01-11  0:15           ` Raymond Yau
2010-12-23  3:34   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).