All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: casey.connolly@linaro.org
Cc: u-boot-qcom@groups.io, u-boot@lists.denx.de,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Stephen Boyd <swboyd@chromium.org>
Subject: Re: [PATCH 1/2] serial: msm-geni: allow invalid clock
Date: Tue, 7 Apr 2026 17:08:57 +0530	[thread overview]
Message-ID: <adTs0aMJmGrIPKeR@sumit-xelite> (raw)
In-Reply-To: <20260320-casey-qcom-rpmh-serial-fixes-v1-1-b81d05832eec@linaro.org>

On Fri, Mar 20, 2026 at 04:45:40PM +0100, Casey Connolly via B4 Relay wrote:
> From: Casey Connolly <casey.connolly@linaro.org>
> 
> Pre-relocation we probably won't have a clock but it's usually
> been enabled for us already, or worst case we will enable it after
> relocation.
> 

Not sure if this is the right approach, since the UART driver might just
hang without clock being enabled. What's the motivation for this change?

-Sumit

> Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
> ---
>  drivers/serial/serial_msm_geni.c | 15 +++++----------
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/serial/serial_msm_geni.c b/drivers/serial/serial_msm_geni.c
> index bb5a2cb4d2cd..c37255f57d05 100644
> --- a/drivers/serial/serial_msm_geni.c
> +++ b/drivers/serial/serial_msm_geni.c
> @@ -211,9 +211,9 @@ static int msm_serial_setbrg(struct udevice *dev, int baud)
>  	}
>  	ret = clk_set_rate(priv->se, clk_rate);
>  	if (ret < 0) {
>  		pr_err("%s: Couldn't set clock rate: %d\n", __func__, ret);
> -		return ret;
> +		return 0;
>  	}
>  	geni_serial_baud(priv->base, clk_div, baud);
>  
>  	return 0;
> @@ -516,15 +516,14 @@ static int msm_serial_probe(struct udevice *dev)
>  	int ret;
>  	u32 proto;
>  	struct clk *clk;
>  
> -	clk = devm_clk_get(dev, NULL);
> -	if (IS_ERR(clk))
> -		return PTR_ERR(clk);
> -	priv->se = clk;
> +	clk = devm_clk_get_optional(dev, NULL);
> +	if (!IS_ERR(clk))
> +		priv->se = clk;
>  
>  	/* Try enable clock */
> -	ret = clk_enable(clk);
> +	clk_enable(clk);
>  
>  	/* Check if firmware loading is needed (BT UART) */
>  	proto = readl(priv->base + GENI_FW_REVISION_RO);
>  	proto &= FW_REV_PROTOCOL_MSK;
> @@ -546,12 +545,8 @@ static int msm_serial_probe(struct udevice *dev)
>  	/* Don't actually probe non-debug UARTs */
>  	if (ofnode_device_is_compatible(dev_ofnode(dev), "qcom,geni-uart"))
>  		return -ENOENT;
>  
> -	/* Now handle clock enable return value */
> -	if (ret)
> -		return ret;
> -
>  	ret = geni_set_oversampling(dev);
>  	if (ret < 0)
>  		return ret;
>  
> 
> -- 
> 2.51.0
> 
> 

  reply	other threads:[~2026-04-07 11:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 15:45 [PATCH 0/2] qcom: gracefully handle some errors better Casey Connolly
2026-03-20 15:45 ` Casey Connolly via B4 Relay
2026-03-20 15:45 ` [PATCH 1/2] serial: msm-geni: allow invalid clock Casey Connolly
2026-03-20 15:45   ` Casey Connolly via B4 Relay
2026-04-07 11:38   ` Sumit Garg [this message]
2026-04-08  9:16     ` Casey Connolly
2026-04-08 11:35       ` Sumit Garg
2026-03-20 15:45 ` [PATCH 2/2] qcom: rpmh: don't error for SLEEP requests Casey Connolly
2026-03-20 15:45   ` Casey Connolly via B4 Relay
2026-03-24 10:59 ` [PATCH 0/2] qcom: gracefully handle some errors better Casey Connolly

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=adTs0aMJmGrIPKeR@sumit-xelite \
    --to=sumit.garg@kernel.org \
    --cc=andrew.goodbody@linaro.org \
    --cc=casey.connolly@linaro.org \
    --cc=neil.armstrong@linaro.org \
    --cc=swboyd@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.