mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
spi: don't unoptimize message in spi_async()
Calling spi_maybe_unoptimize_message() in spi_async() is wrong because
the message is likely to be in the queue and not transferred yet. This
can corrupt the message while it is being used by the controller driver.
spi_maybe_unoptimize_message() is already called in the correct place
in spi_finalize_current_message() to balance the call to
spi_maybe_optimize_message() in spi_async().
Fixes: 7b1d87af14
("spi: add spi_optimize_message() APIs")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20240708-spi-mux-fix-v1-1-6c8845193128@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8221545c44
commit
c86a918b1b
@ -4432,8 +4432,6 @@ int spi_async(struct spi_device *spi, struct spi_message *message)
|
||||
|
||||
spin_unlock_irqrestore(&ctlr->bus_lock_spinlock, flags);
|
||||
|
||||
spi_maybe_unoptimize_message(message);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(spi_async);
|
||||
|
Loading…
Reference in New Issue
Block a user