From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 84E18606A32F for ; Sat, 5 Dec 2026 06:51:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=u1CGJp5x; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Wah3Xr4u DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Unsubscribe-Post:List-Owner; bh=DStHvsdFhMhwJFitkhrh4rF6svz2i0ZcCqhQSS2YCqI=; b=u1CGJp5x5AS8kgE9+Np/h4/1Sj Q1QLL/oevr0GSPQrDrW8bLbh/8K84oujrZQ5sFON4Qbb6SVuwfj+73tnPyirVyCE93GaLuxMohe+2 dFisyfdlULRCKLQtY9eCfMSjzdacWYr1leZH9LYtKe8rFOuDOJqY3jy+b8IPSaQZ8gb7SIFSR8BYM gysTp2gUY7YNDsqcTvfdatsAH7DJsw+IHH2r+CkKgcZNPTQEUSs3P+333Cewmy91p2TyLNE1QhLKw Jrzco2myxNYFEQ6LZTO3Nq5cSjYkrKvk/esHn1XWXSxBzZcaa2czUWuKIRcjVHAu9Z1Z8z7lW2tml geq36Ybg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZjcJ-000000025Xj-3oIt; Sat, 05 Dec 2026 06:51:31 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZjcE-000000025VL-44Ln; Sat, 05 Dec 2026 06:51:27 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 69E6160A70; Sat, 5 Dec 2026 06:51:26 +0000 (UTC) Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796453486; b=Bkiw1T0w6fK0ZzpS7oXab7pYI6DsajbCstzv1O8dT/5XTWOo9YrDPJmQjTyysNP5HCNU oJHhwa/Vv+z5e2PjC9ohwj8jgE+JfJP3RIVAtP/qrnFYhlbcgFRwCs7STf446pGfxpctV 8QhMv3u25O74ImDKEAzzcT9MuY5t6xgvxNU/Nl0ncFLMWsGQPK4HmRAR+jwzxqXX6pRlp iH0qZa0q+vBBY8JOxn8ctxePFSSQlydXUje39qL+P4Sv24ybZVmoqd7z+skisJSM69NYh t+30xSEAym9inltcrBhro/bKIKdcnVUokPFURKpsYt1+yKwMcLuCreVfcQHlHG/WBvA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796453486; h=DKIM-Signature:Received:From:Subject:Date:Message-Id:MIME-Version: Content-Type:Content-Transfer-Encoding:X-B4-Tracking:X-Change-ID:To: Cc:X-Mailer:X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To; bh=DStHvsdFhMhwJFitkhrh4rF6svz2i0ZcCqhQSS2YCqI=; b=tSU5POfjYMWrcIJ4LjtsFpuP7KW90ZvTiNgfhMC60vKvzYzkkmEew7RcdtccraOAaQKJ lFk9LlwltAZJ3OToZpy3McnT5+GU/Ade4gwAQxGax5nlG/OANL9FE/p0ZqXxw8B1K8A/9 MZVcGaU7ooLzu17C7mxvSRB0dDI3kOLYMgXW/lJoBAZoOzpAr5X45JincEVBAvlQ5bBwF wcVeuJAgzjdc3EiMKQNTeFzSjSnHkp9lJwrIxWVu+LSL8K82UDQCDYNAf08DcuAppd0WJ VKibl9ETOCxnSWmaqio4oyLCJgvFlKFGGsDe1EsLj3zXYtimVA2TUAk65ZQiHDzAOBw== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (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.kernel.org (Postfix) with ESMTPS id 919DC1F00A07; Sat, 5 Dec 2026 06:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796453486; bh=DStHvsdFhMhwJFitkhrh4rF6svz2i0ZcCqhQSS2YCqI=; h=From:Subject:Date:To:Cc:Reply-To; b=Wah3Xr4uRB+0lo5N/nXq5P68ZVtqdCTxdg3wmmmVYihJaGyi912NNWrGG7fAQ5LOi /YArItDL7PACdg+3ClotrD2ONHpcAnX86bgh8q97MBETwFU8D6NEaE5y+HvD6zwToq a9AdOozgECKvY3yeZt/BJ0C0GrSO9ulnMyoUZ0qTZyZdzDGT+2Ah7g+UN98N9wp3By mWLVExRpheRw+2EykuWlAIW8rOBl6bbMBKy3Kj9lkiz47jqrOgKsR1tLQrCv8sYYEZ /bgDHcGsWHtY1/bVSNthbLcJDV5vOxt30hqCi9F/A/f/fC6UtdtKCNX/gCq98/BN3X R8t3oego9/Hyg== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 24F07501C6; Sat, 5 Dec 2026 06:51:25 +0000 (UTC) From: Arun Iyengar via B4 Relay Subject: [PATCH v6 0/2] media: verisilicon: Fix VDPU2 decoder error handling Date: Sat, 05 Dec 2026 06:51:23 +0000 Message-Id: <20261205-vdpu2-errreset-v6-0-efd43e527e33@gmail.com> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/2XPy2rDMBAF0F8JWldBr5HlrvofpQs9RolKEwfJE S3B/x45IdTYm4ELc+4wN1IwJyzkfXcjGWsqaTi3oN92xB/t+YA0hZaJYEJzzoHWcLkKijlnLDh So43pGJO9tJI0dMkY0++j8PPrmcvVfaMf55Z545jKOOS/x8XK571Xeb8ur5wyGk20ikmnrbQfh 5NNP3s/nMhcXsWCC7bhonETFUYA1AFxzeWS8w2XjbNOOkBwIWi15mrJ9Yarxm0P4Lg3rn235vD PBVMbDo2jB8f6zrbplnyapjuGK1h7ugEAAA== X-Change-ID: 20261115-vdpu2-errreset-8688700393a3 To: Nicolas Dufresne , 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, Arun Iyengar , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796453484; l=2923; i=aiyengar1990@gmail.com; s=20261110; h=from:subject:message-id; bh=0h4MqftdtYBNSK78RD6wet/Iw2915Q28UyGTaL+oyiU=; b=vuJ6jbaEuEF3EOOTh277mM2bn9ox3NHgQrsZBXSTU2w9T/mfDPz5l1dVfrgb5F8Dm2X3xTupe kPOmhku/yKOCFMWorXVMfQE26c6BcpdH1OkSMwjWU3smZN0ZkjnMlEG X-Developer-Key: i=aiyengar1990@gmail.com; a=ed25519; pk=zXpRgUTrhaFe6jLyPqbBy3ccfkj04w0g2690Wv3mg+0= X-Endpoint-Received: by B4 Relay for aiyengar1990@gmail.com/20261110 with auth_id=1480 X-Original-From: Arun Iyengar X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: aiyengar1990@gmail.com Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_REPLYTO_END_DIGIT,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. Tested on Orange Pi 5 (RK3588S, VPU121) with KASAN and lockdep: an MPEG-2 request with an all-zero payload, run twice, raised buffer empty; the handler reset the decoder, the request failed and the next one completed, with no IOMMU fault or timeout. 88 MPEG stream decodes are identical to the unpatched kernel. Two of the 88 are 16x16 and 32x32, below the driver's 48x48 minimum: their output was garbage before and is unchanged, and every frame now returns an error. 1300 + 186 error interrupts, no reset timeout. H.264 MR8_BT_B 25/25 and VP8 61/61 pass, JVT-AVC_V1 results are unchanged. Build-tested on media next. Buffer empty was hit with MPEG and H.264 streams; VP8 never raised it. RK3399 and RK3568 untested. Developed with Claude (Anthropic), which wrote the code and the commit messages. I reviewed every change. Signed-off-by: Arun Iyengar --- Changes in v6: - Patch 2: soft-reset only if DEC_E is still set, the bit G2 also tests; poll the reset bit every 1 us; log ASO errors; add Fixes (Sashiko) - Link to v5: https://patch.msgid.link/20261204-vdpu2-errreset-v5-0-ec5b097a5b0b@gmail.com 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-a955b1c8b119@gmail.com Changes in v4: - Patch 2: soft-reset the decoder after a bus, stream or ASO error or a timeout, before finishing the job (Nicolas) - Rebased on media next - Link to v3: https://patch.msgid.link/20261121-vdpu2-errreset-v3-0-073b5e5bdd64@gmail.com Changes in v3: - Patch 2: read DEC_E before clearing the status, as G2 does (Sashiko) - Link to v2: https://patch.msgid.link/20261120-vdpu2-errreset-v2-0-8f4ef55e6dee@gmail.com Changes in v2: - Patch 2: no reset after an error; handle the interrupt like the G2 handler instead (Nicolas) - Link to v1: https://patch.msgid.link/20261119-vdpu2-errreset-v1-0-f8fa403b6a3a@gmail.com --- Arun Iyengar (2): media: verisilicon: Don't report VDPU2 decoder errors as success media: verisilicon: Reset the VDPU2 decoder after an error .../media/platform/verisilicon/rockchip_vpu_hw.c | 39 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) --- base-commit: d99d0a5a82f54a169b45b81a5da8a0985008a205 change-id: 20261115-vdpu2-errreset-8688700393a3 Best regards, -- Arun Iyengar