This is a note to let you know that I've just added the patch titled spi: don't unoptimize message in spi_async() to the 6.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: spi-don-t-unoptimize-message-in-spi_async.patch and it can be found in the queue-6.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit e886397569fa772a6773c21fb29fed1cd5866dc3 Author: David Lechner <dlechner@xxxxxxxxxxxx> Date: Mon Jul 8 20:05:28 2024 -0500 spi: don't unoptimize message in spi_async() [ Upstream commit c86a918b1bdba78fb155184f8d88dfba1e63335d ] 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: 7b1d87af14d9 ("spi: add spi_optimize_message() APIs") Signed-off-by: David Lechner <dlechner@xxxxxxxxxxxx> Link: https://patch.msgid.link/20240708-spi-mux-fix-v1-1-6c8845193128@xxxxxxxxxxxx Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c349d6012625a..a1958e86f75c8 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -4423,8 +4423,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);