From nobody Tue Feb 10 08:26:42 2026 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29B9D18EFED for ; Tue, 24 Dec 2024 07:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735025098; cv=none; b=h0bSBRrge8r2reslKCjcoU28CgJjlBtyUsuFKAxxFhdd7figt2ALVN+8v6IYVHhqjau4hA4o/jjugYvXsY87nAU72I7CI1bwmwRqcnX+kFR4DVrZglgESdwm+4HTv02FsTCQfLXeHRsK85VUj1vi4QFB/U7Yk7AOHKf/z+4i2Tw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735025098; c=relaxed/simple; bh=9cZLG5L2vkdEDHKnH31YZBkU40Mvvp2J/3ooo59x45Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c/XZgGF8Ll6boPOFju93Qdmdp3PyLDISajDInatgdhmXMrchBiIk51rDwWBGcwxgwEQRUeO8wGxq6CxNHb8mPmkWNRLzer/GE3kM18QUoM+53dOaOA+96Jk4rL5nNaOV0ss36p3Bw8tbGaS1ILnrDWuapJ6bVj4pqdM78c4e+S8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JB/iyRvo; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JB/iyRvo" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21636268e43so60169325ad.2 for ; Mon, 23 Dec 2024 23:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1735025096; x=1735629896; darn=vger.kernel.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=AE9nvfJslVj9qB/yCOxLUqgILFx3DJwfUeD0T7gDpl8=; b=JB/iyRvo9lcf0AJEefx2I49AOL80+IZ5EHaO8o+bsCBcOJvHOl2xdT/5KHUjWOOTT4 fs4KPmi1M1JvNuaN6PlPVZCIkOYPjBcVoMpRGsffS/3yBXIcbXxnPhKOnnVZO1wTSlVj boKUGTExYAd003Cgpg2d/D8Gj3gngY1dmRNKs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735025096; x=1735629896; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AE9nvfJslVj9qB/yCOxLUqgILFx3DJwfUeD0T7gDpl8=; b=xAJ/EukXIvTKedRNmTtNhzMYhJRwstMtCZYKswq4kY8wfrkGqbvabnxJJlSRcudOsx oyY68ELGPx2bPC5Wu87osWhbp5j9lxj+FiG0uA3IkgTXKx9WwnHiF19TOeL9kmLUxD5W EuFWHYI2fr1jwCREw1HpbG8iQJWu3R4YmkWB/X0QzN7KUrb5+w5W9dpFFEFWyTd8hh/i +C/ZUi+Jm9ro0nxn1pI/dNkKefGSQNfHkI4RkTMAjYfPowz8qra6DWKKjUdGn+PnBd5+ iFRXlHgOyJzCIiODlf7rPQAkXNpVFt7PO3bSpWT18EEeB1x6Q3ZpYi+wDZ4XuqAyDPbR /YSw== X-Forwarded-Encrypted: i=1; AJvYcCVGI7yZUExdpqauLKIDB7QBWM8kqgzwLEV0loj/mUct8cuubFtaohuFxsDI/xi7DzYwtXsvqA8AiSuaFsQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+ZuTMnM3HYFFYsAaMMRc2nGpvGQNJXtOpLu1TvUeO6LQ3erAc ubkgPrInVJhQfFqHHe6g8S01Foke4b30zCVgBz9fGEQSrg/eTK2M/aEsgkDgAA== X-Gm-Gg: ASbGncvgSBCR02qn085+H7U3mb4hN/HiJuGcox2h6QgpwnodMDe/sK9Sb1Iys3RI2/T XEOC9Z4sd+7J39chfhWSoB+AOZWQbe/v3oZuTqdzSZzGJa9zQjBHwpgGqI3JgwuqNGLh9FkQCT1 yg9uY9Yu7DsK62iiVw0d7Nl3aRFs4O8opJVyIWOFRpzRHgWksc8YxivJMJ9oHf1ilX212dnXtd2 vwnqz7MBcyuogyZgu6DAMGc+ZEgTFJsYiMhnjRwZkcx6y8VWkFnVmgkyUg= X-Google-Smtp-Source: AGHT+IHKoKTL2NIALRxLrphqegLKe8K7HSq2hikZhf5VhPOyutofWJK6Rrh5cMHHc0VdChmeAIfuLw== X-Received: by 2002:a17:902:ccc7:b0:215:94b0:9df4 with SMTP id d9443c01a7336-219e6f283aemr251758405ad.54.1735025096549; Mon, 23 Dec 2024 23:24:56 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:de21:da72:a349:25b2]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dca02b77sm84195355ad.242.2024.12.23.23.24.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Dec 2024 23:24:56 -0800 (PST) From: Sergey Senozhatsky To: Stanimir Varbanov , Vikash Garodia , "Bryan O'Donoghue" , Dmitry Baryshkov Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky , stable@vger.kernel.org, Nathan Hebert Subject: [PATCHv3 1/2] media: venus: destroy hfi session after m2m_ctx release Date: Tue, 24 Dec 2024 16:24:05 +0900 Message-ID: <20241224072444.2044956-2-senozhatsky@chromium.org> X-Mailer: git-send-email 2.47.1.613.gc27f4b7a9f-goog In-Reply-To: <20241224072444.2044956-1-senozhatsky@chromium.org> References: <20241224072444.2044956-1-senozhatsky@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This partially reverts commit that made hfi_session_destroy() the first step of vdec/venc close(). The reason being is a regression report when, supposedly, encode/decoder is closed with still active streaming (no ->stop_streaming() call before close()) and pending pkts, so isr_thread cannot find instance and fails to process those pending pkts. This was the idea behind the original patch - make it impossible to use instance under destruction, because this is racy, but apparently there are uses cases that depend on that unsafe pattern. Return to the old (unsafe) behaviour for the time being (until a better fix is found). Fixes: 45b1a1b348ec1 ("media: venus: sync with threaded IRQ during inst des= truction") Cc: stable@vger.kernel.org Reported-by: Nathan Hebert Signed-off-by: Sergey Senozhatsky --- drivers/media/platform/qcom/venus/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platf= orm/qcom/venus/core.c index 2d27c5167246..807487a1f536 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -506,18 +506,14 @@ static __maybe_unused int venus_runtime_suspend(struc= t device *dev) void venus_close_common(struct venus_inst *inst) { /* - * First, remove the inst from the ->instances list, so that - * to_instance() will return NULL. - */ - hfi_session_destroy(inst); - /* - * Second, make sure we don't have IRQ/IRQ-thread currently running + * Make sure we don't have IRQ/IRQ-thread currently running * or pending execution, which would race with the inst destruction. */ synchronize_irq(inst->core->irq); =20 v4l2_m2m_ctx_release(inst->m2m_ctx); v4l2_m2m_release(inst->m2m_dev); + hfi_session_destroy(inst); v4l2_fh_del(&inst->fh); v4l2_fh_exit(&inst->fh); v4l2_ctrl_handler_free(&inst->ctrl_handler); --=20 2.47.1.613.gc27f4b7a9f-goog