From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5DC9DCD6E4A for ; Sat, 30 May 2026 09:44:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=P6iwMu8Z0zknuAl+SsUJbJDyn+MP95MG12z4NTN45GE=; b=h1tW0yD8CIBl7K vAr+BIKCCWP0uXQgSzLtPcb3en11ECeKJefy6gvosjABfdRtElzQsfWb4rvollpKDRMjBi2CKuVFi JtuG1PyYOOaZACeWLT/UHp92WexgcfI/MUTBwDEAXaNxFBur+RyLYMm558vxGiaA7Tim00f1+i85b ADwNPMSI6QDuxOQ/yNtCeJRhjet2NOEqofrRtrmUO7UuhLF5WA8kbNsTzrN1JPbdyDcLVeMIapzgm tH4kIUdeQrCCd/nilTdu8E03FxRe4P5mZfj9PL2+crLAFLCrhcK1CMGaWdQhfLby/+D/BNx9Kc/Ve ljIPJDhL+hvMOJUPByww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wTGFK-00000008al8-49Rj; Sat, 30 May 2026 09:44:47 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wTGFI-00000008aiz-02ym for linux-amlogic@lists.infradead.org; Sat, 30 May 2026 09:44:45 +0000 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-2bf2e8ccca1so6943645ad.0 for ; Sat, 30 May 2026 02:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780134283; x=1780739083; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Je0r03zFWDk/tHsmcp50GPWfnKiSAfNBSvNM4tTawBM=; b=kEXJ4H5za0GMQQqdOtZ+qOtxni8UQP1wNIiN11wqo0Ui78palkK/hKDA/+1d2I9yuw eDNfGbOJWhd8O3DYB0LUgTJyFXakYnTDH/Lj1muKmuMDmUshEMxnrRV/iLMwZOcseWvu kz+d5JAv0wcoftOM9/DQHEe6UnGYksuufhAqRq1NdApnoX0H0sDeW5sfuuN+C9xzYtj6 Wv0j3D+GNcTodw3jP1cv4m0nTXVymXG5SXY6rCCBTRKzC+Kb/0E8m4PSvKS7gPDFtD3p D2R36NyPE2Asn5vCfpa/TgN2Uqbmw4BXxVbUO89m1KdtUicBjgLEzbWeuBni+Jw1FWV4 wNGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780134283; x=1780739083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Je0r03zFWDk/tHsmcp50GPWfnKiSAfNBSvNM4tTawBM=; b=jn+Gkw0QBKoMegE/sk8UVilodVIuiZcbnXyg8N8FcfKA8NiJh11T5SgeIMC7iY3VeT YPi9s0kNvICWW7xE9cpgqLcmbqLBJfVSUErVyASh6uLoIDAIEvSDZARMb6+mufzrVcWk 4EfQW5qqukdS1Bx7ox6kBfrr9Y37B0fel1t0FKxs4FP6KkNGIWjiRRbL6/v4NEoAz5MV BsTe4URl4NHp1phK+xukI0X/CPdvRCdRVs+41w6oO6Y4GQbvsd2mh3kilh1vBsY1ZqTi Z+y3WFdVJt1hcNVGKmUQVrFUUe+oMEBSRc27zMHuKbPMc0RnRTCJtEwY+NYdrbL3feVd 1v4w== X-Forwarded-Encrypted: i=1; AFNElJ+1TR9Rdaylya4U1Nz9gmukVhKpWoMBNVldwgTNTovtB4xQyKtU18fCEvscIEsKf00b6ZC5sVtEc+4tC2UE@lists.infradead.org X-Gm-Message-State: AOJu0YwkJNrFafACfdstgfcm1YtLdyC9YmiGdE9z6MIylNTUCTZn1yEa oo5YriJXDIqOHRaFS8DR825opPic9yVI/lky02+AuUNvrQd+FZSCG1Ms X-Gm-Gg: Acq92OEV0YKpzuoD4g5+eMhFeVpNMftXpiIrXt2gbJdyK5F07fq6b1JVUiIy9EKfEpp MYLXDMN682Rrc/bF+sDZ5RSYv241pd9rlil1apo3iYGv4iirphqwtN3JbEIpwN4Pt3SI2TCKwzF uxBNvZgmnfcFDXjgA+CoquqQMfWSKRLCQ5xBVZxj8qfj8VUqr80DLqg5tgOLwEOnmrMQg0U7DlJ 1UATHrQezS9RVhsysLGqTuCy7C3uKJt2MjNkv1iz4abfJjwM4OUmlGMqO5vr5ntGug2TKgRGuwA Yi6L0ABiE/9mr1qKo5rLPZR7VMwYgKorc8K/2nrPynAUfwSM9ojIEJhc3W0kQFuGNhjQpeRDcCs W78fUG25z1MODBRg9beJnq/wPJWHUY3uyHHNX0VEfu1k2EWOfzDw34h73+qlaf4huLQ3rt22Azy 5AKzTHOKRzdPcs9moNyRe+FdAJNbk/H3xVCZaZrSbuTg== X-Received: by 2002:a17:903:2450:b0:2bc:e2ed:fd03 with SMTP id d9443c01a7336-2bf368a3dabmr36524785ad.39.1780134283084; Sat, 30 May 2026 02:44:43 -0700 (PDT) Received: from rockpi-5b ([45.112.0.191]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bf239e700csm61529945ad.10.2026.05.30.02.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2026 02:44:42 -0700 (PDT) From: Anand Moon To: Neil Armstrong , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Mauro Carvalho Chehab , Greg Kroah-Hartman , Maxime Jourdan , Hans Verkuil , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-amlogic@lists.infradead.org (open list:DRM DRIVERS FOR AMLOGIC SOCS), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic Meson SoC support), linux-kernel@vger.kernel.org (open list), linux-media@vger.kernel.org (open list:MESON VIDEO DECODER DRIVER FOR AMLOGIC SOCS), linux-staging@lists.linux.dev (open list:STAGING SUBSYSTEM) Subject: [PATCH v6 4/8] media: meson: vdec: Condition buffer flushing on queue type in start_streaming Date: Sat, 30 May 2026 15:12:50 +0530 Message-ID: <20260530094326.11892-5-linux.amoon@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20260530094326.11892-1-linux.amoon@gmail.com> References: <20260530094326.11892-1-linux.amoon@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260530_024444_053930_B81DA025 X-CRM114-Status: GOOD ( 13.21 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sashiko , Nicolas Dufresne Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org When vdec_start_streaming() fails, the error path clears buffers from both the source and destination queues unconditionally. If one queue was already streaming successfully from a prior invocation, flushing its buffers behind its back leaves videobuf2 deadlocked waiting for completions. Fix this by only sweeping buffers from the specific queue type container that failed to initialize. Cc: Nicolas Dufresne Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260521090944.F35401F00A3D@smtp.kernel.org/ Fixes: 3e7f51bd9607 ("media: meson: add v4l2 m2m video decoder driver") Signed-off-by: Anand Moon --- drivers/staging/media/meson/vdec/vdec.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/meson/vdec/vdec.c b/drivers/staging/media/meson/vdec/vdec.c index 8a5bf1a96830..698a95566ad2 100644 --- a/drivers/staging/media/meson/vdec/vdec.c +++ b/drivers/staging/media/meson/vdec/vdec.c @@ -386,15 +386,15 @@ static int vdec_start_streaming(struct vb2_queue *q, unsigned int count) sess->status = STATUS_STOPPED; mutex_unlock(&core->lock); - while ((buf = v4l2_m2m_src_buf_remove(sess->m2m_ctx))) - v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); - while ((buf = v4l2_m2m_dst_buf_remove(sess->m2m_ctx))) - v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); - - if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) + if (q->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { sess->streamon_out = 0; - else + while ((buf = v4l2_m2m_src_buf_remove(sess->m2m_ctx))) + v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); + } else { sess->streamon_cap = 0; + while ((buf = v4l2_m2m_dst_buf_remove(sess->m2m_ctx))) + v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED); + } return ret; } -- 2.50.1 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic