This is a note to let you know that I've just added the patch titled spi: spi-fsl-spi: relax message sanity checking a little to the 4.14-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-spi-fsl-spi-relax-message-sanity-checking-a-little.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 17ecffa289489e8442306bbc62ebb964e235cdad Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes <rasmus.villemoes@xxxxxxxxx> Date: Wed, 27 Mar 2019 14:30:51 +0000 Subject: spi: spi-fsl-spi: relax message sanity checking a little From: Rasmus Villemoes <rasmus.villemoes@xxxxxxxxx> commit 17ecffa289489e8442306bbc62ebb964e235cdad upstream. The comment says that we should not allow changes (to bits_per_word/speed_hz) while CS is active, and indeed the code below does fsl_spi_setup_transfer() when the ->cs_change of the previous spi_transfer was set (and for the very first transfer). So the sanity checking is a bit too strict - we can change it to follow the same logic as is used by the actual transfer loop. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@xxxxxxxxx> Signed-off-by: Mark Brown <broonie@xxxxxxxxxx> Cc: Christophe Leroy <christophe.leroy@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/spi/spi-fsl-spi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/drivers/spi/spi-fsl-spi.c +++ b/drivers/spi/spi-fsl-spi.c @@ -373,13 +373,15 @@ static int fsl_spi_do_one_msg(struct spi } /* Don't allow changes if CS is active */ - first = list_first_entry(&m->transfers, struct spi_transfer, - transfer_list); + cs_change = 1; list_for_each_entry(t, &m->transfers, transfer_list) { + if (cs_change) + first = t; + cs_change = t->cs_change; if ((first->bits_per_word != t->bits_per_word) || (first->speed_hz != t->speed_hz)) { dev_err(&spi->dev, - "bits_per_word/speed_hz should be same for the same SPI transfer\n"); + "bits_per_word/speed_hz cannot change while CS is active\n"); return -EINVAL; } } Patches currently in stable-queue which might be from rasmus.villemoes@xxxxxxxxx are queue-4.14/spi-spi-fsl-spi-relax-message-sanity-checking-a-little.patch queue-4.14/spi-spi-fsl-spi-remove-always-true-conditional-in-fsl_spi_do_one_msg.patch queue-4.14/spi-spi-fsl-spi-allow-changing-bits_per_word-while-cs-is-still-active.patch