public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
To: Wentao Liang <vulab@iscas.ac.cn>, <andi.shyti@kernel.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>
Subject: Re: [PATCH] i2c: qup: Add error handling in qup_i2c_xfer_v2()
Date: Tue, 20 May 2025 16:46:43 +0530	[thread overview]
Message-ID: <a2ff429f-cc49-403f-9f2d-6a6b6361044d@quicinc.com> (raw)
In-Reply-To: <20250519141918.2522-1-vulab@iscas.ac.cn>



On 5/19/2025 7:49 PM, Wentao Liang wrote:
> The qup_i2c_xfer_v2() calls the qup_i2c_change_state() but does
> not check its return value. A proper implementation can be
> found in qup_i2c_xfer().
> 
> Add error handling for qup_i2c_change_state(). If the function
> fails, return the error code.
> 
> Fixes: 7545c7dba169 ("i2c: qup: reorganization of driver code to remove polling for qup v2")
> Cc: stable@vger.kernel.org # v4.17
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
>   drivers/i2c/busses/i2c-qup.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
> index da20b4487c9a..2477f570fe86 100644
> --- a/drivers/i2c/busses/i2c-qup.c
> +++ b/drivers/i2c/busses/i2c-qup.c
> @@ -1538,7 +1538,7 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
>   			   int num)
>   {
>   	struct qup_i2c_dev *qup = i2c_get_adapdata(adap);
> -	int ret, idx = 0;
> +	int ret, err, idx = 0;
>   
>   	qup->bus_err = 0;
>   	qup->qup_err = 0;
> @@ -1588,7 +1588,9 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
>   		ret = qup_i2c_bus_active(qup, ONE_BYTE);
>   
>   	if (!ret)
> -		qup_i2c_change_state(qup, QUP_RESET_STATE);
> +		err = qup_i2c_change_state(qup, QUP_RESET_STATE);
> +	if (err)
> +		return err;
Is there an error seen around this ? Expecting this to work as is.
After an error, what next ? Just return back to framework ?
>   
>   	if (ret == 0)
>   		ret = num;


  parent reply	other threads:[~2025-05-20 11:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-19 14:19 [PATCH] i2c: qup: Add error handling in qup_i2c_xfer_v2() Wentao Liang
2025-05-20  8:41 ` Andi Shyti
2025-05-20 11:16 ` Mukesh Kumar Savaliya [this message]
2025-05-20 11:51   ` Andi Shyti
2025-05-20 20:30 ` kernel test robot
2025-05-23  9:46 ` Dan Carpenter

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=a2ff429f-cc49-403f-9f2d-6a6b6361044d@quicinc.com \
    --to=quic_msavaliy@quicinc.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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