From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.251.105.195 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796481071; b=3ZfB/oMCzcm3wqf+tLX902NojuzfyOm3SV1UCRgHGuijiziu+U1UvnotqRrv6IJAOtl+ 1fh9mV/ywpLn4J2EEfM+HvhZVSAj4B5hXKjB48Z7fVnDmNPO6gA6oeVU1YBbDpVv6ChH8 8+VJ6eB5G1ycKORrOspB2ayZi3Cqp7Ce4Sjxy1Bx5wghAMl+ndqN5wZtzgdYqdJdrwsIx +Gs3a0axxa/CH4FocBjCDufPPeCMYxT59tuWwJhnZYwblKbEV61onYYoM9/jzA6mrGr8a +/GyII0yDbNyrPvEwdAFRbcpkR9WbxRtv+hJTADiPsNxQ3eCT5bg5zkhp9VdAs2N0uA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796481071; h=DMARC-Filter:DKIM-Signature:Received:Message-ID:Subject:From:To:Cc: Date:In-Reply-To:References:Autocrypt:Organization:Content-Type: User-Agent:MIME-Version; bh=oVckJ82vKRgge4bS+Qv10d3JDYC/FWXzQlvmuzoefek=; b=lkmodUdf2eb0vjhRnGNVdFLpCgY8wiYNi671+6XQHOR/x/cE70ISKQ5uwXm4Oejtubgj fwKD9FBAzqDv+h90007fSsu/eTgMzhQPprctbbUfKw8cOOEwVJ458Ig/oHqDbx8Rwwd19 sSzfw2nkKNnZkecI5JmRoFxOSCX91/8ThMiB1nVC+tEkxBlRMjQzXCG1choCeir43wH+V 7llWOC4AcelcFx0vvFksOksh5lsPHKRD9NxcaITNAV0sJH/Zkwruz0vvR4EJuQUv7J5WM AkJC7HKjnkYUgMbVMR+D/EmwBmTOJNQ1eaaG90Fmfttl+Lxf85cPGeppaF00rWTejDA== ARC-Authentication-Results: i=1; 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=mail header.b=p93rHBNT; arc=none smtp.remote-ip=148.251.105.195 Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) (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 A005B606A322; Sat, 5 Dec 2026 14:31:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A005B606A322 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 (2048-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=mail header.b=p93rHBNT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1796481062; bh=QJo6WmVVX4O63Kfw4U9OM8JhVL2p2o6BcXtwJb8Z/VY=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=p93rHBNTGRl2+/mQAKwKRTWRH7em6iJllvwY6sr7jzjf6FgaGxue60gSOxpsqoOBO 7WFUim962jE9FR+Y5I29fdFwMit++ZeIvdl2d0yIS8lsAzuG2y8iB04o9+OfzA6uNO q68THpjhM1O7wMs14KKmIS2in3r9t+lLvRMh2TuJyXtVwEG4o4xHfOZiYOQ88t//wL 0uoi+v198eozPUjzkovxJbAqmAVR2SClggpHC3jFdKPsuJ7MkKFTotv5mP8H6X11G8 oZSaXQ8+Uv0Fl8hsAJc+WPc2xXSDvpFZ2eBMVzr6tVvh03a05qyMcHK+Nxev5A5imE B2rMmB/0pTT5Q== Received: from [100.64.0.214] (unknown [100.64.0.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nicolas) by bali.collaboradmins.com (Postfix) with ESMTPSA id 289F117E0657; Sat, 05 Dec 2026 15:31:01 +0100 (CET) Message-ID: <9cc224286c886c263a3908a6db664c795e8c2bca.camel@collabora.com> Subject: Re: [PATCH v5 0/2] media: verisilicon: Fix VDPU2 decoder error handling From: Nicolas Dufresne To: aiyengar1990@gmail.com, Benjamin Gaignard , Philipp Zabel , Mauro Carvalho Chehab , Heiko Stuebner , Jonas Karlman , Boris Brezillon , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Date: Sat, 05 Dec 2026 09:30:58 -0500 In-Reply-To: <20261204-vdpu2-errreset-v5-0-ec5b097a5b0b@gmail.com> References: <20261204-vdpu2-errreset-v5-0-ec5b097a5b0b@gmail.com> Autocrypt: addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual; keydata=mDMEaCN2ixYJKwYBBAHaRw8BAQdAM0EHepTful3JOIzcPv6ekHOenE1u0vDG1gdHFrChD /e0J05pY29sYXMgRHVmcmVzbmUgPG5pY29sYXNAbmR1ZnJlc25lLmNhPoicBBMWCgBEAhsDBQsJCA cCAiICBhUKCQgLAgQWAgMBAh4HAheABQkJZfd1FiEE7w1SgRXEw8IaBG8S2UGUUSlgcvQFAmibrjo CGQEACgkQ2UGUUSlgcvQlQwD/RjpU1SZYcKG6pnfnQ8ivgtTkGDRUJ8gP3fK7+XUjRNIA/iXfhXMN abIWxO2oCXKf3TdD7aQ4070KO6zSxIcxgNQFtDFOaWNvbGFzIER1ZnJlc25lIDxuaWNvbGFzLmR1Z nJlc25lQGNvbGxhYm9yYS5jb20+iJkEExYKAEECGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4 AWIQTvDVKBFcTDwhoEbxLZQZRRKWBy9AUCaCyyxgUJCWX3dQAKCRDZQZRRKWBy9ARJAP96pFmLffZ smBUpkyVBfFAf+zq6BJt769R0al3kHvUKdgD9G7KAHuioxD2v6SX7idpIazjzx8b8rfzwTWyOQWHC AAS0LU5pY29sYXMgRHVmcmVzbmUgPG5pY29sYXMuZHVmcmVzbmVAZ21haWwuY29tPoiZBBMWCgBBF iEE7w1SgRXEw8IaBG8S2UGUUSlgcvQFAmibrGYCGwMFCQll93UFCwkIBwICIgIGFQoJCAsCBBYCAw ECHgcCF4AACgkQ2UGUUSlgcvRObgD/YnQjfi4+L8f4fI7p1pPMTwRTcaRdy6aqkKEmKsCArzQBAK8 bRLv9QjuqsE6oQZra/RB4widZPvphs78H0P6NmpIJ Organization: Collabora Canada Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-4qPktg0LNPymPSadV8Va" User-Agent: Evolution 3.62.1 (3.62.1-1.fc45) 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 --=-4qPktg0LNPymPSadV8Va Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Arun, Le vendredi 04 d=C3=A9cembre 2026 =C3=A0 06:34 +0000, Arun Iyengar via B4 R= elay a =C3=A9crit=C2=A0: > The VDPU2 decoder reports failed decodes as done, and after an error > its interrupt handler can finish a job while the decoder may still be > active. >=20 > Tested on Orange Pi 5 (RK3588S), v7.3-based KASAN kernel: > an MPEG-2 request with an all-zero payload raised the buffer empty > interrupt (status 0x41); the decoder was reset and the request failed > in 2-5 ms, with no IOMMU fault, interrupt storm or timeout. Decoder > timeouts over that run: 0, against 10 unpatched. 88 MPEG streams > decode identically to the unpatched kernel; MPEG-1 decoded three > times without a hang. > 5 bus errors, 5 timeouts and 3 buffer empty interrupts, injected by a > test-only patch, each reset the decoder once and ended the job; the > next decode was bit-exact. 1097 resets in error-stream stress, no > watchdog; VP8 61/61 and H.264 conformance unchanged. > Build-tested on media next. Buffer empty was only triggered with > MPEG-2. RK3399 and RK3568 untested. I'm not super crazy about attribution in general, but in this case attribution can help cross-referencing. The hantro driver suffers a lot of code duplication and inconsistencies between variants. I want us to work toward fixing this problem, and simply make the variant as boring and repetitive (without too much code duplication) as possible. Benjamin is pretty aligned with me on that front, we just both endup having little time, so I'm really happy you have some time. What you might have missed, something we know from Rockchip directly, the V(D/E)PU121 IP is an exact replica of the Hantro G1/H1 (its a modified licensed IP). Its built with different fuses, but more importantly, its register space has been compacted. It has pretty much the same behaviours and same flaws as everything G1. And these design reflects into G2, the VSI8000 combined cores (not yet upstream), the AV1 pre-release of VC9000 and even on VC9000 (also not yet upstream). There is no good reason other then us doing wild guessed for the large differences in their respective implementation. So in short, since this patch is reproducing the work I started in 19c286b755072, which I didn't understand the extend back then, it would be nice to cross reference it. It would also be nice to prepare the field so this IRQ implementing, including the G1 specific _RDY bit fix, can be checked to be consistant across all G1 variants. Missing VC9000/8000/G2 code to that can be challenging, I'm not asking for that, but the less we have copies of very similar thing, the easiest it is to keep them consistent. And it starts here, by cross referencing our work, to show we are converging to the same goal of cleaning up the driver. You might also want to jump on IRC (OFTC #linux-media) and ping Benjamin and I (ndufresne). We are always happy to test on IMX8MQ for original G1 and G2 common code. If needed, I'm also happy to resurrect my Tinker, an RK3288 board, also the original G1 codecs but with an IOMMU (it can catch faults unlike the imx8mq that corrupts itself silently). But I see 32bit CPU as going away in the MPU world, so I don't usually put too much effort on these. On that, thanks for you work, I'll be helping with reviews soon, feel free to help with other reviews related to the HW you know and run. If you can, maybe have a look at Francesco Saverio Pavone rkvdec series and comment. cheers, Nicolas > Developed with Claude (Anthropic), which wrote the code and the commit > messages. I reviewed every change. >=20 > Signed-off-by: Arun Iyengar > --- > Changes in v5: > - Patch 2: also reset and fail the job on buffer empty, dropping the > keep-job branch (v2) and the DEC_E read (v3): on buffer empty the core > does not reset itself and stays enabled waiting for stream a stateless > job cannot supply, so keeping the job leaves a running decoder that can > only end in a timeout (on RK3588 it read IOVA 0 into an IOMMU fault) > - Rebased on media next > - Link to v4: https://patch.msgid.link/20261126-vdpu2-errreset-v4-0-a955b= 1c8b119@gmail.com --=-4qPktg0LNPymPSadV8Va Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTvDVKBFcTDwhoEbxLZQZRRKWBy9AUCaxQgIwAKCRDZQZRRKWBy 9KJeAP9cPH5BSUXlF/gBfGHomIb0sLIjzmpK2rLu8YF/dEgacQD/YILmDzCRDJIf /x5WeB2VM5y69LuBpiVShAwl0yPesQE= =r79k -----END PGP SIGNATURE----- --=-4qPktg0LNPymPSadV8Va--