mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Riesch <michael.riesch@collabora.com>
To: Hans Verkuil <hverkuil+cisco@kernel.org>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Andy Walls <awalls@md.metrocast.net>, Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Nicolas Dufresne <nicolas.dufres@collabora.com>,
	Hans de Goede <hansg@kernel.org>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>,
	Maxime Ripard <mripard@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Subject: Re: [PATCH RFC v2 00/16] media: Fault-Tolerant V4L2
Date: Fri, 4 Dec 2026 14:12:00 +0100	[thread overview]
Message-ID: <3c7168d4-db76-4b51-867a-3ffff99be5e0@collabora.com> (raw)
In-Reply-To: <87ea11b5-54f1-4c61-9707-9ce0d0b2d0fa@kernel.org>

Hi Mattijs and Hans,

Thanks for this interesting work.

If I may chime in here:

On 12/3/26 11:36, Hans Verkuil wrote:
> [...]
>> This has been tested on a SK-AM69 board on top of the following series:
>> * https://lore.kernel.org/all/20260824121451.3348583-1-sakari.ailus@linux.intel.com/
>> * https://lore.kernel.org/all/20261104-j721e-csi2rx-crash-sd-enable-streams-v1-1-b77ee38c8dcf@kernel.org/
> 
> Sorry for the late reply, I was ill for a bit, then very busy.
> 
> So what I really want to see is an RFC post explaining the outlines of how this
> feature is designed.
> 
> So not a patch series, that comes next. Just a high-level design document. And not
> just explaining the design, but also the reasons for making the choices that went
> into that design. I.e.: 'I decided to choose this method, because...'.
> 
> The cover letter goes some way into that direction, but it is lacking the reasoning
> behind the choices. It also seems geared towards failing sensors. But what if a CSI
> bridge fails? A camera flash chip? A lens driver?
> 
> A practical real-life example is also with FPGA devices where part of the video pipeline
> is implemented inside the FPGA. What happens if the FPGA is unloaded, for example to
> save power when the device goes into standby? Can this uAPI be used to signal that it is
> gone, and when the FPGA is reloaded later, that it is back?
> 
> In other words, think big. And it is fine if we decide not to support certain use-cases,
> either 'at all' or 'not yet'. But what I want to see is that someone thought about it.
> 
> I have loads of questions: what about critical devices that must be present for the
> device to work? Who decides what is critical and what failures can be tolerated? If a
> device does not come up, how long do you wait before deciding it is broken? Can that
> be implemented in the media core or is that userspace that decides?

With any recent camera/video capture hardware there are several
different use cases with different hardware requirements. To make this
future proof, we need to accept that only the user space knows which
devices are relevant and what (if any) the plan B is when plan A does
not have all the hardware it requires.

If we accept the above, we don't have to try to be super smart about
which device is relevant in the kernel. All the kernel can do (and
should do) is offer the available hardware (where the availability
status may be distinguished, e.g., "present in DT + module loaded",
"hardware actually present", ...) and notify the user space about any
changes. Anything hardware related is still the kernel's job.

With this in mind, the answers to your questions are
 - The kernel does not distinguish between critical and uncritical
   devices.
 - User space.
 - This likely depends on the hardware and thus is up to the device
   driver.
 - User space.

> What happens when a device breaks after bring up: who decides when it is broken? And
> what can be tolerated and what failure is critical?

 - The device driver.
 - This likely depends on the use case and thus is up to the user space.

> And of course how to enable this mechanism. You chose a module parameter for the
> mc module, but that will enable it for all drivers that use the mc. I don't think
> that's right. It should be specific to the top-level bridge driver. A module parameter
> for that driver makes sense, and it can pass that on to the media device when it is
> created.

Looking at the current situation, I would agree that this should be
something specific to the media device. Which AFAIK corresponds to the
"top-level bridge driver".

However, please let us stop thinking about such a top-level bridge. The
assumption that there is always a thing like that in any recent hardware
does not hold. What entity would be the top-level bridge driver in e.g.
the RK3588 VICAP/ISP hardware? See the shared media controller
discussion that we had in Nice earlier this year. Let's expect e.g. the
rkcif driver and the rkisp2 driver to share a media device in the
future. Which module param would win in this case?

Let us hide this behind a module parameter for MC, or a kernel config
option, or both. Default to non-tolerant behavior, naturally. And if
someone enables the fault tolerant magic, trust them to handle it
properly in user space.

> 
> I wonder if it has to be even more granular, i.e. select it for a specific instance
> of a bridge driver device. That might be overkill.
> 
> Regards,
> 
> 	Hans
> 
>>
>> Thanks,
>> Mattijs
>>[...]

Best regards,
Michael


  reply	other threads:[~2026-12-04 13:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 12:43 Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 01/16] media: mc: Add struct media_device_fh pointer to media device IOCTL op Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 02/16] media: mc: Add per-file-handle data support Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 03/16] v4l: event: Separate event related information from struct v4l2_fh Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 04/16] v4l: event: Rework data structures for separating events and V4L2 Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 05/16] v4l: event: Split the event framework into generic and V4L2 bits Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 06/16] media: mc: Maintain a list of open file handles in a media device Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 07/16] media: mc: Add MEDIA_IOC_DQEVENT Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 08/16] media: mc: Add MEDIA_EVENT_ENTITY_REGISTRATION Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 09/16] Documentation: media: Add Media controller event documentation Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 10/16] media: media.h: Add entity connection status Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 11/16] media: mc: Add .detect() to media_entity_operations Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 12/16] media: mc: Add MEDIA_IOC_G_ENTITY_STATUS ioctl Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 13/16] media: mc: Add MEDIA_EVENT_ENTITY_STATUS_CHANGE event Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 14/16] media: mc: Add detect polling helpers for drivers Mattijs Korpershoek
2026-11-18 12:43 ` [PATCH RFC v2 15/16] media: imx219: Allow driver probe with missing sensor Mattijs Korpershoek
2026-11-18 12:44 ` [PATCH RFC v2 16/16] media: imx219: Implement .detect() sensor operation Mattijs Korpershoek
2026-12-03 10:36 ` [PATCH RFC v2 00/16] media: Fault-Tolerant V4L2 Hans Verkuil
2026-12-04 13:12   ` Michael Riesch [this message]
2026-12-04 14:02     ` Hans Verkuil

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=3c7168d4-db76-4b51-867a-3ffff99be5e0@collabora.com \
    --to=michael.riesch@collabora.com \
    --cc=awalls@md.metrocast.net \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=gustavoars@kernel.org \
    --cc=hansg@kernel.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=kees@kernel.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mkorpershoek@kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.dufres@collabora.com \
    --cc=sakari.ailus@linux.intel.com \
    /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

all inboxes | Powered by JetHome®