Hi Mauro and Hans, On 07/02/2018 03:41 AM, Mauro Carvalho Chehab wrote: > Em Mon, 2 Jul 2018 10:18:37 +0200 > Hans Verkuil <hverkuil@xxxxxxxxx> 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. > I have been sidetracked by USB over IP security vulnerability reports and fixing them since last November. Sorry for not picking this work back up. I am back from a week of vacation and I will dig my patches and respond with details in a couple of days. thanks for your patience, -- Shuah