linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>,
	Serge Semin <fancer.lancer@gmail.com>,
	Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>
Subject: Re: [RFC PATCH] spi: Take the SPI IO-mutex in the spi_setup() method
Date: Fri, 20 Nov 2020 21:35:59 +0000	[thread overview]
Message-ID: <160590815903.48662.5764722048038617376.b4-ty@kernel.org> (raw)
In-Reply-To: <20201117094517.5654-1-Sergey.Semin@baikalelectronics.ru>

On Tue, 17 Nov 2020 12:45:17 +0300, Serge Semin wrote:
> I've discovered that due to the recent commit 49d7d695ca4b ("spi: dw:
> Explicitly de-assert CS on SPI transfer completion") a concurrent usage of
> the spidev devices with different chip-selects causes the "SPI transfer
> timed out" error. The root cause of the problem has turned to be in a race
> condition of the SPI-transfer execution procedure and the spi_setup()
> method being called at the same time. In particular in calling the
> spi_set_cs(false) while there is an SPI-transfer being executed. In my
> case due to the commit cited above all CSs get to be switched off by
> calling the spi_setup() for /dev/spidev0.1 while there is an concurrent
> SPI-transfer execution performed on /dev/spidev0.0. Of course a situation
> of the spi_setup() being called while there is an SPI-transfer being
> executed for two different SPI peripheral devices of the same controller
> may happen not only for the spidev driver, but for instance for MMC SPI +
> some another device, or spi_setup() being called from an SPI-peripheral
> probe method while some other device has already been probed and is being
> used by a corresponding driver...
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: Take the SPI IO-mutex in the spi_setup() method
      commit: 4fae3a58ab59d8a286864d61fe1846283a0316f2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

      parent reply	other threads:[~2020-11-20 21:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  9:45 [RFC PATCH] spi: Take the SPI IO-mutex in the spi_setup() method Serge Semin
2020-11-17 10:56 ` Andy Shevchenko
2020-11-17 11:28   ` Serge Semin
2020-11-18 13:16 ` Mark Brown
2020-11-18 16:29   ` Serge Semin
2020-11-19 18:43     ` Mark Brown
2020-11-19 19:30       ` Geert Uytterhoeven
2020-11-20 17:17 ` Mark Brown
2020-11-20 17:26   ` Serge Semin
2020-11-20 21:35 ` Mark Brown [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=160590815903.48662.5764722048038617376.b4-ty@kernel.org \
    --to=broonie@kernel.org \
    --cc=Alexey.Malahov@baikalelectronics.ru \
    --cc=Pavel.Parkhomenko@baikalelectronics.ru \
    --cc=Ramil.Zaripov@baikalelectronics.ru \
    --cc=Sergey.Semin@baikalelectronics.ru \
    --cc=fancer.lancer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.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;
as well as URLs for NNTP newsgroup(s).