mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhishek Sahu <absahu@codeaurora.org>
To: Sricharan <sricharan@codeaurora.org>
Cc: agross@codeaurora.org, architt@codeaurora.org,
	linux-arm-msm@vger.kernel.org, ntelkar@codeaurora.org,
	linux-kernel@vger.kernel.org, andy.gross@linaro.org,
	linux-i2c@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, wsa@the-dreams.de
Subject: RE: [PATCH 2/2] i2c: qup: Fixed the DMA segments length
Date: Wed, 11 May 2016 23:13:58 +0530	[thread overview]
Message-ID: <699f798ccc0a7d36640cef42ac26a697@codeaurora.org> (raw)
In-Reply-To: <000b01d1aba0$c2fea380$48fbea80$@codeaurora.org>

On 2016-05-11 21:48, Sricharan wrote:
> Hi,
> 
>> 1. The current QCOM I2C driver code is failing for transfer length 
>> greater
>> than 255. This is happening due to improper segments length as the I2C 
>> DMA
>> segments can be maximum of 256 bytes.
>> 
>> 2. The transfer length tlen was being initialized with 0 for 256 
>> bytes,
>> which is
>> being passed for DMA mappings resulting in improper DMA mapping 
>> length.
>> 
>> This patch fixes the above said problems by initializing the block 
>> count
>> with
>> the values calculated in qup_i2c_set_blk_data and calculating the
> remaining
>> length for last DMA segment. Also, the block data length need to be
>> decremented after each transfer. Additionally, this patch corrects the
>> tlen
>> assignment for DMA mapping.
>> 
>> Signed-off-by: Abhishek Sahu <absahu@codeaurora.org>
>> ---
>>  drivers/i2c/busses/i2c-qup.c | 12 +++++++-----
>>  1 file changed, 7 insertions(+), 5 deletions(-)
>> 
>> diff --git a/drivers/i2c/busses/i2c-qup.c 
>> b/drivers/i2c/busses/i2c-qup.c
>> index
>> 8c2f1bc..6d6b7dc 100644
>> --- a/drivers/i2c/busses/i2c-qup.c
>> +++ b/drivers/i2c/busses/i2c-qup.c
>> @@ -651,23 +651,24 @@ static int qup_i2c_bam_do_xfer(struct
>> qup_i2c_dev *qup, struct i2c_msg *msg,
>>  	u8 *tags;
>> 
>>  	while (idx < num) {
>> -		blocks = (msg->len + limit) / limit;
>> -		rem = msg->len % limit;
>>  		tx_len = 0, len = 0, i = 0;
>> 
>>  		qup->is_last = (idx == (num - 1));
>> 
>>  		qup_i2c_set_blk_data(qup, msg);
>> 
>> +		blocks = qup->blk.count;
>> +		rem = msg->len - (blocks - 1) * limit;
>> +
>       Same if we had blocks = (msg->len + limit - 1) / limit instead of 
> the
> above ?
Yes. We calculating this inside qup_i2c_set_blk_data and assigning the 
same value to
qup->blk.count so I am using this to avoid redundant arithmetic 
operations.
>      Otherwise,
>      Reviewed-by: Sricharan@codeaurora.org
> 
> Regards,
>  Sricharan

-- 
Abhishek Sahu

  reply	other threads:[~2016-05-11 17:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09 12:44 [PATCH 0/2] i2c: qup: Fixed the DMA transfer errors Abhishek Sahu
2016-05-09 12:44 ` [PATCH 1/2] i2c: qup: Cleared the error bits in ISR Abhishek Sahu
2016-05-11 15:57   ` Sricharan
2016-05-11 17:34     ` Abhishek Sahu
2016-05-12  2:28       ` Sricharan
2016-05-12  5:13       ` Andy Gross
2016-05-12  6:18         ` Abhishek Sahu
2016-05-12 17:58           ` Andy Gross
2016-05-12 19:32             ` Abhishek Sahu
2016-05-12 20:05               ` Andy Gross
2016-05-12 20:27                 ` Abhishek Sahu
2016-06-18 16:32                   ` Wolfram Sang
2016-06-20 12:48                     ` Abhishek Sahu
2016-07-15  6:33   ` Wolfram Sang
2016-05-09 12:44 ` [PATCH 2/2] i2c: qup: Fixed the DMA segments length Abhishek Sahu
2016-05-11 16:18   ` Sricharan
2016-05-11 17:43     ` Abhishek Sahu [this message]
2016-07-15  6:38   ` 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=699f798ccc0a7d36640cef42ac26a697@codeaurora.org \
    --to=absahu@codeaurora.org \
    --cc=agross@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=architt@codeaurora.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntelkar@codeaurora.org \
    --cc=sricharan@codeaurora.org \
    --cc=wsa@the-dreams.de \
    /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

Powered by JetHome