linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Shuah Khan <shuah@kernel.org>
Subject: Re: [RFC] Make entity to interface links immutable
Date: Mon, 2 Jul 2018 06:41:21 -0300	[thread overview]
Message-ID: <20180702064116.401a244e@coco.lan> (raw)
In-Reply-To: <354b01c0-6825-4302-a1f4-d120cf8c34e3@xs4all.nl>

Em Mon, 2 Jul 2018 10:18:37 +0200
Hans Verkuil <hverkuil@xs4all.nl> escreveu:

> While working on v4l2-compliance I noticed that entity to interface links
> have just the MEDIA_LNK_FL_ENABLED flag set.
> 
> Shouldn't we also set the MEDIA_LNK_FL_IMMUTABLE? After all, you cannot change
> an entity-interface link. It feels inconsistent not to have this flag.

It could make sense for non-hybrid devices, but this may not be true
for hybrid ones. See below.

> I also propose that media_create_intf_link() drops the last flags argument:
> it can set the link flags directly since they are always the same anyway.

When we came with this design, the idea is that an interface can be 
disabled/enabled at runtime, if the entity it links can't be used,
because the hardware is busy doing something else. 

That could happen with hybrid devices, where the analog part could
be consuming resources that would be needed for the digital part.

Disabling the link at runtime has an advantage that it makes easier
to check - as open() syscalls could just use it to return -EBUSY,
instead of doing a complete graph analysis. Also, applications can
test it directly, in order to have a hint if a device is ready for
usage.

That was one of the approaches we considered at the design, but I
don't remember if Shuah's patch series actually used it or not,
as I don't look at her pending patches for a long time. I suspect
she took a different approach.

Anyway, before touching it, I'd like to see her patches merged,
and do some tests with real case scenarios before changing it.


Thanks,
Mauro

  reply	other threads:[~2018-07-02  9:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02  8:18 [RFC] Make entity to interface links immutable Hans Verkuil
2018-07-02  9:41 ` Mauro Carvalho Chehab [this message]
2018-07-02 10:38   ` Hans Verkuil
2018-07-02 12:24     ` Mauro Carvalho Chehab
2018-07-09 15:21   ` Shuah Khan

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=20180702064116.401a244e@coco.lan \
    --to=mchehab+samsung@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=shuah@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 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).