linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Radosław Pietrzyk" <radoslaw.pietrzyk@gmail.com>
To: Pierre Yves MORDRET <pierre-yves.mordret@st.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	"open list:I2C SUBSYSTEM" <linux-i2c@vger.kernel.org>,
	"moderated list:ARM/STM32 ARCHITECTURE"
	<linux-arm-kernel@lists.infradead.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] i2c: stm32: Fixes multibyte transfer for STM32F4 I2C controller
Date: Thu, 12 Oct 2017 11:55:45 +0200	[thread overview]
Message-ID: <CAFvLkMS6+o3D88Rj23of56KtjonwFAVD_aEP3eWaA2H=U5WP4Q@mail.gmail.com> (raw)
In-Reply-To: <990c3275-35b3-68da-453c-d1a80e867df7@st.com>

It looks like there is a use case when IRQ handler is delayed a bit
and the logic in the driver does not work. What is the real root cause
I don't know.

2017-10-12 11:31 GMT+02:00 Pierre Yves MORDRET <pierre-yves.mordret@st.com>:
>
>
> On 10/11/2017 01:53 PM, Radoslaw Pietrzyk wrote:
>>       Do not read data on RXNE but on BTF only due to HW
>>       synchronisation problems and NACKing read data too early.
>>       It was found during testing of stmpe811 touchscreen driver.
>>
>
> Would you mind to explain what is behind "hw sync issue" you've seen ?
>
>> Signed-off-by: Radoslaw Pietrzyk <radoslaw.pietrzyk@gmail.com>
>> ---
>>  drivers/i2c/busses/i2c-stm32f4.c | 11 +----------
>>  1 file changed, 1 insertion(+), 10 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
>> index 4ec1084..86bcf4c 100644
>> --- a/drivers/i2c/busses/i2c-stm32f4.c
>> +++ b/drivers/i2c/busses/i2c-stm32f4.c
>> @@ -409,16 +409,9 @@ static void stm32f4_i2c_handle_read(struct stm32f4_i2c_dev *i2c_dev)
>>        * So, here we just disable buffer interrupt in order to avoid another
>>        * system preemption due to RX not empty event.
>>        */
>> -     case 2:
>> -     case 3:
>> +     default:
>>               stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR2_ITBUFEN);
>>               break;
>> -     /*
>> -      * For N byte reception with N > 3 we directly read data register
>> -      * until N-2 data.
>> -      */
>> -     default:
>> -             stm32f4_i2c_read_msg(i2c_dev);
>>       }
>>  }
>>
>> @@ -470,8 +463,6 @@ static void stm32f4_i2c_handle_rx_done(struct stm32f4_i2c_dev *i2c_dev)
>>                */
>>               reg = i2c_dev->base + STM32F4_I2C_CR1;
>>               stm32f4_i2c_clr_bits(reg, STM32F4_I2C_CR1_ACK);
>> -             stm32f4_i2c_read_msg(i2c_dev);
>> -             break;
>>       default:
>>               stm32f4_i2c_read_msg(i2c_dev);
>>       }
>>

  reply	other threads:[~2017-10-12  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 11:53 [PATCH] i2c: stm32: Fixes multibyte transfer for STM32F4 I2C controller Radoslaw Pietrzyk
2017-10-12  9:31 ` Pierre Yves MORDRET
2017-10-12  9:55   ` Radosław Pietrzyk [this message]
2017-10-17 13:18     ` Pierre Yves MORDRET
2017-10-17 13:51       ` Radosław Pietrzyk
2017-10-17 14:35         ` Pierre Yves MORDRET
2017-10-24 11:45           ` Radosław Pietrzyk
2017-12-07 10:52             ` Wolfram Sang
2017-12-07 13:23               ` Pierre Yves MORDRET
2017-12-19  8:37                 ` Radosław Pietrzyk

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='CAFvLkMS6+o3D88Rj23of56KtjonwFAVD_aEP3eWaA2H=U5WP4Q@mail.gmail.com' \
    --to=radoslaw.pietrzyk@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=pierre-yves.mordret@st.com \
    --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;
as well as URLs for NNTP newsgroup(s).