From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 3F2B62D94BB for ; Wed, 28 Jan 2026 11:42:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769600538; cv=none; b=h2ZqQrdec+1biyQoBl2Th4XuBDvPTybZPn8yRKeAsTonLOW7lO+1t5DRSjSjC13sngtGCKH+DpyhSr5jdsmlzpyyFEMAD6t5SykcPKULCnBw2gWwwJ+VkeXK+e60Fy/y2Qs2dBMxLtxQzdow22O+pgrNEp7HsbiFDSWbcetQthc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769600538; c=relaxed/simple; bh=VfA0s8gV8RkY7oHs22Z4kLEl0M1QVhD3Ns4IJzqTX5Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=n5Qq1U6xbIhaaN/8fT11EcX2ltbEVlnrFWIw3JbgjnlQiS0SgT4UxyJgjeRhFOdWw1hNoJdmCACt+ABb01p+d7TDdsRnTK+YC0mCI+iULkBgUlID/PWxolt3rBZSwn6QjJvX6egyz5yj3eiUL936yk3fdKOP+ScBo3OOnnY4lok= 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=SFpt2mea; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ML1Fyr5q; arc=none smtp.client-ip=205.220.180.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="SFpt2mea"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ML1Fyr5q" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60S92EYN3387521 for ; Wed, 28 Jan 2026 11:42:16 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= EtONpyERsFg5XG0LRmElfUfk0cYlaAzd3AV5icgJLF8=; b=SFpt2meavqyBewK1 rAyrNDp8RAngA5SbbgaMaXE5/UCgd+2C6/ANY1sSxUiDTfp8/fnKtthrmCjPFMc0 xebObg2zBzpkyGHI0bZnSMX0e7TfCI2ULLVKkkcyS5773s2ckWyM0TNUek3W9oPP 1dno1UYqVJ87/tjFewJ4q/Yt/ABRLWTJDy9ddB4iaP0XxeTO5d1f3kXelCotsQ23 okwsdE0BcY1o7AxKYpGcnEbaLK0HkyfhOuDiGk1AgjdLIcrd6WgQEFgfKDyv+kVs 3R1grTScHoeOuwGHqgVQzCxjv8Q55OR4A16iuUPKBm/1QhxLzoLKiwadrZc0u0x7 2uHseA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4by1dfuatv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 28 Jan 2026 11:42:16 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c70c91c8b0so54714185a.2 for ; Wed, 28 Jan 2026 03:42:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769600535; x=1770205335; 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=EtONpyERsFg5XG0LRmElfUfk0cYlaAzd3AV5icgJLF8=; b=ML1Fyr5qlRnURES8zNUiec0Qa7WDSGzgqZSW1uZ3UpECTfsTiOwhy1QIIT+/SMYSBG 8d5wzpnDl7Bq5SxwK7SknoY+lXq9oIlRRmxkw/+GIUYZKp9X9jPD5dozrV/crKPWElPZ mTgLIROKp3CAZMFTaj2Rk7fFUX6L6QX0mkGgUphfgA05SAoHaeHJwPpg0N7eYFvzhmy7 Ov4obxijPP2Im4EBzfcStvZTYAYZQ68pAXt4LAIq2QU5dw2mTAgEW78TMyk/Dh8wcMrX kRYHcP+dL3AXfY/Sl0EVWVcdY9qLWmkq8GSYuWnJjRWDQqoSZGkAYRvTmypY5y0TAENs kx0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769600535; x=1770205335; 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=EtONpyERsFg5XG0LRmElfUfk0cYlaAzd3AV5icgJLF8=; b=Qzo6S5X6aXv9r7AL6HncuqWUh73qRyR4C9JdB+7tg6EegH36VPmnuYAMeozSw8Yybv 3X/hpU2tYq0egBOfDqd4nvCEXO8F5/Y577f0CP0wjevpXpxs/jkMO9Aqpi/xiC5MP84j ilrwxTv5USKvlTe0582oc1XcDKY9L0J/ZA0A08Jw1RuWlwGz0iaupAD8sPjJRbru8Uru VFZ5OpH5AO02B9tV4ySxg5UoZqoy77e5PTURVl/pblkOig8Fcw2K3tB+EHmMWFIyBe1P xK36XFSrxUNQuH3q14mKdPqmT2KEodmC4P0PAnCYm4WvkMBzHRp6jSfLRnigqFTw29Ns Y6oQ== X-Forwarded-Encrypted: i=1; AJvYcCXW4YomxryVSCIPugx1yk2mPWe01+XZLKAeZUnMXpjAEVD3j1FkB6O3Pvyd+Dn8tmtcVe8KYzZ/hQ3QW3Y=@vger.kernel.org X-Gm-Message-State: AOJu0YxCRUZenQyKxeJAGZ1ci07gqnwC2NYpoL/G6Y7MWppFoJB1AEa8 iQB2sLqRUUfuhoj2YuDQOQfZd5910VXOgu1vyffEftO/igRXLps5FvjcfUk6CpWmt4rxpoLNeDg OPalWwTL0CredkClaO+9vmjaU77sXqRNrxhHwq9gOZkLuc6WbsLkAo+QLEzzSvhBliL8= X-Gm-Gg: AZuq6aL/pX2HoavxnV1gA4xDDq+r1SIF+Xkk5Mdyja11c4J85xGxBiH1VUJjyVfHL4t yFjWWMamwZQ+gyv2cIaa+crdxGUdD+Y3OtMBtRWVmx3Sujq5ClvRRgMi6eZKefzmr+UXjvOVvTU smfqtiNA4yAGkFdTbTKNTOZz5EcPav9sUk+vZ8Ge5G6tR+FxUCPmNeppagpXKGosmF68WojA5+0 mCV0CjgRwoean9AEBqr8q5EJfXZSWJS1rOhHIuGgK/J40WIRpVUSoQKy4tI/PxJkkAwpiUcLvhE nPf5YgRTC9H0y/R66gvl/Ji6EOK2tRBuzwScJxurViM8kxM8hhNTwzDTV3JjGzd4KyjkbuJx3j2 YYiN8MZvDd5deoXLeGxD+Lnj0Fha+d7xHSFZknjmrazlS21cSp0C8JbdDNmGM4N5O0Jw= X-Received: by 2002:a05:620a:4723:b0:89f:5a1b:1ec9 with SMTP id af79cd13be357-8c714b4467emr135281085a.1.1769600535521; Wed, 28 Jan 2026 03:42:15 -0800 (PST) X-Received: by 2002:a05:620a:4723:b0:89f:5a1b:1ec9 with SMTP id af79cd13be357-8c714b4467emr135279185a.1.1769600534976; Wed, 28 Jan 2026 03:42:14 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8dbefc56e8sm115534966b.15.2026.01.28.03.42.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jan 2026 03:42:14 -0800 (PST) Message-ID: <99aa1a81-e64d-4ea8-b69d-3ce08b9994a3@oss.qualcomm.com> Date: Wed, 28 Jan 2026 12:42:12 +0100 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] regulator: qcom-rpmh: Add support for regulator-off-on-delay-us To: Saikiran B Cc: broonie@kernel.org, lgirdwood@gmail.com, andersson@kernel.org, konrad.dybcio@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260127173736.82976-1-bjsaikiran@gmail.com> <663cfee5-ea40-4990-9391-3b12d9279cea@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI4MDA5NSBTYWx0ZWRfX0PI9NTq4Znd1 8zj+YSwYcxbCAHPDoP02iK9U1kApl4mEkJLzbYLYgdVwPZzOuKKI4fwJKwEMy5khUSfvLb1Uh+i Mt0FsOCutmJLs0FYSYOPIIxVmCmjclg+eEeoXO85tcqJJSbzsJRHAM9/nSW/tu3LyOSK/ZR1NDv 8JEMXmHvwEKE9PYy0VUaCny1PKbWwWhjiYlfZIlWanJQIaxVqRJVYJhc1D3xnvHmH62GIcKsgk0 1U5DWJOZbPCAqJUFvcRf/9aAhbEIGYd+gAJliwbWwhD6ByqTXRInmbghqRAkmliKpm1VC7lgsyj Ztl/qUoi8YCxvgwl5U52aYox9tVD2SM+PRso7YIwkU6A8dXr36spCdyQx4EjBD0z/ahvF2GrkfB mCapDB7k+wY9vnIhjTc8HF7d7ujzt6ZWfT8xtLZkVYFno1CycS1qzl7Hk/ljn5XuYRbqTLgLQIt Ynif1j+pVVir1R/Vfiw== X-Proofpoint-GUID: 1pgMoEgApb4Ul7v3MW9HnVy0HT5JrL0O X-Proofpoint-ORIG-GUID: 1pgMoEgApb4Ul7v3MW9HnVy0HT5JrL0O X-Authority-Analysis: v=2.4 cv=YeuwJgRf c=1 sm=1 tr=0 ts=6979f618 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=pGLkceISAAAA:8 a=5vDLdzdhuu4WptbGUvsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-28_02,2026-01-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 bulkscore=0 adultscore=0 priorityscore=1501 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601280095 On 1/28/26 12:34 PM, Saikiran B wrote: > On Wed, Jan 28, 2026 at 4:00 PM Konrad Dybcio > wrote: >> >> On 1/27/26 6:37 PM, Saikiran wrote: >>> The core regulator framework supports enforcing a physical off-time via >>> standard properties, but the `qcom-rpmh-regulator` driver currently ignores >>> them. This prevents boards with slow-discharging rails from enforcing safe >>> power-cycling constraints. >>> >>> On the Lenovo Yoga Slim 7x (Snapdragon X Elite), certain camera regulators >>> rely on passive discharge and require a significant off-time to drop below >>> brownout thresholds. Without this driver support, we cannot enforce this >>> constraint via Device Tree, leading to sensor initialization failures during >>> rapid power cycling. >>> >>> Add support for parsing the `regulator-off-on-delay-us` property from >>> the device tree. >>> >>> I have tested this on the Yoga Slim 7x. When the delay property is present >>> in the device tree, the regulator core correctly blocks re-enable calls >>> until the delay passes, fixing the camera brownout issues. >>> >>> Signed-off-by: Saikiran >>> --- >>> drivers/regulator/qcom-rpmh-regulator.c | 3 +++ >>> 1 file changed, 3 insertions(+) >>> >>> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c >>> index 6e4cb2871fca..aafba61551b3 100644 >>> --- a/drivers/regulator/qcom-rpmh-regulator.c >>> +++ b/drivers/regulator/qcom-rpmh-regulator.c >>> @@ -503,6 +503,9 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev, >>> vreg->always_wait_for_ack = of_property_read_bool(node, >>> "qcom,always-wait-for-ack"); >>> >>> + of_property_read_u32(node, "regulator-off-on-delay-us", >>> + &vreg->rdesc.off_on_delay); >> >> Would it not be a better fit for of_regulator.c? >> >> Konrad > > Hi Konrad, > > On Tue, Jan 27, 2026 at 4:00 PM Konrad Dybcio wrote: >> Would it not be a better fit for of_regulator.c? > > That was my initial thought as well, but there is a limitation: > > The `off_on_delay` field resides in `struct regulator_desc`. For most > regulator drivers, this structure is `static const` (immutable) as it describes > fixed silicon characteristics. Generic parsing code in `of_regulator.c` > cannot blindly write to `desc->off_on_delay` without risking a write to > read-only memory. > > The `qcom-rpmh-regulator` driver is unique in that it allocates > `vreg->rdesc` dynamically at runtime, which allows us to safely populate > this field from DT. > > To support this generically in `of_regulator.c`, we would likely need to > introduce `off_on_delay` into `struct regulator_constraints` instead, > and then update the core regulator handling to check both sources. > > I opted for this driver-specific approach to minimize impact on the core > subsystem, given that `qcom-rpmh` is already set up to handle dynamic > descriptors. > > Let me know if you would prefer I attempt the core framework change instead. I'm a fly-by reviewer for this sort of thing (as you can see by me not knowing this reasoning..) Mark (the maintainer) should be able to give you a more insightful answer Konrad