public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Praveen Talari <quic_ptalari@quicinc.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-serial@vger.kernel.org, devicetree@vger.kernel.org,
	linux-pm@vger.kernel.org
Cc: psodagud@quicinc.com, djaggi@quicinc.com,
	quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com,
	quic_arandive@quicinc.com, quic_mnaresh@quicinc.com,
	quic_shazhuss@quicinc.com
Subject: Re: [PATCH v1 6/9] serial: qcom-geni: move resource control logic to separate functions
Date: Mon, 14 Apr 2025 09:59:47 +0200	[thread overview]
Message-ID: <df025c47-8de8-4f95-a8fa-8d5d5dce5d5f@kernel.org> (raw)
In-Reply-To: <20250410174010.31588-7-quic_ptalari@quicinc.com>

On 10. 04. 25, 19:40, Praveen Talari wrote:
> Supports use in PM system/runtime frameworks, helping to
> distinguish new resource control mechanisms and facilitate
> future modifications within the new API.
> 
> The code that handles the actual enable or disable of resources
> like clock and ICC paths to a separate function
> (geni_serial_resources_on() and geni_serial_resources_off()) which
> enhances code readability.
> 
> Signed-off-by: Praveen Talari <quic_ptalari@quicinc.com>
> ---
>   drivers/tty/serial/qcom_geni_serial.c | 53 +++++++++++++++++++++------
>   1 file changed, 42 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 889ce8961e0a..e341f5090ecc 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1572,6 +1572,42 @@ static struct uart_driver qcom_geni_uart_driver = {
>   	.nr =  GENI_UART_PORTS,
>   };
>   
> +static int geni_serial_resources_off(struct uart_port *uport)
> +{
> +	struct qcom_geni_serial_port *port = to_dev_port(uport);
> +	int ret;
> +
> +	dev_pm_opp_set_rate(uport->dev, 0);
> +	ret = geni_se_resources_off(&port->se);
> +	if (ret)
> +		return ret;
> +
> +	geni_icc_disable(&port->se);
> +
> +	return ret;

This is a bit confusing (needs context). return 0 directly.

> +}
> +
> +static int geni_serial_resources_on(struct uart_port *uport)
> +{
> +	struct qcom_geni_serial_port *port = to_dev_port(uport);
> +	int ret;
> +
> +	ret = geni_icc_enable(&port->se);
> +	if (ret)
> +		return ret;
> +
> +	ret = geni_se_resources_on(&port->se);
> +	if (ret) {
> +		geni_icc_disable(&port->se);
> +		return ret;
> +	}
> +
> +	if (port->clk_rate)
> +		dev_pm_opp_set_rate(uport->dev, port->clk_rate);
> +
> +	return ret;

Same here.

thanks,
-- 
js
suse labs

  reply	other threads:[~2025-04-14  7:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 17:40 [PATCH v1 0/9] Enable QUPs and Serial on SA8255p Qualcomm platforms Praveen Talari
2025-04-10 17:40 ` [PATCH v1 1/9] opp: add new helper API dev_pm_opp_set_level() Praveen Talari
2025-04-10 17:40 ` [PATCH v1 2/9] dt-bindings: serial: describe SA8255p Praveen Talari
2025-04-11 17:57   ` Rob Herring
2025-04-11 18:15     ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 3/9] dt-bindings: qcom: geni-se: " Praveen Talari
2025-04-10 18:34   ` Rob Herring (Arm)
2025-04-10 17:40 ` [PATCH v1 4/9] soc: qcom: geni-se: Enable QUPs on SA8255p Qualcomm platforms Praveen Talari
2025-04-11 18:40   ` kernel test robot
2025-04-11 18:40   ` kernel test robot
2025-04-14  7:56   ` Jiri Slaby
2025-04-14 17:59     ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 5/9] serial: qcom-geni: move resource initialization to separate functions Praveen Talari
2025-04-14  7:58   ` Jiri Slaby
2025-04-10 17:40 ` [PATCH v1 6/9] serial: qcom-geni: move resource control logic " Praveen Talari
2025-04-14  7:59   ` Jiri Slaby [this message]
2025-04-14  8:55     ` Praveen Talari
2025-04-10 17:40 ` [PATCH v1 7/9] serial: qcom-geni: move clock-rate logic to separate function Praveen Talari
2025-04-11 19:12   ` kernel test robot
2025-04-14  8:01   ` Jiri Slaby
2025-04-10 17:40 ` [PATCH v1 8/9] serial: qcom-geni: Enable PM runtime for serial driver Praveen Talari
2025-04-10 17:40 ` [PATCH v1 9/9] serial: qcom-geni: Enable Serial on SA8255p Qualcomm platforms Praveen Talari
2025-04-14  8:09   ` Jiri Slaby
2025-04-14 17:49     ` 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=df025c47-8de8-4f95-a8fa-8d5d5dce5d5f@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djaggi@quicinc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=psodagud@quicinc.com \
    --cc=quic_arandive@quicinc.com \
    --cc=quic_mnaresh@quicinc.com \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_ptalari@quicinc.com \
    --cc=quic_shazhuss@quicinc.com \
    --cc=quic_vtanuku@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vireshk@kernel.org \
    /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