public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Marek Vasut <marex@nabladev.com>
Cc: linux-i2c@vger.kernel.org,
	Alain Volmat <alain.volmat@foss.st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH] i2c: stm32f7: Move reinit_completion() to stm32f7_i2c_xfer_core()
Date: Mon, 4 May 2026 10:25:27 +0200	[thread overview]
Message-ID: <afhX9z20oxSZxM6L@ninjato> (raw)
In-Reply-To: <20260502153218.56142-1-marex@nabladev.com>

On Sat, May 02, 2026 at 05:31:54PM +0200, Marek Vasut wrote:
> Currently, the driver may repeatedly call reinit_completion() during
> transfer which contains multiple messages, while another thread is
> waiting for the completion.
> 
> This happens during transfer with more than 1 message, invoked via
> stm32f7_i2c_xfer_core() -> stm32f7_i2c_xfer_msg(). After invoking the
> stm32f7_i2c_xfer_msg() to start transfer, stm32f7_i2c_xfer_core()
> calls wait_for_completion_timeout() to wait for completion of the
> transfer of all messages. When the first message transfer completes,
> the hard IRQ handler triggers, and detects transfer completion, which
> leads to stm32f7_i2c_isr_event_thread() IRQ thread being started. The
> stm32f7_i2c_isr_event_thread() calls stm32f7_i2c_xfer_msg() in case
> there are more messages.
> 
> Without this change, the second and later stm32f7_i2c_xfer_msg() would
> call reinit_completion() on the completion which is still being waited
> for in stm32f7_i2c_xfer_core(). Fix this by moving the reinit_completion()
> into stm32f7_i2c_xfer_core(), together with wait_for_completion_timeout().
> 
> Since stm32f7_i2c_xfer_core() now waits for completion of the entire
> transfer, increase the default timeout. This fixes sporadic transfer
> timeouts on STM32MP25xx during kernel boot.
> 
> Fixes: aeb068c57214 ("i2c: i2c-stm32f7: add driver")
> Signed-off-by: Marek Vasut <marex@nabladev.com>

Reworded $subject a little and applied to for-current, thanks!


      reply	other threads:[~2026-05-04  8:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-02 15:31 [PATCH] i2c: stm32f7: Move reinit_completion() to stm32f7_i2c_xfer_core() Marek Vasut
2026-05-04  8:25 ` Wolfram Sang [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=afhX9z20oxSZxM6L@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=alain.volmat@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andi.shyti@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=marex@nabladev.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=pierre-yves.mordret@foss.st.com \
    /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