mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
To: Andi Shyti <andi.shyti@kernel.org>
Cc: <konrad.dybcio@linaro.org>, <bjorn.andersson@linaro.org>,
	<vkoul@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: Thu, 7 Mar 2024 15:32:59 +0530	[thread overview]
Message-ID: <9769c51f-a672-4ec9-b1c8-d8022f1988f5@quicinc.com> (raw)
In-Reply-To: <2wala6lz4vanhvfx6jtpdexnpohabuvhzt4i7kt2xvmlfrapq4@tmvl37npj7jy>



On 3/2/2024 12:14 AM, Andi Shyti wrote:
> Hi Mukesh,
> 
> (I'm sorry for the noise but my mail server has marked this mail
> as spam and put the spam tag in front of the subject. Therefore,
> my reply might have been marked as spam.)
> 
> I'm going to send a new e-mail with the old answers.
> 

Sure, no problem. Sorry for the late reply.

> 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
> 
> /we/We/
> 

Done

>> 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
> 
> Please use the imperative form.
> 

Thanks. New patch uploaded which doesn't need memory allocation dynamically.

>> 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")
> 
> What bug are you fixing here? The description doesn't talk about
> fixes rather than support added.
> 

Updated commit log in a latest patch. Basically we are getting simple
transfer error which ideally should be NACK error. This happens while
running scan test for devices.

> ...
> 
>> -	config.peripheral_config = &peripheral;
>> -	config.peripheral_size = sizeof(peripheral);
>> +	peripheral = devm_kzalloc(gi2c->se.dev, sizeof(*peripheral), GFP_KERNEL);
>> +	if (!peripheral)
>> +		return -ENOMEM;
> 
> This is a massive leak. Why are you deciding to make the
> allocation dynamic?
> 

Agree, It's a memory leak. Thanks for catching BUG. Considered other 
approach which doesn't need new structure and dynamic memory allocation.

> Thanks,
> Andi
> 

      reply	other threads:[~2024-03-07 10:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 11:26 Mukesh Kumar Savaliya
2024-03-01 16:37 ` Bjorn Andersson
2024-03-03 14:12   ` Vinod Koul
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 [this message]

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=9769c51f-a672-4ec9-b1c8-d8022f1988f5@quicinc.com \
    --to=quic_msavaliy@quicinc.com \
    --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_vdadhani@quicinc.com \
    --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

all inboxes | Powered by JetHome®