public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Bjorn Andersson <andersson@kernel.org>
Cc: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>,
	konrad.dybcio@linaro.org, bjorn.andersson@linaro.org,
	andi.shyti@kernel.org, wsa@kernel.org,
	linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
	quic_vdadhani@quicinc.com
Subject: Re: [PATCH v1] i2c: i2c-qcom-geni: Parse Error correctly in i2c GSI mode
Date: Sun, 3 Mar 2024 19:42:36 +0530	[thread overview]
Message-ID: <ZeSFVEcA9g2WTyJz@matsya> (raw)
In-Reply-To: <fuggv2kghhxijcljavzsus5uagjiknj5mrzwmqbxbhkyov5t75@smpxbhpdz7cv>

On 01-03-24, 10:37, Bjorn Andersson wrote:
> On Fri, Mar 01, 2024 at 04:56:38PM +0530, Mukesh Kumar Savaliya wrote:
> > we are seeing protocol errors like NACK as transfer failure but
> > ideally it should report exact error like NACK, BUS_PROTO or ARB_LOST.
> > 
> > Hence we are adding such error support in GSI mode and reporting it
> > accordingly by adding respective error logs.
> > 
> > geni_i2c_gpi_xfer() needed to allocate heap based memory instead of
> > stack memory to handle and store the geni_i2c_dev handle.
> > 
> > Copy event status from GSI driver to the i2c device status and parse
> > error when callback comes from gsi driver to the i2c driver. In the
> > gpi.c, we need to store callback param into i2c config data structure
> > so that inside the i2c driver, we can check what exactly the error is
> > and parse it accordingly.
> > 
> > Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA")
> > Co-developed-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
> > Signed-off-by: Viken Dadhaniya <quic_vdadhani@quicinc.com>
> > Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
> > ---
> >  drivers/dma/qcom/gpi.c             | 12 +++++++-
> >  drivers/i2c/busses/i2c-qcom-geni.c | 46 +++++++++++++++++++-----------
> >  include/linux/dma/qcom-gpi-dma.h   |  4 +++
> >  3 files changed, 44 insertions(+), 18 deletions(-)
> > 
> > diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> > index 1c93864e0e4d..6d718916fba4 100644
> > --- a/drivers/dma/qcom/gpi.c
> > +++ b/drivers/dma/qcom/gpi.c
> > @@ -1076,7 +1076,17 @@ static void gpi_process_xfer_compl_event(struct gchan *gchan,
> >  	dev_dbg(gpii->gpi_dev->dev, "Residue %d\n", result.residue);
> >  
> >  	dma_cookie_complete(&vd->tx);
> > -	dmaengine_desc_get_callback_invoke(&vd->tx, &result);
> > +	if (gchan->protocol == QCOM_GPI_I2C) {
> > +		struct dmaengine_desc_callback cb;
> > +		struct gpi_i2c_config *i2c;
> > +
> > +		dmaengine_desc_get_callback(&vd->tx, &cb);
> > +		i2c = cb.callback_param;
> > +		i2c->status = compl_event->status;
> 
> What would the DMA maintainer say about extending struct
> dmaengine_tx_result with some protocol-specific status field?

That would be sane thing to do if we can get protocol status. Most of
the times DMA txn would tell you success or fail, here we have firmware
which tells us this and I see no reason why this can't be propagated.

-- 
~Vinod

  reply	other threads:[~2024-03-03 14:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 11:26 [PATCH v1] i2c: i2c-qcom-geni: Parse Error correctly in i2c GSI mode Mukesh Kumar Savaliya
2024-03-01 16:37 ` Bjorn Andersson
2024-03-03 14:12   ` Vinod Koul [this message]
2024-03-07  9:43     ` Mukesh Kumar Savaliya
2024-03-07  9:59   ` Mukesh Kumar Savaliya
2024-03-01 18:20 ` [SPAM] " Andi Shyti
2024-03-01 18:44 ` Andi Shyti
2024-03-07 10:02   ` Mukesh Kumar Savaliya

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=ZeSFVEcA9g2WTyJz@matsya \
    --to=vkoul@kernel.org \
    --cc=andersson@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_msavaliy@quicinc.com \
    --cc=quic_vdadhani@quicinc.com \
    --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