Message ID | 20230217142030.16012-5-quic_devipriy@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp913643wrn; Fri, 17 Feb 2023 06:24:22 -0800 (PST) X-Google-Smtp-Source: AK7set9IRCcl9Z/v/N7xO+CSXSI1p+bSoa3qInOwjVqV8lXTpXZmfmJkHKRs4pSV/r2jSEOTEEef X-Received: by 2002:a05:6a20:d019:b0:b7:4f67:c2de with SMTP id hu25-20020a056a20d01900b000b74f67c2demr931306pzb.40.1676643861878; Fri, 17 Feb 2023 06:24:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676643861; cv=none; d=google.com; s=arc-20160816; b=SiyatpJsOZJzFI/c7xm6ZMu7VRY8ONXMZRH5x1ZXz7gyq1A+bcHtwvq6RF6qCHaIAJ WSnF3Jc1Xqs5z5ZHf0rr9wjMfUWPwrk/I/buiV3RQS8Q9vnjXsBdN4LqcG0rdUAcg1OA Rol4gp1PeRyM/vX5+64DunEu1ReO4Tgcoo1o/zhisMyu/Cn5CvHcIvyXhWUgXr8PSVPw +Ia4lkrLE8vAsB5+jTaRrebaxw6dvWBsFZTkgUaNdcz4S6fVrbhg3WFpSnvNXgn/TqDS DDbQb/+XzMm1djEfpt5CtNDB2Gp8Z2OhcBJRRZiwyRR/9T3vXkr65pr8Q2PI1opgwZtw snDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pEgnXSOuQtNq1e1QdA9XjfC/+JH3Look3Up+AUbAB2U=; b=Z0PwWgArGpuLlFtxQwvB0oeYQ5e35UbCLlk95gTTHi7Fs0mHSzQQGK7K8zW7hVF5uO DW2AGyh9gYgV6FOuXqPlu+OO26lcYha3G7qFFFL1pJSgG/5iA7KVjdbLIDVMHx+pRtyd jx4tkD5G4NFe6KUOGFt4AGxfAPFa2O2f9zrAit0nB/l3Gmy0qLAWnMwcnl7XxKY281kG YXbePHbiiZl7xL4QZtJ1nZyWoXj8P10QM1oN0ZEVdt8U3LNi+ITIdhosY6e6pdg096Xb oBIrRg1W8+CW3eje4CyvRn9Nl57OPFYDy/6/csV6XzXRQ+qmXPLzCkaFlMhbsHJE1STI sCig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=A+E6DgNt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b004ff6eee716csi269957pge.398.2023.02.17.06.24.08; Fri, 17 Feb 2023 06:24:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=A+E6DgNt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229829AbjBQOVg (ORCPT <rfc822;aimixsaka@gmail.com> + 99 others); Fri, 17 Feb 2023 09:21:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjBQOVf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 17 Feb 2023 09:21:35 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA3B6D78F; Fri, 17 Feb 2023 06:21:16 -0800 (PST) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31HCh5IT007130; Fri, 17 Feb 2023 14:21:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=pEgnXSOuQtNq1e1QdA9XjfC/+JH3Look3Up+AUbAB2U=; b=A+E6DgNtIofCifWxnI5UhUW2FFcZMnjL0o0Mj9Zdy+BxAogOThhvkSk2W3mQrJPPLIlt 4CQ6flXZwRWs5dBidiDiexakyksnkZSpKR9zn6koy6D1flVf6isHx0EI9CqdvI3gy/3B 6nFZ6HFPB5dyRdOpM71kEGQ49eqgoPATES4TOExVGkY6L8RlaXVTOC25Ph4mwAHd8+T7 4kvjO/gUuxTODTySaKgzYMrc0trOwNYp1z7+f64m2x0iDSwglfizdfpmvgjJjt2sYIaX VOoeEOVYKsVeG/8bMc7fAsavLw0Cbe0JDRwpdX03x2r2QW3zsX0AiHsOUeNZLoQrT3OK ew== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nt6x4gk2y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 14:21:13 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31HELC1G016495 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 14:21:12 GMT Received: from devipriy-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 17 Feb 2023 06:21:06 -0800 From: Devi Priya <quic_devipriy@quicinc.com> To: <agross@kernel.org>, <andersson@kernel.org>, <konrad.dybcio@linaro.org>, <lgirdwood@gmail.com>, <broonie@kernel.org>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org> CC: <quic_srichara@quicinc.com>, <quic_gokulsri@quicinc.com>, <quic_sjaganat@quicinc.com>, <quic_kathirav@quicinc.com>, <quic_arajkuma@quicinc.com>, <quic_anusha@quicinc.com>, <quic_ipkumar@quicinc.com> Subject: [PATCH V2 4/6] regulator: qcom_smd: Add support to define the bootup voltage Date: Fri, 17 Feb 2023 19:50:28 +0530 Message-ID: <20230217142030.16012-5-quic_devipriy@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230217142030.16012-1-quic_devipriy@quicinc.com> References: <20230217142030.16012-1-quic_devipriy@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: YEMFytLkcXna97A2s7soBw90a_vnxzlX X-Proofpoint-ORIG-GUID: YEMFytLkcXna97A2s7soBw90a_vnxzlX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-17_09,2023-02-17_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 phishscore=0 malwarescore=0 adultscore=0 mlxlogscore=926 priorityscore=1501 impostorscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302170130 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758088514056003172?= X-GMAIL-MSGID: =?utf-8?q?1758088514056003172?= |
Series |
Add regulator support for IPQ9574 SoC
|
|
Commit Message
Devi Priya
Feb. 17, 2023, 2:20 p.m. UTC
Kernel does not know the initial voltage set by the bootloaders. During regulator registration, the voltage variable is just declared and it is zero. Based on that, the regulator framework considers current the voltage as zero and tries to bring up each regulator to minimum the supported voltage. This introduces a dip in the voltage during kernel boot and gets stabilized once the voltage scaling comes into picture. To avoid the voltage dip, adding support to define the bootup voltage set by the boodloaders and based on it, regulator framework understands that proper voltage is already set Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com> Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> Signed-off-by: Devi Priya <quic_devipriy@quicinc.com> --- Changes in V2: - Added the bootup voltages to s2 and l2 regulators drivers/regulator/qcom_smd-regulator.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Comments
On 17.02.2023 15:20, Devi Priya wrote: > Kernel does not know the initial voltage set by the bootloaders. > During regulator registration, the voltage variable is just declared > and it is zero. Based on that, the regulator framework considers current > the voltage as zero and tries to bring up each regulator to minimum > the supported voltage. > > This introduces a dip in the voltage during kernel boot and gets > stabilized once the voltage scaling comes into picture. > > To avoid the voltage dip, adding support to define the > bootup voltage set by the boodloaders and based on it, regulator > framework understands that proper voltage is already set > > Co-developed-by: Praveenkumar I <quic_ipkumar@quicinc.com> > Signed-off-by: Praveenkumar I <quic_ipkumar@quicinc.com> > Signed-off-by: Devi Priya <quic_devipriy@quicinc.com> > --- Thinking about it again, this seems like something that could be generalized and introduced into regulator core.. Hardcoding this will not end well.. Not to mention it'll affect all mp5496-using boards that are already upstream. WDYT about regulator-init-microvolts Mark? Konrad > Changes in V2: > - Added the bootup voltages to s2 and l2 regulators > > drivers/regulator/qcom_smd-regulator.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c > index a40e66cea7e7..5f9fe6b9d368 100644 > --- a/drivers/regulator/qcom_smd-regulator.c > +++ b/drivers/regulator/qcom_smd-regulator.c > @@ -800,12 +800,13 @@ struct rpm_regulator_data { > u32 id; > const struct regulator_desc *desc; > const char *supply; > + int boot_uV; /* To store the bootup voltage set by bootloaders */ > }; > > static const struct rpm_regulator_data rpm_mp5496_regulators[] = { > - { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1" }, > - { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" }, > - { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" }, > + { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1", 875000 }, > + { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2", 875000 }, > + { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2", 2950000 }, > {} > }; > > @@ -1388,6 +1389,9 @@ static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev > vreg->type = rpm_data->type; > vreg->id = rpm_data->id; > > + if (rpm_data->boot_uV) > + vreg->uV = rpm_data->boot_uV; > + > memcpy(&vreg->desc, rpm_data->desc, sizeof(vreg->desc)); > vreg->desc.name = rpm_data->name; > vreg->desc.supply_name = rpm_data->supply;
On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: > Thinking about it again, this seems like something that could be > generalized and introduced into regulator core.. Hardcoding this > will not end well.. Not to mention it'll affect all mp5496-using > boards that are already upstream. > WDYT about regulator-init-microvolts Mark? The overwhelming majority of devices that have variable voltages support readback, these Qualcomm firmware devices are pretty much unique in this regard. We don't want a general property to set a specific voltage since normally we should be using the constraints and don't normally need to adjust things immediately since we can tell what the current voltage is. This is pretty much just going to be a device specific bodge, ideally something that does know what the voltage is would be able to tell us at runtime but if that's not possible then there's no good options. If the initial voltage might vary based on board then a device specific DT property might be less terrible, if it's determined by the regulator the current code seems fine. Or just leave the current behavour, if the constraints are accurate then hopefully a temporary dip in voltage is just inelegant rather than an issue. Indeed the current behaviour might well save power if you've got a voltage range configured and nothing actually ever gets round to setting the voltage (which is depressingly common, people seem keen on setting voltage ranges even when the voltage is never varied in practice).
On 2/23/2023 4:31 AM, Mark Brown wrote: > On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: > >> Thinking about it again, this seems like something that could be >> generalized and introduced into regulator core.. Hardcoding this >> will not end well.. Not to mention it'll affect all mp5496-using >> boards that are already upstream. > >> WDYT about regulator-init-microvolts Mark? > > The overwhelming majority of devices that have variable voltages > support readback, these Qualcomm firmware devices are pretty much > unique in this regard. We don't want a general property to set a > specific voltage since normally we should be using the > constraints and don't normally need to adjust things immediately > since we can tell what the current voltage is. > > This is pretty much just going to be a device specific bodge, > ideally something that does know what the voltage is would be > able to tell us at runtime but if that's not possible then > there's no good options. If the initial voltage might vary based > on board then a device specific DT property might be less > terrible, if it's determined by the regulator the current code > seems fine. Or just leave the current behavour, if the > constraints are accurate then hopefully a temporary dip in > voltage is just inelegant rather than an issue. Indeed the > current behaviour might well save power if you've got a voltage > range configured and nothing actually ever gets round to setting > the voltage (which is depressingly common, people seem keen on > setting voltage ranges even when the voltage is never varied in > practice). Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. Best Regards, Devi Priya
On 3.03.2023 14:21, Devi Priya wrote: > > > On 2/23/2023 4:31 AM, Mark Brown wrote: >> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >> >>> Thinking about it again, this seems like something that could be >>> generalized and introduced into regulator core.. Hardcoding this >>> will not end well.. Not to mention it'll affect all mp5496-using >>> boards that are already upstream. >> >>> WDYT about regulator-init-microvolts Mark? >> >> The overwhelming majority of devices that have variable voltages >> support readback, these Qualcomm firmware devices are pretty much >> unique in this regard. We don't want a general property to set a >> specific voltage since normally we should be using the >> constraints and don't normally need to adjust things immediately >> since we can tell what the current voltage is. >> >> This is pretty much just going to be a device specific bodge, >> ideally something that does know what the voltage is would be >> able to tell us at runtime but if that's not possible then >> there's no good options. If the initial voltage might vary based >> on board then a device specific DT property might be less >> terrible, if it's determined by the regulator the current code >> seems fine. Or just leave the current behavour, if the >> constraints are accurate then hopefully a temporary dip in >> voltage is just inelegant rather than an issue. Indeed the >> current behaviour might well save power if you've got a voltage >> range configured and nothing actually ever gets round to setting >> the voltage (which is depressingly common, people seem keen on >> setting voltage ranges even when the voltage is never varied in >> practice). > > Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. But what about IPQ6018 which also uses MP5496? That's also gonna set the voltage on there, it may be too high/low.. Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. That's an SoC-specific thing, the same regulator can be used with many different ones. We can't just assume it'll always be like this. I see the problem, but I believe this is not the correct solution. Konrad > > Best Regards, > Devi Priya
On 3/6/2023 6:39 PM, Devi Priya wrote: > > > On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >> >> >> On 3.03.2023 14:21, Devi Priya wrote: >>> >>> >>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>> >>>>> Thinking about it again, this seems like something that could be >>>>> generalized and introduced into regulator core.. Hardcoding this >>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>> boards that are already upstream. >>>> >>>>> WDYT about regulator-init-microvolts Mark? >>>> >>>> The overwhelming majority of devices that have variable voltages >>>> support readback, these Qualcomm firmware devices are pretty much >>>> unique in this regard. We don't want a general property to set a >>>> specific voltage since normally we should be using the >>>> constraints and don't normally need to adjust things immediately >>>> since we can tell what the current voltage is. >>>> >>>> This is pretty much just going to be a device specific bodge, >>>> ideally something that does know what the voltage is would be >>>> able to tell us at runtime but if that's not possible then >>>> there's no good options. If the initial voltage might vary based >>>> on board then a device specific DT property might be less >>>> terrible, if it's determined by the regulator the current code >>>> seems fine. Or just leave the current behavour, if the >>>> constraints are accurate then hopefully a temporary dip in >>>> voltage is just inelegant rather than an issue. Indeed the >>>> current behaviour might well save power if you've got a voltage >>>> range configured and nothing actually ever gets round to setting >>>> the voltage (which is depressingly common, people seem keen on >>>> setting voltage ranges even when the voltage is never varied in >>>> practice). >>> >>> Hi Mark, The initial bootup voltage is actually blown into the OTP >>> register of the PMIC and it remains the same across boards for >>> IPQ9574 SoC. >> But what about IPQ6018 which also uses MP5496? That's also gonna >> set the voltage on there, it may be too high/low.. For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is 875mV >> >> Initially the SoC runs at 800MHz with a voltage of 875mV set by the >> bootloaders. As kernel does not know the initial voltage, during >> regulator registration the framework considers the current voltage to >> be zero and tries to bring up the regulator to minimum supported >> voltage of 600mV. This causes the dip which might be of concern in SS >> parts where the voltage might be insufficient leading to silent reboots. >> That's an SoC-specific thing, the same regulator can be used with >> many different ones. We can't just assume it'll always be like this. >> I see the problem, but I believe this is not the correct solution Okay, As we had discussions on reading back the voltage & the generic DT property, do you suggest any other possible solutions here? >> >> Konrad >>> >>> Best Regards, >>> Devi Priya
On 7.03.2023 07:55, Devi Priya wrote: > > > On 3/6/2023 6:39 PM, Devi Priya wrote: >> >> >> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>> >>> >>> On 3.03.2023 14:21, Devi Priya wrote: >>>> >>>> >>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>> >>>>>> Thinking about it again, this seems like something that could be >>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>> boards that are already upstream. >>>>> >>>>>> WDYT about regulator-init-microvolts Mark? >>>>> >>>>> The overwhelming majority of devices that have variable voltages >>>>> support readback, these Qualcomm firmware devices are pretty much >>>>> unique in this regard. We don't want a general property to set a >>>>> specific voltage since normally we should be using the >>>>> constraints and don't normally need to adjust things immediately >>>>> since we can tell what the current voltage is. >>>>> >>>>> This is pretty much just going to be a device specific bodge, >>>>> ideally something that does know what the voltage is would be >>>>> able to tell us at runtime but if that's not possible then >>>>> there's no good options. If the initial voltage might vary based >>>>> on board then a device specific DT property might be less >>>>> terrible, if it's determined by the regulator the current code >>>>> seems fine. Or just leave the current behavour, if the >>>>> constraints are accurate then hopefully a temporary dip in >>>>> voltage is just inelegant rather than an issue. Indeed the >>>>> current behaviour might well save power if you've got a voltage >>>>> range configured and nothing actually ever gets round to setting >>>>> the voltage (which is depressingly common, people seem keen on >>>>> setting voltage ranges even when the voltage is never varied in >>>>> practice). >>>> >>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>> But what about IPQ6018 which also uses MP5496? That's also gonna >>> set the voltage on there, it may be too high/low.. > For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is > 875mV Okay, but what about any other design that employs or may employ MP5496 in the future? >>> >>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>> That's an SoC-specific thing, the same regulator can be used with >>> many different ones. We can't just assume it'll always be like this. >>> I see the problem, but I believe this is not the correct solution > Okay, As we had discussions on reading back the voltage & the generic > DT property, do you suggest any other possible solutions here? Due to the sudden influx of various IPQ SoCs on the mailing list lately I have no idea if it concerned this one too, but at least one of them was said not to use RPM for controlling the clocks. If that's the case, I see no reason at all to use it for scaling the regulators, the PMIC could be addressed directly over I2C as a normal device. You'd probably want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by simply not registering the CX/MX registers as children of the I2C regulator IC. Konrad >>> >>> Konrad >>>> >>>> Best Regards, >>>> Devi Priya
On 3/8/2023 3:57 PM, Konrad Dybcio wrote: > > > On 7.03.2023 07:55, Devi Priya wrote: >> >> >> On 3/6/2023 6:39 PM, Devi Priya wrote: >>> >>> >>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>> >>>> >>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>> >>>>> >>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>> >>>>>>> Thinking about it again, this seems like something that could be >>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>> boards that are already upstream. >>>>>> >>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>> >>>>>> The overwhelming majority of devices that have variable voltages >>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>> unique in this regard. We don't want a general property to set a >>>>>> specific voltage since normally we should be using the >>>>>> constraints and don't normally need to adjust things immediately >>>>>> since we can tell what the current voltage is. >>>>>> >>>>>> This is pretty much just going to be a device specific bodge, >>>>>> ideally something that does know what the voltage is would be >>>>>> able to tell us at runtime but if that's not possible then >>>>>> there's no good options. If the initial voltage might vary based >>>>>> on board then a device specific DT property might be less >>>>>> terrible, if it's determined by the regulator the current code >>>>>> seems fine. Or just leave the current behavour, if the >>>>>> constraints are accurate then hopefully a temporary dip in >>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>> current behaviour might well save power if you've got a voltage >>>>>> range configured and nothing actually ever gets round to setting >>>>>> the voltage (which is depressingly common, people seem keen on >>>>>> setting voltage ranges even when the voltage is never varied in >>>>>> practice). >>>>> >>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>> set the voltage on there, it may be too high/low.. >> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >> 875mV > Okay, but what about any other design that employs or may employ > MP5496 in the future? > >>>> >>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>> That's an SoC-specific thing, the same regulator can be used with >>>> many different ones. We can't just assume it'll always be like this. >>>> I see the problem, but I believe this is not the correct solution >> Okay, As we had discussions on reading back the voltage & the generic >> DT property, do you suggest any other possible solutions here? > Due to the sudden influx of various IPQ SoCs on the mailing list lately > I have no idea if it concerned this one too, but at least one of them > was said not to use RPM for controlling the clocks. If that's the case, > I see no reason at all to use it for scaling the regulators, the PMIC > could be addressed directly over I2C as a normal device. You'd probably > want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by > simply not registering the CX/MX registers as children of the I2C > regulator IC. IPQ9574 SoC has RPM and uses it for controlling the regulators. Currently, the RPM firmware does not have read support implemented and so, we were not able to read the bootup voltage. As we randomly saw silent reboots when the kernel boots up, do you think we could proceed with this change for time being and revisit the same when any SoC in the future employs MP5496? > > Konrad >>>> >>>> Konrad >>>>> >>>>> Best Regards, >>>>> Devi Priya
On 14.03.2023 18:15, Devi Priya wrote: > > > On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >> >> >> On 7.03.2023 07:55, Devi Priya wrote: >>> >>> >>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>> >>>> >>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>> >>>>>> >>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>> >>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>> boards that are already upstream. >>>>>>> >>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>> >>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>> unique in this regard. We don't want a general property to set a >>>>>>> specific voltage since normally we should be using the >>>>>>> constraints and don't normally need to adjust things immediately >>>>>>> since we can tell what the current voltage is. >>>>>>> >>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>> ideally something that does know what the voltage is would be >>>>>>> able to tell us at runtime but if that's not possible then >>>>>>> there's no good options. If the initial voltage might vary based >>>>>>> on board then a device specific DT property might be less >>>>>>> terrible, if it's determined by the regulator the current code >>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>> current behaviour might well save power if you've got a voltage >>>>>>> range configured and nothing actually ever gets round to setting >>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>> practice). >>>>>> >>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>> set the voltage on there, it may be too high/low.. >>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>> 875mV >> Okay, but what about any other design that employs or may employ >> MP5496 in the future? >> >>>>> >>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>> That's an SoC-specific thing, the same regulator can be used with >>>>> many different ones. We can't just assume it'll always be like this. >>>>> I see the problem, but I believe this is not the correct solution >>> Okay, As we had discussions on reading back the voltage & the generic >>> DT property, do you suggest any other possible solutions here? >> Due to the sudden influx of various IPQ SoCs on the mailing list lately >> I have no idea if it concerned this one too, but at least one of them >> was said not to use RPM for controlling the clocks. If that's the case, >> I see no reason at all to use it for scaling the regulators, the PMIC >> could be addressed directly over I2C as a normal device. You'd probably >> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >> simply not registering the CX/MX registers as children of the I2C >> regulator IC. > > IPQ9574 SoC has RPM and uses it for controlling the regulators. > Currently, the RPM firmware does not have read support implemented > and so, we were not able to read the bootup voltage. > As we randomly saw silent reboots when the kernel boots up, > do you think we could proceed with this change for time being > and revisit the same when any SoC in the future employs MP5496? I'm still thinking about a cleaner fix because hardcoding voltages in kernel is just dangerous. Could you check whether attaching a CPU supply and adding an OPP table where each level has an opp-microvolt property would resolve your issue? Konrad >> >> Konrad >>>>> >>>>> Konrad >>>>>> >>>>>> Best Regards, >>>>>> Devi Priya
On 3/18/2023 7:38 PM, Konrad Dybcio wrote: > > > On 14.03.2023 18:15, Devi Priya wrote: >> >> >> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>> >>> >>> On 7.03.2023 07:55, Devi Priya wrote: >>>> >>>> >>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>> >>>>> >>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>> >>>>>> >>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>> >>>>>>> >>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>> >>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>> boards that are already upstream. >>>>>>>> >>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>> >>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>> specific voltage since normally we should be using the >>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>> since we can tell what the current voltage is. >>>>>>>> >>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>> ideally something that does know what the voltage is would be >>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>> on board then a device specific DT property might be less >>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>> practice). >>>>>>> >>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>> set the voltage on there, it may be too high/low.. >>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>> 875mV >>> Okay, but what about any other design that employs or may employ >>> MP5496 in the future? >>> >>>>>> >>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>> many different ones. We can't just assume it'll always be like this. >>>>>> I see the problem, but I believe this is not the correct solution >>>> Okay, As we had discussions on reading back the voltage & the generic >>>> DT property, do you suggest any other possible solutions here? >>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>> I have no idea if it concerned this one too, but at least one of them >>> was said not to use RPM for controlling the clocks. If that's the case, >>> I see no reason at all to use it for scaling the regulators, the PMIC >>> could be addressed directly over I2C as a normal device. You'd probably >>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>> simply not registering the CX/MX registers as children of the I2C >>> regulator IC. >> >> IPQ9574 SoC has RPM and uses it for controlling the regulators. >> Currently, the RPM firmware does not have read support implemented >> and so, we were not able to read the bootup voltage. >> As we randomly saw silent reboots when the kernel boots up, >> do you think we could proceed with this change for time being >> and revisit the same when any SoC in the future employs MP5496? > I'm still thinking about a cleaner fix because hardcoding voltages > in kernel is just dangerous. Could you check whether attaching a CPU > supply and adding an OPP table where each level has an opp-microvolt > property would resolve your issue? > > Konrad Yes, Understood! We already have the CPU supply and OPP table where each level has an opp-microvolt property changes in place and it did not help in our case. We have now planned to update the regulator-min-microvolt property with the SVS voltage (725000uV) in the board DT such that the regulators are brought up with the nominal voltage which would be sufficient for all the corner parts operating at 800MHz. That way, we would update the DT and drop this patch in the next spin. Thanks, Devi Priya >>> >>> Konrad >>>>>> >>>>>> Konrad >>>>>>> >>>>>>> Best Regards, >>>>>>> Devi Priya
On 27.03.2023 10:40, Devi Priya wrote: > > > On 3/18/2023 7:38 PM, Konrad Dybcio wrote: >> >> >> On 14.03.2023 18:15, Devi Priya wrote: >>> >>> >>> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>>> >>>> >>>> On 7.03.2023 07:55, Devi Priya wrote: >>>>> >>>>> >>>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>>> >>>>>> >>>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>>> >>>>>>> >>>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>>> >>>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>>> boards that are already upstream. >>>>>>>>> >>>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>>> >>>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>>> specific voltage since normally we should be using the >>>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>>> since we can tell what the current voltage is. >>>>>>>>> >>>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>>> ideally something that does know what the voltage is would be >>>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>>> on board then a device specific DT property might be less >>>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>>> practice). >>>>>>>> >>>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>>> set the voltage on there, it may be too high/low.. >>>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>>> 875mV >>>> Okay, but what about any other design that employs or may employ >>>> MP5496 in the future? >>>> >>>>>>> >>>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>>> many different ones. We can't just assume it'll always be like this. >>>>>>> I see the problem, but I believe this is not the correct solution >>>>> Okay, As we had discussions on reading back the voltage & the generic >>>>> DT property, do you suggest any other possible solutions here? >>>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>>> I have no idea if it concerned this one too, but at least one of them >>>> was said not to use RPM for controlling the clocks. If that's the case, >>>> I see no reason at all to use it for scaling the regulators, the PMIC >>>> could be addressed directly over I2C as a normal device. You'd probably >>>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>>> simply not registering the CX/MX registers as children of the I2C >>>> regulator IC. >>> >>> IPQ9574 SoC has RPM and uses it for controlling the regulators. >>> Currently, the RPM firmware does not have read support implemented >>> and so, we were not able to read the bootup voltage. >>> As we randomly saw silent reboots when the kernel boots up, >>> do you think we could proceed with this change for time being >>> and revisit the same when any SoC in the future employs MP5496? >> I'm still thinking about a cleaner fix because hardcoding voltages >> in kernel is just dangerous. Could you check whether attaching a CPU >> supply and adding an OPP table where each level has an opp-microvolt >> property would resolve your issue? >> >> Konrad > Yes, Understood! We already have the CPU supply and OPP table where > each level has an opp-microvolt property changes in place and it did > not help in our case. Ouch. That totally sounds like a bug.. Would you be willing to dig a bit further into why this happens? Konrad > We have now planned to update the regulator-min-microvolt property > with the SVS voltage (725000uV) in the board DT such that the regulators > are brought up with the nominal voltage which would be sufficient > for all the corner parts operating at 800MHz. > > That way, we would update the DT and drop this patch in the next spin. > > Thanks, > Devi Priya >>>> >>>> Konrad >>>>>>> >>>>>>> Konrad >>>>>>>> >>>>>>>> Best Regards, >>>>>>>> Devi Priya
On 3/27/2023 2:56 PM, Konrad Dybcio wrote: > > > On 27.03.2023 10:40, Devi Priya wrote: >> >> >> On 3/18/2023 7:38 PM, Konrad Dybcio wrote: >>> >>> >>> On 14.03.2023 18:15, Devi Priya wrote: >>>> >>>> >>>> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 7.03.2023 07:55, Devi Priya wrote: >>>>>> >>>>>> >>>>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>>>> >>>>>>> >>>>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>>>> >>>>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>>>> boards that are already upstream. >>>>>>>>>> >>>>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>>>> >>>>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>>>> specific voltage since normally we should be using the >>>>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>>>> since we can tell what the current voltage is. >>>>>>>>>> >>>>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>>>> ideally something that does know what the voltage is would be >>>>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>>>> on board then a device specific DT property might be less >>>>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>>>> practice). >>>>>>>>> >>>>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>>>> set the voltage on there, it may be too high/low.. >>>>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>>>> 875mV >>>>> Okay, but what about any other design that employs or may employ >>>>> MP5496 in the future? >>>>> >>>>>>>> >>>>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>>>> many different ones. We can't just assume it'll always be like this. >>>>>>>> I see the problem, but I believe this is not the correct solution >>>>>> Okay, As we had discussions on reading back the voltage & the generic >>>>>> DT property, do you suggest any other possible solutions here? >>>>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>>>> I have no idea if it concerned this one too, but at least one of them >>>>> was said not to use RPM for controlling the clocks. If that's the case, >>>>> I see no reason at all to use it for scaling the regulators, the PMIC >>>>> could be addressed directly over I2C as a normal device. You'd probably >>>>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>>>> simply not registering the CX/MX registers as children of the I2C >>>>> regulator IC. >>>> >>>> IPQ9574 SoC has RPM and uses it for controlling the regulators. >>>> Currently, the RPM firmware does not have read support implemented >>>> and so, we were not able to read the bootup voltage. >>>> As we randomly saw silent reboots when the kernel boots up, >>>> do you think we could proceed with this change for time being >>>> and revisit the same when any SoC in the future employs MP5496? >>> I'm still thinking about a cleaner fix because hardcoding voltages >>> in kernel is just dangerous. Could you check whether attaching a CPU >>> supply and adding an OPP table where each level has an opp-microvolt >>> property would resolve your issue? >>> >>> Konrad >> Yes, Understood! We already have the CPU supply and OPP table where >> each level has an opp-microvolt property changes in place and it did >> not help in our case. > Ouch. That totally sounds like a bug.. Would you be willing to dig > a bit further into why this happens? As the regulator registration happens before the cpu freq scaling comes into picture, having an OPP table did not help to set the bootup voltage > > Konrad >> We have now planned to update the regulator-min-microvolt property >> with the SVS voltage (725000uV) in the board DT such that the regulators >> are brought up with the nominal voltage which would be sufficient >> for all the corner parts operating at 800MHz. >> >> That way, we would update the DT and drop this patch in the next spin. >> >> Thanks, >> Devi Priya >>>>> >>>>> Konrad >>>>>>>> >>>>>>>> Konrad >>>>>>>>> >>>>>>>>> Best Regards, >>>>>>>>> Devi Priya
On 28.03.2023 08:12, Devi Priya wrote: > > > On 3/27/2023 2:56 PM, Konrad Dybcio wrote: >> >> >> On 27.03.2023 10:40, Devi Priya wrote: >>> >>> >>> On 3/18/2023 7:38 PM, Konrad Dybcio wrote: >>>> >>>> >>>> On 14.03.2023 18:15, Devi Priya wrote: >>>>> >>>>> >>>>> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>>>>> >>>>>> >>>>>> On 7.03.2023 07:55, Devi Priya wrote: >>>>>>> >>>>>>> >>>>>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>>>>> >>>>>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>>>>> boards that are already upstream. >>>>>>>>>>> >>>>>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>>>>> >>>>>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>>>>> specific voltage since normally we should be using the >>>>>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>>>>> since we can tell what the current voltage is. >>>>>>>>>>> >>>>>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>>>>> ideally something that does know what the voltage is would be >>>>>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>>>>> on board then a device specific DT property might be less >>>>>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>>>>> practice). >>>>>>>>>> >>>>>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>>>>> set the voltage on there, it may be too high/low.. >>>>>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>>>>> 875mV >>>>>> Okay, but what about any other design that employs or may employ >>>>>> MP5496 in the future? >>>>>> >>>>>>>>> >>>>>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>>>>> many different ones. We can't just assume it'll always be like this. >>>>>>>>> I see the problem, but I believe this is not the correct solution >>>>>>> Okay, As we had discussions on reading back the voltage & the generic >>>>>>> DT property, do you suggest any other possible solutions here? >>>>>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>>>>> I have no idea if it concerned this one too, but at least one of them >>>>>> was said not to use RPM for controlling the clocks. If that's the case, >>>>>> I see no reason at all to use it for scaling the regulators, the PMIC >>>>>> could be addressed directly over I2C as a normal device. You'd probably >>>>>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>>>>> simply not registering the CX/MX registers as children of the I2C >>>>>> regulator IC. >>>>> >>>>> IPQ9574 SoC has RPM and uses it for controlling the regulators. >>>>> Currently, the RPM firmware does not have read support implemented >>>>> and so, we were not able to read the bootup voltage. >>>>> As we randomly saw silent reboots when the kernel boots up, >>>>> do you think we could proceed with this change for time being >>>>> and revisit the same when any SoC in the future employs MP5496? >>>> I'm still thinking about a cleaner fix because hardcoding voltages >>>> in kernel is just dangerous. Could you check whether attaching a CPU >>>> supply and adding an OPP table where each level has an opp-microvolt >>>> property would resolve your issue? >>>> >>>> Konrad >>> Yes, Understood! We already have the CPU supply and OPP table where >>> each level has an opp-microvolt property changes in place and it did >>> not help in our case. >> Ouch. That totally sounds like a bug.. Would you be willing to dig >> a bit further into why this happens? > As the regulator registration happens before the cpu freq scaling comes > into picture, having an OPP table did not help to set the bootup voltage I see, but the order should not affect it. If your regulator driver returns -EPROBE_DEFER, so should the cpufreq one. Konrad >> >> Konrad >>> We have now planned to update the regulator-min-microvolt property >>> with the SVS voltage (725000uV) in the board DT such that the regulators >>> are brought up with the nominal voltage which would be sufficient >>> for all the corner parts operating at 800MHz. >>> >>> That way, we would update the DT and drop this patch in the next spin. >>> >>> Thanks, >>> Devi Priya >>>>>> >>>>>> Konrad >>>>>>>>> >>>>>>>>> Konrad >>>>>>>>>> >>>>>>>>>> Best Regards, >>>>>>>>>> Devi Priya
On 3/28/2023 1:58 PM, Konrad Dybcio wrote: > > > On 28.03.2023 08:12, Devi Priya wrote: >> >> >> On 3/27/2023 2:56 PM, Konrad Dybcio wrote: >>> >>> >>> On 27.03.2023 10:40, Devi Priya wrote: >>>> >>>> >>>> On 3/18/2023 7:38 PM, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 14.03.2023 18:15, Devi Priya wrote: >>>>>> >>>>>> >>>>>> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>>>>>> >>>>>>> >>>>>>> On 7.03.2023 07:55, Devi Priya wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>>>>>> boards that are already upstream. >>>>>>>>>>>> >>>>>>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>>>>>> >>>>>>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>>>>>> specific voltage since normally we should be using the >>>>>>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>>>>>> since we can tell what the current voltage is. >>>>>>>>>>>> >>>>>>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>>>>>> ideally something that does know what the voltage is would be >>>>>>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>>>>>> on board then a device specific DT property might be less >>>>>>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>>>>>> practice). >>>>>>>>>>> >>>>>>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>>>>>> set the voltage on there, it may be too high/low.. >>>>>>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>>>>>> 875mV >>>>>>> Okay, but what about any other design that employs or may employ >>>>>>> MP5496 in the future? >>>>>>> >>>>>>>>>> >>>>>>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>>>>>> many different ones. We can't just assume it'll always be like this. >>>>>>>>>> I see the problem, but I believe this is not the correct solution >>>>>>>> Okay, As we had discussions on reading back the voltage & the generic >>>>>>>> DT property, do you suggest any other possible solutions here? >>>>>>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>>>>>> I have no idea if it concerned this one too, but at least one of them >>>>>>> was said not to use RPM for controlling the clocks. If that's the case, >>>>>>> I see no reason at all to use it for scaling the regulators, the PMIC >>>>>>> could be addressed directly over I2C as a normal device. You'd probably >>>>>>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>>>>>> simply not registering the CX/MX registers as children of the I2C >>>>>>> regulator IC. >>>>>> >>>>>> IPQ9574 SoC has RPM and uses it for controlling the regulators. >>>>>> Currently, the RPM firmware does not have read support implemented >>>>>> and so, we were not able to read the bootup voltage. >>>>>> As we randomly saw silent reboots when the kernel boots up, >>>>>> do you think we could proceed with this change for time being >>>>>> and revisit the same when any SoC in the future employs MP5496? >>>>> I'm still thinking about a cleaner fix because hardcoding voltages >>>>> in kernel is just dangerous. Could you check whether attaching a CPU >>>>> supply and adding an OPP table where each level has an opp-microvolt >>>>> property would resolve your issue? >>>>> >>>>> Konrad >>>> Yes, Understood! We already have the CPU supply and OPP table where >>>> each level has an opp-microvolt property changes in place and it did >>>> not help in our case. >>> Ouch. That totally sounds like a bug.. Would you be willing to dig >>> a bit further into why this happens? >> As the regulator registration happens before the cpu freq scaling comes >> into picture, having an OPP table did not help to set the bootup voltage > I see, but the order should not affect it. If your regulator driver > returns -EPROBE_DEFER, so should the cpufreq one. > > Konrad Sorry konrad, don't exactly get your point here. The cpufreq driver depends on the regulator driver to be probed as the regulator serves as the cpu-supply. But, when the regulator driver comes up, it tries to bring up the regulators to the minimum supported voltage provided with the regulator-min-microvolt property in the DT. The regulator being the CPU only supply, updating the regulator-min-microvolt with SVS voltage (725000uV) would ideally help us with the issue. That way, we could update the DT and drop this patch. This approach seems quite ideal to us. Shall we proceed with it if we don't foresee any issues? Thanks, Devi Priya >>> >>> Konrad >>>> We have now planned to update the regulator-min-microvolt property >>>> with the SVS voltage (725000uV) in the board DT such that the regulators >>>> are brought up with the nominal voltage which would be sufficient >>>> for all the corner parts operating at 800MHz. >>>> >>>> That way, we would update the DT and drop this patch in the next spin. >>>> >>>> Thanks, >>>> Devi Priya >>>>>>> >>>>>>> Konrad >>>>>>>>>> >>>>>>>>>> Konrad >>>>>>>>>>> >>>>>>>>>>> Best Regards, >>>>>>>>>>> Devi Priya
On 3.04.2023 16:07, Devi Priya wrote: > > > On 3/28/2023 1:58 PM, Konrad Dybcio wrote: >> >> >> On 28.03.2023 08:12, Devi Priya wrote: >>> >>> >>> On 3/27/2023 2:56 PM, Konrad Dybcio wrote: >>>> >>>> >>>> On 27.03.2023 10:40, Devi Priya wrote: >>>>> >>>>> >>>>> On 3/18/2023 7:38 PM, Konrad Dybcio wrote: >>>>>> >>>>>> >>>>>> On 14.03.2023 18:15, Devi Priya wrote: >>>>>>> >>>>>>> >>>>>>> On 3/8/2023 3:57 PM, Konrad Dybcio wrote: >>>>>>>> >>>>>>>> >>>>>>>> On 7.03.2023 07:55, Devi Priya wrote: >>>>>>>>> >>>>>>>>> >>>>>>>>> On 3/6/2023 6:39 PM, Devi Priya wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 3/3/2023 6:57 PM, Konrad Dybcio wrote: >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 3.03.2023 14:21, Devi Priya wrote: >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On 2/23/2023 4:31 AM, Mark Brown wrote: >>>>>>>>>>>>> On Wed, Feb 22, 2023 at 11:11:42PM +0100, Konrad Dybcio wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Thinking about it again, this seems like something that could be >>>>>>>>>>>>>> generalized and introduced into regulator core.. Hardcoding this >>>>>>>>>>>>>> will not end well.. Not to mention it'll affect all mp5496-using >>>>>>>>>>>>>> boards that are already upstream. >>>>>>>>>>>>> >>>>>>>>>>>>>> WDYT about regulator-init-microvolts Mark? >>>>>>>>>>>>> >>>>>>>>>>>>> The overwhelming majority of devices that have variable voltages >>>>>>>>>>>>> support readback, these Qualcomm firmware devices are pretty much >>>>>>>>>>>>> unique in this regard. We don't want a general property to set a >>>>>>>>>>>>> specific voltage since normally we should be using the >>>>>>>>>>>>> constraints and don't normally need to adjust things immediately >>>>>>>>>>>>> since we can tell what the current voltage is. >>>>>>>>>>>>> >>>>>>>>>>>>> This is pretty much just going to be a device specific bodge, >>>>>>>>>>>>> ideally something that does know what the voltage is would be >>>>>>>>>>>>> able to tell us at runtime but if that's not possible then >>>>>>>>>>>>> there's no good options. If the initial voltage might vary based >>>>>>>>>>>>> on board then a device specific DT property might be less >>>>>>>>>>>>> terrible, if it's determined by the regulator the current code >>>>>>>>>>>>> seems fine. Or just leave the current behavour, if the >>>>>>>>>>>>> constraints are accurate then hopefully a temporary dip in >>>>>>>>>>>>> voltage is just inelegant rather than an issue. Indeed the >>>>>>>>>>>>> current behaviour might well save power if you've got a voltage >>>>>>>>>>>>> range configured and nothing actually ever gets round to setting >>>>>>>>>>>>> the voltage (which is depressingly common, people seem keen on >>>>>>>>>>>>> setting voltage ranges even when the voltage is never varied in >>>>>>>>>>>>> practice). >>>>>>>>>>>> >>>>>>>>>>>> Hi Mark, The initial bootup voltage is actually blown into the OTP register of the PMIC and it remains the same across boards for IPQ9574 SoC. >>>>>>>>>>> But what about IPQ6018 which also uses MP5496? That's also gonna >>>>>>>>>>> set the voltage on there, it may be too high/low.. >>>>>>>>> For IPQ6018, the bootup voltage is the same as that of IPQ9574 which is >>>>>>>>> 875mV >>>>>>>> Okay, but what about any other design that employs or may employ >>>>>>>> MP5496 in the future? >>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Initially the SoC runs at 800MHz with a voltage of 875mV set by the bootloaders. As kernel does not know the initial voltage, during regulator registration the framework considers the current voltage to be zero and tries to bring up the regulator to minimum supported voltage of 600mV. This causes the dip which might be of concern in SS parts where the voltage might be insufficient leading to silent reboots. >>>>>>>>>>> That's an SoC-specific thing, the same regulator can be used with >>>>>>>>>>> many different ones. We can't just assume it'll always be like this. >>>>>>>>>>> I see the problem, but I believe this is not the correct solution >>>>>>>>> Okay, As we had discussions on reading back the voltage & the generic >>>>>>>>> DT property, do you suggest any other possible solutions here? >>>>>>>> Due to the sudden influx of various IPQ SoCs on the mailing list lately >>>>>>>> I have no idea if it concerned this one too, but at least one of them >>>>>>>> was said not to use RPM for controlling the clocks. If that's the case, >>>>>>>> I see no reason at all to use it for scaling the regulators, the PMIC >>>>>>>> could be addressed directly over I2C as a normal device. You'd probably >>>>>>>> want to keep VDD_[CM]X scaling through rpmpd, but it's easily done by >>>>>>>> simply not registering the CX/MX registers as children of the I2C >>>>>>>> regulator IC. >>>>>>> >>>>>>> IPQ9574 SoC has RPM and uses it for controlling the regulators. >>>>>>> Currently, the RPM firmware does not have read support implemented >>>>>>> and so, we were not able to read the bootup voltage. >>>>>>> As we randomly saw silent reboots when the kernel boots up, >>>>>>> do you think we could proceed with this change for time being >>>>>>> and revisit the same when any SoC in the future employs MP5496? >>>>>> I'm still thinking about a cleaner fix because hardcoding voltages >>>>>> in kernel is just dangerous. Could you check whether attaching a CPU >>>>>> supply and adding an OPP table where each level has an opp-microvolt >>>>>> property would resolve your issue? >>>>>> >>>>>> Konrad >>>>> Yes, Understood! We already have the CPU supply and OPP table where >>>>> each level has an opp-microvolt property changes in place and it did >>>>> not help in our case. >>>> Ouch. That totally sounds like a bug.. Would you be willing to dig >>>> a bit further into why this happens? >>> As the regulator registration happens before the cpu freq scaling comes >>> into picture, having an OPP table did not help to set the bootup voltage >> I see, but the order should not affect it. If your regulator driver >> returns -EPROBE_DEFER, so should the cpufreq one. >> >> Konrad > Sorry konrad, don't exactly get your point here. > The cpufreq driver depends on the regulator driver to be probed as > the regulator serves as the cpu-supply. > But, when the regulator driver comes up, it tries to bring up the > regulators to the minimum supported voltage provided with the > regulator-min-microvolt property in the DT. Right, that exists.. Mark, do you think it should be updated such that the requests are aggregated before assuming min_uV is "just fine"? > > The regulator being the CPU only supply, updating the > regulator-min-microvolt with SVS voltage (725000uV) would ideally help > us with the issue. That way, we could update the DT and drop this patch. > > This approach seems quite ideal to us. Shall we proceed with it if we don't foresee any issues? Yes, please do so as a temporary measure and leave a comment about it in the device tree so that it's not forgotten about. Ideally both scaling up and down should be supported.. Konrad > > Thanks, > Devi Priya > >>>> >>>> Konrad >>>>> We have now planned to update the regulator-min-microvolt property >>>>> with the SVS voltage (725000uV) in the board DT such that the regulators >>>>> are brought up with the nominal voltage which would be sufficient >>>>> for all the corner parts operating at 800MHz. >>>>> >>>>> That way, we would update the DT and drop this patch in the next spin. >>>>> >>>>> Thanks, >>>>> Devi Priya >>>>>>>> >>>>>>>> Konrad >>>>>>>>>>> >>>>>>>>>>> Konrad >>>>>>>>>>>> >>>>>>>>>>>> Best Regards, >>>>>>>>>>>> Devi Priya
On Mon, Apr 03, 2023 at 07:53:48PM +0200, Konrad Dybcio wrote: > On 3.04.2023 16:07, Devi Priya wrote: > > But, when the regulator driver comes up, it tries to bring up the > > regulators to the minimum supported voltage provided with the > > regulator-min-microvolt property in the DT. > Right, that exists.. > Mark, do you think it should be updated such that the requests are > aggregated before assuming min_uV is "just fine"? We can't tell if any consumers are ever going to appear, and the regulator having a voltage outside of the constraints is an urgent problem we need to fix quickly. Since we try to bring the voltage to the nearest end of the constraint the driver could always change the bogus voltage it reports to one that is excessively high, this would mean the core will try to bring the voltage down to the maximum rather than up to the minimum. The driver could also look at the constraints when guessing at the hardware configuration rather than claiming an out of spec voltage, this would mean we wouldn't need to correct anything.
On 3.04.2023 20:14, Mark Brown wrote: > On Mon, Apr 03, 2023 at 07:53:48PM +0200, Konrad Dybcio wrote: >> On 3.04.2023 16:07, Devi Priya wrote: > >>> But, when the regulator driver comes up, it tries to bring up the >>> regulators to the minimum supported voltage provided with the >>> regulator-min-microvolt property in the DT. > >> Right, that exists.. > >> Mark, do you think it should be updated such that the requests are >> aggregated before assuming min_uV is "just fine"? > > We can't tell if any consumers are ever going to appear, and the > regulator having a voltage outside of the constraints is an urgent > problem we need to fix quickly. Since we try to bring the voltage to > the nearest end of the constraint the driver could always change the > bogus voltage it reports to one that is excessively high, this would > mean the core will try to bring the voltage down to the maximum rather > than up to the minimum. The driver could also look at the constraints > when guessing at the hardware configuration rather than claiming an out > of spec voltage, this would mean we wouldn't need to correct anything. Hm, all of what you said sounds like a valid concern.. And then we probably shouldn't shoot up to max by default, as going too low is not going to cause as much potential irreversible damage as going too high.. Especially with programmer error.. Too bad Qualcomm's firmware architecture doesn't allow for reading back the voltage.. Konrad
On Mon, Apr 03, 2023 at 08:21:25PM +0200, Konrad Dybcio wrote: > On 3.04.2023 20:14, Mark Brown wrote: > > than up to the minimum. The driver could also look at the constraints > > when guessing at the hardware configuration rather than claiming an out > > of spec voltage, this would mean we wouldn't need to correct anything. > Hm, all of what you said sounds like a valid concern.. And then we > probably shouldn't shoot up to max by default, as going too low is > not going to cause as much potential irreversible damage as going > too high.. Especially with programmer error.. It sounds like the driver should just be reporting a value which is at least within the constraints. > Too bad Qualcomm's firmware architecture doesn't allow for reading > back the voltage.. Right, their interfaces here have some serious drawbacks.
diff --git a/drivers/regulator/qcom_smd-regulator.c b/drivers/regulator/qcom_smd-regulator.c index a40e66cea7e7..5f9fe6b9d368 100644 --- a/drivers/regulator/qcom_smd-regulator.c +++ b/drivers/regulator/qcom_smd-regulator.c @@ -800,12 +800,13 @@ struct rpm_regulator_data { u32 id; const struct regulator_desc *desc; const char *supply; + int boot_uV; /* To store the bootup voltage set by bootloaders */ }; static const struct rpm_regulator_data rpm_mp5496_regulators[] = { - { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1" }, - { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" }, - { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" }, + { "s1", QCOM_SMD_RPM_SMPA, 1, &mp5496_smpa1, "s1", 875000 }, + { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2", 875000 }, + { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2", 2950000 }, {} }; @@ -1388,6 +1389,9 @@ static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev vreg->type = rpm_data->type; vreg->id = rpm_data->id; + if (rpm_data->boot_uV) + vreg->uV = rpm_data->boot_uV; + memcpy(&vreg->desc, rpm_data->desc, sizeof(vreg->desc)); vreg->desc.name = rpm_data->name; vreg->desc.supply_name = rpm_data->supply;