linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Konrad Dybcio <konrad.dybcio@somainline.org>,
	Wolfram Sang <wsa@kernel.org>,
	linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] i2c: qcom-geni: Use the correct return value
Date: Mon, 18 Jul 2022 17:28:24 -0500	[thread overview]
Message-ID: <YtXeiKWhFtldI2eE@baldur> (raw)
In-Reply-To: <YtTxR/X5+UZW9pZZ@matsya>

On Mon 18 Jul 00:36 CDT 2022, Vinod Koul wrote:

> On 16-07-22, 20:50, Bjorn Andersson wrote:
> > The introduction of GPI support moved things around and instead of
> > returning the result from geni_i2c_xfer() the number of messages in the
> > request was returned, ignoring the actual result. Fix this.
> 
> Thanks for the fix, looking at master_xfer() it does expect error
> return, so look good with one nit:
> 
> > 
> > Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA")
> > Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> > ---
> >  drivers/i2c/busses/i2c-qcom-geni.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
> > index 6ac402ea58fb..3bec7c782824 100644
> > --- a/drivers/i2c/busses/i2c-qcom-geni.c
> > +++ b/drivers/i2c/busses/i2c-qcom-geni.c
> > @@ -688,7 +688,7 @@ static int geni_i2c_xfer(struct i2c_adapter *adap,
> >  	pm_runtime_put_autosuspend(gi2c->se.dev);
> >  	gi2c->cur = NULL;
> >  	gi2c->err = 0;
> 
> Unrelated, should gi2c->err be set to ret here..?
> 

When we reach this point we have concluded the current transfer
(successfully or not...), so I believe that the purpose of this line is
to clear the "error state" that might have occurred during that transfer.

I believe this line could be removed, as the first step in a transfer is
to clear the error state again. But as you suggest this is separate to
the proposed change.


May I have a R-b?

Regards,
Bjorn

> > -	return num;
> > +	return ret;
> >  }
> >  
> >  static u32 geni_i2c_func(struct i2c_adapter *adap)
> > -- 
> > 2.35.1
> 
> -- 
> ~Vinod

  reply	other threads:[~2022-07-18 22:28 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17  3:50 [PATCH 0/3] i2c: qcom-geni: Make it possible to run i2cdetect Bjorn Andersson
2022-07-17  3:50 ` [PATCH 1/3] i2c: qcom-geni: Use the correct return value Bjorn Andersson
2022-07-18  5:36   ` Vinod Koul
2022-07-18 22:28     ` Bjorn Andersson [this message]
2022-07-19 20:36   ` Andrew Halaney
2022-07-20  4:31   ` Vinod Koul
2022-07-24  5:04   ` Wolfram Sang
2022-07-24  7:30     ` Johan Hovold
2022-07-24 18:37       ` Wolfram Sang
2022-07-24 18:39     ` Wolfram Sang
2022-07-17  3:50 ` [PATCH 2/3] i2c: qcom-geni: Propagate GENI_ABORT_DONE to geni_i2c_abort_xfer() Bjorn Andersson
2022-07-18  5:36   ` Vinod Koul
2022-07-19 20:50   ` Andrew Halaney
2022-07-19 20:57     ` Andrew Halaney
2022-07-24  5:15       ` Wolfram Sang
2022-07-24  5:15   ` Wolfram Sang
2022-07-17  3:50 ` [PATCH 3/3] i2c: qcom-geni: Silence NACK and GENI_TIMEOUT Bjorn Andersson
2022-07-18  5:37   ` Vinod Koul
2022-07-24  5:23   ` Wolfram Sang

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=YtXeiKWhFtldI2eE@baldur \
    --to=bjorn.andersson@linaro.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    --cc=wsa@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).