mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
To: Praveen Talari <praveen.talari@oss.qualcomm.com>,
	Andi Shyti <andi.shyti@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Mukesh Kumar Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	bjorn.andersson@oss.qualcomm.com,
	dmitry.baryshkov@oss.qualcomm.com
Cc: prasad.sodagudi@oss.qualcomm.com, quic_vtanuku@quicinc.com,
	aniket.randive@oss.qualcomm.com,
	chandana.chiluveru@oss.qualcomm.com,
	jyothi.seerapu@oss.qualcomm.com
Subject: Re: [PATCH v4 05/13] soc: qcom: geni-se: Add resources activation/deactivation helpers
Date: Tue, 3 Feb 2026 13:20:45 +0100	[thread overview]
Message-ID: <ff9a2aa3-1b2b-4001-82ce-198c61a4b637@oss.qualcomm.com> (raw)
In-Reply-To: <20260202180922.1692428-6-praveen.talari@oss.qualcomm.com>

On 2/2/26 7:09 PM, Praveen Talari wrote:
> The GENI SE protocol drivers (I2C, SPI, UART) implement similar resource
> activation/deactivation sequences independently, leading to code
> duplication.
> 
> Introduce geni_se_resources_activate()/geni_se_resources_deactivate() to
> power on/off resources.The activate function enables ICC, clocks, and TLMM
> whereas the deactivate function disables resources in reverse order
> including OPP rate reset, clocks, ICC and TLMM.
> 
> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
> ---

[...]

> +int geni_se_resources_deactivate(struct geni_se *se)
> +{
> +	int ret;
> +
> +	if (has_acpi_companion(se->dev))
> +		return 0;
> +
> +	if (se->has_opp)
> +		dev_pm_opp_set_rate(se->dev, 0);

This is still unbalanced at this point of abstraction, notably
keeping the RPMh vote at 0 permanently after the first
geni_se_resources_deactivate()  since there's no counterpart in
_activate()

That said, the serial and UART drivers do rate calculations internally,
so perhaps trying to be overly smart about it wouldn't be a good thing
either.. Let's add a note in kerneldoc that the activate must be preceded
by a dev_pm_opp_set_xyz()

[...]

> +int geni_se_resources_activate(struct geni_se *se)
> +{
> +	int ret;
> +
> +	if (has_acpi_companion(se->dev))
> +		return 0;
> +
> +	ret = geni_icc_enable(se);
> +	if (ret)
> +		return ret;
> +
> +	ret = geni_se_clks_on(se);
> +	if (ret)
> +		goto out_icc_disable;
> +
> +	ret = pinctrl_pm_select_default_state(se->dev);
> +	if (ret) {
> +		geni_se_clks_off(se);
> +		goto out_icc_disable;
> +	}
> +
> +	return ret;

nit: this 'return' always returns 0

Konrad

> +
> +out_icc_disable:
> +	geni_icc_disable(se);
> +	return ret;
> +}
> +EXPORT_SYMBOL_GPL(geni_se_resources_activate);
> +
>  /**
>   * geni_se_resources_init() - Initialize resources for a GENI SE device.
>   * @se: Pointer to the geni_se structure representing the GENI SE device.
> diff --git a/include/linux/soc/qcom/geni-se.h b/include/linux/soc/qcom/geni-se.h
> index c182dd0f0bde..36a68149345c 100644
> --- a/include/linux/soc/qcom/geni-se.h
> +++ b/include/linux/soc/qcom/geni-se.h
> @@ -541,6 +541,10 @@ int geni_icc_disable(struct geni_se *se);
>  
>  int geni_se_resources_init(struct geni_se *se);
>  
> +int geni_se_resources_activate(struct geni_se *se);
> +
> +int geni_se_resources_deactivate(struct geni_se *se);
> +
>  int geni_load_se_firmware(struct geni_se *se, enum geni_se_protocol_type protocol);
>  #endif
>  #endif

  reply	other threads:[~2026-02-03 12:20 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-02 18:09 [PATCH v4 00/13] Enable I2C on SA8255p Qualcomm platforms Praveen Talari
2026-02-02 18:09 ` [PATCH v4 01/13] soc: qcom: geni-se: Refactor geni_icc_get() and make qup-memory ICC path optional Praveen Talari
2026-02-02 18:09 ` [PATCH v4 02/13] soc: qcom: geni-se: Add geni_icc_set_bw_ab() function Praveen Talari
2026-02-02 18:09 ` [PATCH v4 03/13] soc: qcom: geni-se: Introduce helper API for resource initialization Praveen Talari
2026-02-03 12:12   ` Konrad Dybcio
2026-02-02 18:09 ` [PATCH v4 04/13] soc: qcom: geni-se: Handle core clk in geni_se_clks_off() and geni_se_clks_on() Praveen Talari
2026-02-03 12:14   ` Konrad Dybcio
2026-02-02 18:09 ` [PATCH v4 05/13] soc: qcom: geni-se: Add resources activation/deactivation helpers Praveen Talari
2026-02-03 12:20   ` Konrad Dybcio [this message]
2026-02-04  5:18     ` Praveen Talari
2026-02-02 18:09 ` [PATCH v4 06/13] soc: qcom: geni-se: Introduce helper API for attaching power domains Praveen Talari
2026-02-03 12:23   ` Konrad Dybcio
2026-02-04  5:10     ` Praveen Talari
2026-02-02 18:09 ` [PATCH v4 07/13] soc: qcom: geni-se: Introduce helper APIs for performance control Praveen Talari
2026-02-02 18:09 ` [PATCH v4 08/13] dt-bindings: i2c: Describe SA8255p Praveen Talari
2026-02-02 18:09 ` [PATCH v4 09/13] i2c: qcom-geni: Isolate serial engine setup Praveen Talari
2026-02-03 12:42   ` Konrad Dybcio
2026-02-02 18:09 ` [PATCH v4 10/13] i2c: qcom-geni: Move resource initialization to separate function Praveen Talari
2026-02-03 12:46   ` Konrad Dybcio
2026-02-02 18:09 ` [PATCH v4 11/13] i2c: qcom-geni: Use resources helper APIs in runtime PM functions Praveen Talari
2026-02-03 12:48   ` Konrad Dybcio
2026-02-04  5:06     ` Praveen Talari
2026-02-04 13:44       ` Konrad Dybcio
2026-02-04 16:31         ` Praveen Talari
2026-02-02 18:09 ` [PATCH v4 12/13] i2c: qcom-geni: Store of_device_id data in driver private struct Praveen Talari
2026-02-03 12:25   ` Konrad Dybcio
2026-02-04  5:04     ` Praveen Talari
2026-02-04 13:47       ` Konrad Dybcio
2026-02-04 16:32         ` Praveen Talari
2026-02-02 18:09 ` [PATCH v4 13/13] i2c: qcom-geni: Enable I2C on SA8255p Qualcomm platforms Praveen Talari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff9a2aa3-1b2b-4001-82ce-198c61a4b637@oss.qualcomm.com \
    --to=konrad.dybcio@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=aniket.randive@oss.qualcomm.com \
    --cc=bjorn.andersson@oss.qualcomm.com \
    --cc=chandana.chiluveru@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=jyothi.seerapu@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukesh.savaliya@oss.qualcomm.com \
    --cc=prasad.sodagudi@oss.qualcomm.com \
    --cc=praveen.talari@oss.qualcomm.com \
    --cc=quic_vtanuku@quicinc.com \
    --cc=robh@kernel.org \
    --cc=viken.dadhaniya@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®