From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ADEA356A31 for ; Mon, 12 Jan 2026 11:50:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768218646; cv=none; b=heNL/GBidNJHoljXUuobSlNBzKWBgkvES+ydjn7LfNWo7rKZYf8BSLxrfLzZf8viBVr3L8ZLrkORlWxrFMW++iB7F+dqH7R2smRv0WdZGGKeByXO63jUTl0FlEsfTP0kktVAqYoIUI1mb3KNdOUHNYz2dPCIayeSZSK8D10ZT/4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768218646; c=relaxed/simple; bh=fD0VasFyz17RMZAtNf0dob/9XEoH5FERv1VGRi8KVzs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=EqagxPe8H1hL14Jje7LKpMLYYviu7iNJ/8bUvDFbjBz4ZNE9HkImaRxDZctNUH+ENnZNFa4+IWRvvay+bny7/5t48V70g1bw22mE4uHA2WPK5S63UDQDbhkxdRoZUl0FsybN1orIC6PnXoiIeKXM/KXRoVOn6I8rVO8OUUMPOlI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=NUmX7dkO; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=g/PTRg0Y; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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.b="NUmX7dkO"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="g/PTRg0Y" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60CB5fce2822278 for ; Mon, 12 Jan 2026 11:50:44 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= JAaB59HhwqZUd77zPo5+uCl4TMQPko/1bghunuekK1Y=; b=NUmX7dkOWaMqNX/C z0USQhCeo+fpGpAJuOAg8e1zHCm5h8LHHY6n8VlkSJ+gnUjdV5tdgxP6HNFMp0GU PJArZNCruwkCVvVT7XHB2HFgt4VmYek4XrgWvEG5YFfsa39G3RUF42sXj4wockQn rAiBcQwQbMv6r35Wd/CL8DNlHWiTJF/UF7rltKIgUQQGxAiCbSG8deJj7jgah12B YAHOUxrHn0T+ET4AJ+9DYqL9PZDOKefn5XFamtTROB6QKkkgqEIgibRjDxiotyLo 6DBUY8FynrWOEwzTaDIotJQ3k6B7dW2SP0u4V1MUADuPj1gHGH1zTxpc3Utq5ovE mxxI4A== Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bmysag3pw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 12 Jan 2026 11:50:44 +0000 (GMT) Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-4ed74ab4172so154752321cf.1 for ; Mon, 12 Jan 2026 03:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768218644; x=1768823444; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JAaB59HhwqZUd77zPo5+uCl4TMQPko/1bghunuekK1Y=; b=g/PTRg0YhdDwbNM+Tqig0ZsxKA6xJ5zrVJjPLqwFz5FzgGOFTM5wr29WnQBCKfSR/u Xgi+9uu9XW0B+qUAlcD/rTl4adxWkn4O7IJBI3j6J11JAhUXQ1op7AeQsrLCuS4MLNPk vPZbq40eOCEevIuqV5qSiBJFv4r8f8OX70fvUxPcl9OcJYwRI3FXfJ+FA8Z6pKjc5594 /aRiRfDRZH6WFGbX6bBjkmImWrLNX7eb+UFBSg9DR+wXQaj8az6VnfI2zYbqePIsIH0H Hu9P8+d4FUNGBJpmAdqplCf1J51tDGXIZCgflmU7bIeHHQaIOQMl2m9GtgFIybMHd7rF GWfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768218644; x=1768823444; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JAaB59HhwqZUd77zPo5+uCl4TMQPko/1bghunuekK1Y=; b=d++4VLdYVr9UVoMl7DoQvQt/1K2XwZpEIVlOCXpU9Tq/wuF7JYupJ5GmbUOg7lTpQn LE/MkSDShgjR0dvaHvgVLljHn+KMfqskW41aaAJ1LfQ6hp4O6SG+xQNV6PwAycLAodzj uTIHSndfl4Fvgxr8L4PzF/F3OWp/zElR8YNPa9qtrluFKO9D5DFUO2dLIp99bLoSB8UE 5lEZOcaGY29DJxrRkHFzGKliEgAtBjkgeW0NiGdiHr+x0IfFmPlowoUuL0NhUXdxSUWQ o84La9nlpO4P9t1/XyrGqKh+Dey+jgMWLH8MZecHL4GmQKuBGg3uzRnmILSd3ivH4rM3 ARtg== X-Forwarded-Encrypted: i=1; AJvYcCUNY/7hHkVJYuZXU4AitIY52pv+t73izWmOFfeSbmsjOZnagl/Oy6RDuHEoZ8g8JZJ4ctzV7+9xAbxUmSU=@vger.kernel.org X-Gm-Message-State: AOJu0YwbQR0duha352HJxNTXDUGg9K9WLNt70MHRLMBYMr9EglxcOkVj S9h8blE0juFmsD9c5MpFoNd6T3EAcLM3ngkdjd6ok2FcREQ0rrqElBuUY4OJ6Dz56txziZXZzrY nV8tsAS2vYTTVhknBMYyarcMzwgQn5UnHt7fb5W7EQ+1S+S0SUAkAfK551b6kXwK1Bk4= X-Gm-Gg: AY/fxX5jcmmNAbfsqAbYvWF7h641siW87T7SgSdarrBBqYkFhMSdthr4XrX9NZQufI9 9M1SLJU3TYnS7TweG9iPM3zG7vhs0b9x9N4vaEgdiCdWjv/iwp1MKeogGlv16d4QUzVMKLyRDsk f058H0uQtFoX2GaN4YYBm6sXacvtURdIQPzdZ9Ln/O3O3aOIoSL5/GpaFUU9uouVXBz3NWRP+0Q sJTIRPx1nXxXy0uTkUHsUIiVOaFpiJcqFxvjmgS+/fHBg4+Djmb5Ra4S5SGgKTgMzDTRKycTl6m yLswAyMxM50NiXtSyn/h09YqEWy82l3aPD0P8y1RU5nfTexRfCsm+ZB1UWG4wBS1EkVII09GCv3 46Qyp/m9YR9oJA4RJRXe6FwOHP0oY/mqcT53+UwsWDZ7Uwz7movdQSIq8k4wfEn502CdZxIc= X-Received: by 2002:a05:622a:1a94:b0:4ec:f2e1:483 with SMTP id d75a77b69052e-4ffb495b32fmr240901661cf.26.1768218643682; Mon, 12 Jan 2026 03:50:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZ7vaqV3WTOysb6dkr9ldig/Cbe79ZpkSXK4D50nP/VMWg4u1+R/eaUqeyPwQyfFduFXH3uw== X-Received: by 2002:a05:622a:1a94:b0:4ec:f2e1:483 with SMTP id d75a77b69052e-4ffb495b32fmr240901491cf.26.1768218643226; Mon, 12 Jan 2026 03:50:43 -0800 (PST) Received: from [10.38.241.92] (Global_NAT1_IAD_FW.qualcomm.com. [129.46.232.65]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89077235411sm142247056d6.29.2026.01.12.03.50.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Jan 2026 03:50:42 -0800 (PST) Message-ID: <828597fc-ec02-488c-99e9-418a7ff266d3@oss.qualcomm.com> Date: Mon, 12 Jan 2026 19:50:38 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] media: i2c: imx412: wait for NVM read (T7) before programming mode registers To: Bryan O'Donoghue , Sakari Ailus Cc: mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260109044913.3310-1-wenmeng.liu@oss.qualcomm.com> <1344ad43-a4c4-4e37-ae4e-eddd2c577b3f@oss.qualcomm.com> <468ce093-7704-4497-a538-c54baacbd8ae@oss.qualcomm.com> Content-Language: en-US From: Wenmeng Liu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Authority-Analysis: v=2.4 cv=auO/yCZV c=1 sm=1 tr=0 ts=6964e014 cx=c_pps a=WeENfcodrlLV9YRTxbY/uA==:117 a=C3Dk8TwHQYyIj7nOf9RCJw==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=9SyD2Jwyq_Eki1JmFGgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=kacYvNCVWA4VmyqE58fU:22 X-Proofpoint-GUID: 7Is7sbIgvm8sAfC8YogYmtNg9hnboDJ0 X-Proofpoint-ORIG-GUID: 7Is7sbIgvm8sAfC8YogYmtNg9hnboDJ0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTEyMDA5NSBTYWx0ZWRfX4TuF4PWSXyAT T8ZvmTufYxLJDPwVFk4JH1tZU+icR3O2Mzw0nNLqj1mHdpJYBkSo0y219wOTq4vVHH6OM1adyG3 FpCn3UI5DnyzzqtBHQhrVtNf1mlRYdiDtEnVCnsVRB+ThdRWeWwUcSh6jUmdhPG9s+y3F0TkJYF OQ1HTGb8gwLFC32TgN0UUIp0Zp96QzTBF/wSTLNAtPIOZCkZraLwfDJEC9FoG7zeoyYYhUBD2G5 VhMKHOH2zG9g1jWRv08rOupc8yw5MdJyZLjI/DyzVJm27kUSf0ZwU7mA3Jl0IAX1gP2EoGaLDf+ ew+GC569xshMt/eciJvdZfFYbsq2b4AuKks0nVFhTYXB776k46D44srC5jpKvrdW1ex2owSreJ/ A2cmw6qorCJ3hZe8vQfuSGGd+vabIV7AzDizSj+dywu+k8TMwHsoJ7/LbTkrnM7mkZLhfU7nX4A p1RvXdlhYChcT2lUovA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-12_03,2026-01-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601120095 On 1/12/2026 6:21 PM, Bryan O'Donoghue wrote: > On 12/01/2026 10:09, Wenmeng Liu wrote: >>>>> This delay should go at the end of the operation that requires the >>>>> delay >>>>> not at the start of the streaming operation. >>> I would have thought that, too, but I understand there's an issue >>> with an >>> Arducam module. It's also not exactly clear to me if all other registers >>> are writable at the sensor identification time or is the required delay >>> only concerning starting streaming (I'd hope so). >>> >> Hi Sakari, >> >> I tried adding a read ID at the end of power_on func and found that it >> could only read the ID during probe; subsequent attempts during stream >> on would fail to read every power on read. >> >> [   11.298460] imx412 2-001a: read reg chip id: 577 >> [   11.310703] imx412 2-001a: read reg chip id: 577 >> [   35.392396] imx412 2-001a: read reg failed ret = -5 >> [   39.583990] imx412 2-001a: read reg failed ret = -5 > > This "smell wrong" points to the power_on() sequence not being correct. > > You should be able to read the identity register at the end of > power_on() every single time, if not, power_on - isn't working. > > > You should be able to put exactly the same delay into power_on() and > have the same result as having no delay in power_on() instead having it > in start_streaming(). > > Are you sure something else isn't happening - a reset line, pm_runtime .. ? > > I think either power_off() is happening without you knowing it or more > likely the reset line logic in the power_on() sequence isn't correct, > which is why detecting the chip then fails. -- if disable gpiod_set_value_cansleep(imx412->reset_gpio, 1); form imx412_power_off, the issue will not happen. Through this analysis, the issue was ultimately identified as the Arducam IMX577 sensor module requiring a relatively long wait time after the reset pin is pulled high. The reason why the ID can be read successfully the first time is that the GPIO’s default state is not output low. Therefore, to fix this problem, it is necessary to increase the delay time in the power_on sequence. > In fact, looking at the power_on() sequence, I'd say we should have put > reset 1, switched on power, and clock and then taken the part out of reset. I tried this, but it didn't work at all. Thanks, Wenmeng