From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796202944; b=mSeMUQR8Vf8QmCrBJ7fZ8aXGBP/dwvhJ3/S4fxN4MhJsdWPcO89Hi9fahiRXQkWzV70B +ly3uij8e/yQ2hWU7on90jK02dtFl3eiTjV2am5oDENUtLaGukJ5DEMqf5HS2VrKi+oKI Dz8HEX/Th4Q+aXaPlR1Urr+Zl1qKAiusin8tn7026NIbVC6xUADCS1dV3BTcow90sz4F5 KB8UERY4D61f/9142QFNtSj33Ocyjg2QDBQuAPzFJDXezvzZAlgBHP+hflyvn+e/sLhkN RwjxRHKy85VuFpWJcJYqJ1iF+KuwlsS3p6WdMGtPsSA5vHSMqEpTkBfD80bRRQS5Rxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796202944; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:From:Subject:To:Cc:References: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-Proofpoint-Spam-Info:X-Authority-Analysis:X-Proofpoint-GUID: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=SjN96jSAsNxXE4cky/LMMl9Y0qpP3nBym5qITsfRQ9M=; b=broUMdheJznTwh1/whn10zDEo1Yt3StGf6ae6Wc6cpwInB+wTg7XsDDiNhfk4aqgn/RC NAD51LOyP88nxvtFOImiwrzVLHjR1zcLAkXXNr7/ZiIbaxAYyAbp8eOV0e1OmCrkOy4/0 YHw3W7Ce8fvzw39fCY8JhIKMIpmu/scRI1tKrF/Aa99+eu7J7AXrAC7M2O1dB9dKplWcK NnUTyNyqT+BDV5ODZmdPOY8gKkOjSvydKL0b+n2D8FygP0kTJb1/VyKR1UXN3A1ohp77P s0qz9+HQxBWGlblldK4bBWmsCklkfqSNAeXRKFvWjPc3qfGwKUhlHaaBuiwIlKBQfKQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Gj7YOQ27; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=VZo453Oe; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 BAFB5606A32F for ; Wed, 2 Dec 2026 09:15:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BAFB5606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Gj7YOQ27; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=VZo453Oe Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26oxVB267766 for ; Wed, 2 Dec 2026 09:15:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= SjN96jSAsNxXE4cky/LMMl9Y0qpP3nBym5qITsfRQ9M=; b=Gj7YOQ27zAojpVUE W5F1ijcqk0LhQEULyS7bt+dJTj+D/VQAlxxJb2KeiHP9oXbOLxqyLnoAMLhp/WTa DoJ7sy02gDxkDvBvTJOdvvYCWs44QMt/qnfivdB11nrjj4INSWlSKrFSKYUSIyeO q6p8Jnuje7tVgBdpJx3+rwFVPbIq23B9IAs0QQJOX0yXjtpkaUGAuvgDBkGHMLoZ A31aBfbY/pTGEtqWK0BaJyoaoswl3CGcIoclTbNbIeo5KyVTQOR9A9R/yF5jv1mc Rwjc7391Ljhji2dZJEM8gUIWI2eQTejIjhDws0aQd7glN0KhVtJwmJOvJfuK+3Mf 2qYMzA== Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja3ax368k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 09:15:43 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-139b62317d0so19095065c88.0 for ; Wed, 02 Dec 2026 01:15:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796202942; x=1796807742; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SjN96jSAsNxXE4cky/LMMl9Y0qpP3nBym5qITsfRQ9M=; b=VZo453Oe56hqkqp1kURT8ZkcH3d1zHa+H7QKJxPnNKECsilWPwq62z16jceVloVO9u DJ2FPQ9Ye1t1pYs5XykKuCIihm+aOB+mmDzUAB/7Dr7VXAnY77i/ZiKHfrZqs52T12V0 fk2Aer63SMj6oLkTpablyZpsz0eowjCgk4CBs2Gx3LYLHHA/VeuURpr8o3y/68ekpiH3 KVPw6oRNGj44eYl+c4c8utYS2UGnzkaED/rNg8IiClG/HebvObwUKaVzZCFm6HEqSbLE z8C/vz4E+Oa9gFqeJrjJS4SRyw4iDQibRTJOIP/qOvCtz9SGAMZ5OQaCi0ERuH1wrJof bptg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796202942; x=1796807742; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SjN96jSAsNxXE4cky/LMMl9Y0qpP3nBym5qITsfRQ9M=; b=ti2b1Q1mUxPTJJUs19wMvyWVbyYYmdrOYlrOJSmEI4BnIsB+Nch7CGaScg4U1hVrz8 Uyt7CksVRgE6iISCwx27LSWaZL/Y88lPDN0PHLIbwn/sWrzfFN2STfhWFtSSWilQ5RWx aBUBYBapaHarasfK9Ll4cFk/xdJCqoH/5RRa5mYz+jaCb7bhESBp5jIHvjDa2bNVIcQd 6rph1qjcXfVLEnNx2gW14BrWx5WwPhkAqLbWTLrQydaf+C9//uakbMUu8B1fxCkdsGue xCEDjhWBtB5jYQnBybrJcwNekQHDH7UEA0lDSh54omTWWXn2ffH8j3gPW8WjbwTd4+w0 imIQ== X-Forwarded-Encrypted: i=1; AL+hErGMdh741TTsb9bwSWujhJdTZQbEQ5uQCOGGgSX/rHuJpjInRF8cmpC1TlFYIgCTN+EJp9//tQk5R4RrpCc=@vger.kernel.org X-Gm-Message-State: APuU4Z8DqgQpvpHa3YCdOXlmPGs/H7kvCqc+kx96ByI3yUQx5VOvb/p8 wDrqL3YSQScCE5b7/HDLbDyMBKA3U3H28QzNJsMxHR/mdgL6MKNC9TtdMeeTiXjoIQGcg7dubK7 bbMCP8xsiEjWr7l0H9W+Gzp1oiayChnCcPLMsxBCJRPBYtJ4tU7QcXHR9jOiMC+HukwE= X-Gm-Gg: AZFdTZeKP+f4gqwQJUayD9qJq6GbHtMNsp0CRXBRcn5b83ZwXzHNNYWvbrF4MZSehvC uLWY8Z1euL1HyUZDTG+q44l69XXTXkqMwHpylrwrKBMzuwLGIdwCOw3oV/Y/0V3+yX8NaOxW1Y2 6Z1e7s0mdzW9LxqhyzDv+xYK0tl1b9FHlA3fKkfkYgXsbXbgzGE/lLcA0apeLhS1kKWH/OGX3FO K9khBkjRcCal4pS3NlkhLVx0tEu7GNSC1eQADMJleLNpFGkq1MpvWZf7T+Dmp/CSyh6z+qtxflN draTIyyiObwEKu1RaqiIZKYr+aWcHe80y0iIYYOQBuxhOj/aF7XnRbom/gSNUV9gSy3jUAu3mXz L+MR+ImNvZ09w2J/2lVSGHoypyamX1g7L6CujKPcwtiG5QkLcZY1SohBgUWq/8sNsvORWI6T5qA 5vPiY= X-Received: by 2002:a05:7022:4181:b0:1b0:4272:4282 with SMTP id a92af1059eb24-1b5568ba440mr58406919c88.17.1796202942418; Wed, 02 Dec 2026 01:15:42 -0800 (PST) X-Received: by 2002:a05:7022:4181:b0:1b0:4272:4282 with SMTP id a92af1059eb24-1b5568ba440mr58406879c88.17.1796202941721; Wed, 02 Dec 2026 01:15:41 -0800 (PST) Received: from [10.204.100.41] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5566c3052sm90377426c88.1.2026.12.02.01.15.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 01:15:41 -0800 (PST) Message-ID: Date: Wed, 2 Dec 2026 14:45:35 +0530 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 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 From: Vishnu Reddy Subject: Re: [PATCH v3 4/4] media: iris: Wake up blocked clients when the driver is removed To: bod@kernel.org Cc: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Hans Verkuil , Stefan Schmidt , Dmitry Baryshkov , Hungyu Lin , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan O'Donoghue , stable@vger.kernel.org References: <20261119-iris-handle-unbind-v3-0-52d467a13907@oss.qualcomm.com> <20261119-iris-handle-unbind-v3-4-52d467a13907@oss.qualcomm.com> <179604884531.1329975.8372974849481692297.b4-reply@b4> Content-Language: en-US In-Reply-To: <179604884531.1329975.8372974849481692297.b4-reply@b4> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAzNiBTYWx0ZWRfX81O54DmYBsAE MxRACOr6ZR5oFAEwXS6UHeLb1Rs/C9cKFs7GIAdfZvZP7mzH8LVGd7szJ04mewuu3LKQ4Rz8gb/ fBum98+24TxrVvSSDvnM04FHE67NbWA= X-Authority-Analysis: v=2.4 cv=J5s/fwnS c=1 sm=1 tr=0 ts=6b0fe1bf cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=LHJlEBQUgFoFxDsw9BsA:9 a=QEXdDO2ut3YA:10 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-GUID: Ae3zJILSll29CIOOa4-62A4dzBjHtSaF X-Proofpoint-ORIG-GUID: Ae3zJILSll29CIOOa4-62A4dzBjHtSaF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAzNiBTYWx0ZWRfX+KyhrsALmoRL Q4Zyjpe5xcuuZEMFm064XKGznxNRj7b6OMrC2NNyyA22d01GMQwDSCrE8zgGRF3cpy0P29pXA0B 6a9LQypTrpBJTI118114H8JgMPRGHTcARMgRt6lfSLg4i2nxdzUjchrQc8UK7SldejbryEcGT5U buv62puAK8AvYXliB0zwwC5eA2qy1cyhnY6BjakwmDYxnGBJQt7wrWq8sA+Qutn+pMoT1hwRy/B XKFh0B+4tGgpBbhxKNVKI0AENogZ5itgUOEbtwb64ZDp6WSkYRWhgmv7I1pCQMJRNdn7I//jiS4 Z6uyhf4/QUBupGUu4Qnv2zXbRsNhbjqTNxWDp2j9FWxqglmVugQpKKFg4dprmfCVZzTVjb54W/o GpdjHImf76VFDujD85+rH5Z0ID8cX07QDSdCSmMvaSB7Ni2gN+zRV8HPoUIeYqXQdvuMacSFLl3 fa9oZdwqhwANEsgsAuQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 bulkscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020036 On 11/30/2026 7:57 PM, bod@kernel.org wrote: > On 2026-11-19 17:15 +0530, Vishnu Reddy wrote: >> iris_remove() does not wake up a client that is blocked in >> VIDIOC_DQBUF or poll() on an open session. The client stays blocked and >> keeps its file descriptor open. >> >> Flag the vb2 queues of all open instances as errored after the core is >> shut down. This wakes up the blocked clients, which fail with an error >> and can close the file descriptor. Skip the instances that are already >> closing, as iris_close() releases their queues. >> >> Fixes: 38506cb7e8d2 ("media: iris: add platform driver for iris video device") >> Cc: stable@vger.kernel.org >> Signed-off-by: Vishnu Reddy >> --- >> drivers/media/platform/qcom/iris/iris_instance.h | 2 ++ >> drivers/media/platform/qcom/iris/iris_probe.c | 16 ++++++++++++++++ >> drivers/media/platform/qcom/iris/iris_vidc.c | 5 +++++ >> 3 files changed, 23 insertions(+) >> >> diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/drivers/media/platform/qcom/iris/iris_instance.h >> index 771269e705d9..cb84753e4f91 100644 >> --- a/drivers/media/platform/qcom/iris/iris_instance.h >> +++ b/drivers/media/platform/qcom/iris/iris_instance.h >> @@ -50,6 +50,7 @@ struct iris_hfi_session_ops; >> * @icc_data: structure of interconnect data >> * @m2m_dev: a reference to m2m device structure >> * @m2m_ctx: a reference to m2m context structure >> + * @closing: set on close, skips the queue error during removal >> * @sequence_cap: a sequence counter for capture queue >> * @sequence_out: a sequence counter for output queue >> * @tss: timestamp metadata >> @@ -98,6 +99,7 @@ struct iris_inst { >> struct icc_vote_data icc_data; >> struct v4l2_m2m_dev *m2m_dev; >> struct v4l2_m2m_ctx *m2m_ctx; >> + bool closing; > There's already a state variable, why do we need another flag ? inst->state can't be used here. It only moves to IRIS_INST_DEINIT after iris_session_close(), and by then v4l2_m2m_ctx_release() has already freed the m2m_ctx. If removal calls iris_vb2_queue_error() in that window, it races with the release and touches freed memory. DEINIT can't be set earlier, because iris_session_close() skips the firmware close on DEINIT. closing is set under core->lock before the release, so removal skips iris_vb2_queue_error() for that instance. > --- > bod > >