From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.112 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796389949; b=ycfiT9yKRg61eQQnGbXJRS6TS8UgJt+vWhvslUND+tTkzV3zXa/yX+5HrBv0P0otE7TN 07KfLB047D/Ku6mumMhVHzCrNgSRBbJl4Ztn9xf9bdI+I9MfoElrvXdxJ3VTi6lgYApkv yJ6SY6IZQqsiKLfdLaZBKwyq9HdxglTjxaNfRVyP/8oCISTA/LEwWEte22zuDfZH/+rMd m3S/WHMnhXtH3evU/rG/6jwvrzYlU4hfqcnRFrhXozXh7l8HIimGuTFuL45rs4rXDNpb8 ciWO3saFFHJV0fnX3RCYdR8mQx58//J5/LD7uQ8f9kpZzEXARv/3PQxrVGMJFXHvI2A== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389949; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Date:MIME-Version: User-Agent:Subject:To:Cc:References:Content-Language:From:In-Reply-To: Content-Type:Content-Transfer-Encoding:X-ZohoMailClient; bh=ggY/iu/F/4PmkpyRpJGyW4ACewsy8O7S5bnYgpuD0Mo=; b=GxujMe+68ZBQdtaYb1J47lnAGh0ohJ2cvIBzk4XrEHX9B8JAC8vYNrqgL+DFwJTIWILF mnyO0nGpj5t1DstJql28SSV2dGHSpCKxLLXjiSW1oVw1vMWe7r/enVSiWLefTZBZ1ii+u nMFd/PjjVcyKku31k/XEXzE7dW9rvYauVtQwp7EMNiKbhGlN8Ys8if0s0q9yEiEGpSZwC +flLqHKpp3c4fNBAGkV3IOy/BVH1Eui84/J2ghZTuQwtYfc1splsPiviP7Zh3O9AwK/0U C419r9PJTXKcznElqfvIFICZ8xsw+LGQzSsWUhfORHkLuN/CQXopByK4NrL94yh3jGQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=GdanrM+H; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.182.112 Received: from sender5-pp-f112.zoho.com (sender5-pp-f112.zoho.com [165.173.182.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09F6B606A322; Fri, 4 Dec 2026 13:12:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 09F6B606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=GdanrM+H ARC-Seal: i=1; a=rsa-sha256; t=1796389929; cv=none; d=zohomail.com; s=zohoarc; b=YBfwB9xiGt2LpiXtaRGLXsqqgM97lLz/5ChHH9Oa6bEFGured5ejG0ze6MO+BzkwhWUnaOxheGHyX2E+4sNkA5/hLgBh9jh4bQxZFFMEAR7Vc+ic+EMwooTjN0LKqcAyajcEvTKJ8KG85iAy5PMeqAIpbddDqo1+Bo5myeu6rFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796389929; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=ggY/iu/F/4PmkpyRpJGyW4ACewsy8O7S5bnYgpuD0Mo=; b=FEqDX5gKR8F28SVBOSLPA2Mh6RCztmXxHiEQ2zXWAljmFvfzzLMgT3LXCzxOS126K/t5XdzGHM2XFcHnYqOhBdfAOusRmPHTq4nKE3npuCprTajbkXaKKePDLmjtM4SKhlGVAAJxsUaDcuMsLR2yLumN6Z+5BK84js9BCC+/7FY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=michael.riesch@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=GdanrM+HTuHxMZJp78wqLtveJTum8nrA2hZVjDJoF4fOyGcK8OoKsPxuBy80AHElKIYr+3tBUWekeA//9r856U90KM+mlG4mMwUaTg8Bsp8GnFV7kE9KJ5ogy7Suc9caWAFikTJ7gOX6tSut+Wpclrw7VKEJEZa2zkCZzsRJMkw=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=ggY/iu/F/4PmkpyRpJGyW4ACewsy8O7S5bnYgpuD0Mo=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796389926100918.541904905727; Fri, 4 Dec 2026 05:12:06 -0800 (PST) Message-ID: <3c7168d4-db76-4b51-867a-3ffff99be5e0@collabora.com> Date: Fri, 4 Dec 2026 14:12:00 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v2 00/16] media: Fault-Tolerant V4L2 To: Hans Verkuil , Mattijs Korpershoek , Laurent Pinchart , Kieran Bingham , Sakari Ailus , Mauro Carvalho Chehab , Andy Walls , Kees Cook , "Gustavo A. R. Silva" Cc: Nicolas Dufresne , Hans de Goede , Dave Stevenson , Maxime Ripard , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Laurent Pinchart References: <20261118-v4l2-sensor-detect-v2-0-1bb1a445b556@kernel.org> <87ea11b5-54f1-4c61-9707-9ce0d0b2d0fa@kernel.org> Content-Language: en-US From: Michael Riesch In-Reply-To: <87ea11b5-54f1-4c61-9707-9ce0d0b2d0fa@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ZohoMailClient: External 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