stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Anup Kulkarni <quic_anupkulk@quicinc.com>
Cc: kernel@oss.qualcomm.com, periph.upstream.reviewers@quicinc.com,
	quic_msavaliy@quicinc.com, quic_vdadhani@quicinc.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v4] tty: serial: qcom_geni_serial: Improve error handling for RS485 mode
Date: Tue, 19 Aug 2025 13:02:29 +0200	[thread overview]
Message-ID: <2025081912-exerciser-universal-f920@gregkh> (raw)
In-Reply-To: <20250818105918.1012694-1-quic_anupkulk@quicinc.com>

On Mon, Aug 18, 2025 at 04:29:18PM +0530, Anup Kulkarni wrote:
> Fix  error handling issues of  `uart_get_rs485_mode()` function by
> reordering resources_init() to occur after uart_get_rs485_mode.

What exactly is wrong with the current code?

> Remove multiple goto paths and use dev_err_probe to simplify error
> paths.

Don't mix fixes with cleanups please.  Shouldn't this be 2 patches?


> 
> Fixes: 4fcc287f3c69 ("serial: qcom-geni: Enable support for half-duplex mode")
> Cc: stable@vger.kernel.org
> Signed-off-by: Anup Kulkarni <quic_anupkulk@quicinc.com>
> ---
> v3->v4
> - Added Fixes and Cc tag.
> 
> v2->v3
> - Reordered the function resources_init.
> - Removed goto.
> - Added dev_err_probe.
> 
> v1->v2
> - Updated commit message.
> ---
>  drivers/tty/serial/qcom_geni_serial.c | 38 ++++++++++-----------------
>  1 file changed, 14 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 32ec632fd080..be998dd45968 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1882,15 +1882,9 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
>  	port->se.dev = &pdev->dev;
>  	port->se.wrapper = dev_get_drvdata(pdev->dev.parent);
>  
> -	ret = port->dev_data->resources_init(uport);
> -	if (ret)
> -		return ret;
> -
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	if (!res) {
> -		ret = -EINVAL;
> -		goto error;
> -	}
> +	if (!res)
> +		return -EINVAL;

But now you are not calling the stuff that was previously at error:, are
you sure that is ok?  If so, why?

>  
>  	uport->mapbase = res->start;
>  
> @@ -1903,25 +1897,19 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
>  	if (!data->console) {
>  		port->rx_buf = devm_kzalloc(uport->dev,
>  					    DMA_RX_BUF_SIZE, GFP_KERNEL);
> -		if (!port->rx_buf) {
> -			ret = -ENOMEM;
> -			goto error;
> -		}
> +		if (!port->rx_buf)
> +			return -ENOMEM;

Same here.

As you are mixing different things in the same patch, it's hard to find
the original "bug" you are attempting to solve here.  I can't see it...

Please redo this as a patch series.

thanks,

greg k-h

  reply	other threads:[~2025-08-19 11:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 10:59 [PATCH v4] tty: serial: qcom_geni_serial: Improve error handling for RS485 mode Anup Kulkarni
2025-08-19 11:02 ` Greg KH [this message]
2025-08-21 10:05   ` Anup Kulkarni

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=2025081912-exerciser-universal-f920@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=kernel@oss.qualcomm.com \
    --cc=periph.upstream.reviewers@quicinc.com \
    --cc=quic_anupkulk@quicinc.com \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_vdadhani@quicinc.com \
    --cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).