From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796392946; b=DuIdZE8oWIgtrh04vDqCQYvxCi4lE4Hc0QlhCLiWMo3GpQROpOZ+Uw+CQS1fJXiOY9Bx viDhZ2WigrG23Z3H1GVUyYgsh1CAq4XkEMkB2quSpH84968/vC+zBRctZfxWSPm3stoeo kZZdxa5AKp+X9DBPBQ0ZwQwsbnaZwnadOa6WfjDA30itvVyjvNNM/+vu9kzMNHNY7u7mB /0vpbFLsQDSKZPztDIZmHKFKh1y7OZhViHJvXCxeb/CoQcV6mwwZG1ichKUg06NQLM/FF aNuSuvwo/On7+np72MfDjTVY42Gz1k4ZgRc0gD6vUAGnByyf+WgA7kA66y0bT3Qgf5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796392946; h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent: Subject:To:Cc:References:From:Content-Language:In-Reply-To: Content-Type:Content-Transfer-Encoding; bh=Ni9YJgmqdtQPBYkmJ7Wtd/EE+7hdl92ziWtHfIP2S1E=; b=tHQv0sGhCqzcKMithtxRpns5efzuHeQhd3YUNdI2KvSHF1Xc7mkQ1VylwGTqtIsGfhaf IZhK7wkkJvGxigxLyI0REleSsvH8Bh7mF7bk3nZrAEJ0g6f6hLfT5awW1Gi2sC8aP9m5R w30wSfl79jhNREX2D+9llz5ybO/lWGKBFNmaLUEURsjzeTU6uhehtb/eY8O9C9sn+fJSf Z9qmPLF/0QOFcG1RFv6pl5K2rIKqJgUlEyPly3TnJA//P0GwjbYiIPtb5iQWZQNck5HNO bCcfVmfia0m43/pCCCCSWsYgcnb+j1/FNDQOB7lyJvmPcFVlLU2e0UKNKzeCJ7xEJbA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PTF6tzHi; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F05F4606A322; Fri, 4 Dec 2026 14:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PTF6tzHi Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3248F1F00933; Fri, 4 Dec 2026 14:02:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796392945; bh=Ni9YJgmqdtQPBYkmJ7Wtd/EE+7hdl92ziWtHfIP2S1E=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=PTF6tzHiG9DaYmEHI2FalVtp63NnrFhGzws4CHKbhSoX2x8Jk39XOYgUmVWHLCDfH fn9vcsu+VynmWlK197nv5w3GYAu3nP1Tn8UiRkMdrfF+NR+IFWjFAWHKuKHk9JN+qd usWiehj1OpNXVK9kf3JCARmptKPSWmTdtXThQK5I2ySo/UGiMGTEIXl7LV3QVDXYA1 26sRSR9PJrhI0Y1IsVgEtZfCGiYsUUTzAdZ9AXZQCWfKoFT2vgACxQfEb+Pamu+Lv7 yomym+Rol5RNzFrmiNYVWwlBkeFytD1t5sMFW/27JA9jxanCyVhFZoHiH1wjwQyKUQ u+PxfZ7OONVYw== Message-ID: <13f3e977-ebcf-4713-991d-a1eb09c8ce75@kernel.org> Date: Fri, 4 Dec 2026 15:02:20 +0100 X-Mailing-List: linux-media@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: Michael Riesch , 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> <3c7168d4-db76-4b51-867a-3ffff99be5e0@collabora.com> From: Hans Verkuil Content-Language: en-US, nl In-Reply-To: <3c7168d4-db76-4b51-867a-3ffff99be5e0@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 04/12/2026 14:12, Michael Riesch wrote: > 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. So will you write the RFC? Or Mattijs? Or someone else? I want to see an RFC for this feature, I've been asking for that for years. It's very frustrating that this RFC is still not written. Regards, Hans > >> >> 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 > >