linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: fsi: Fix transfer returning without finalizing message
@ 2020-11-10 21:47 Eddie James
  2020-11-11  0:43 ` Joel Stanley
  2020-11-11 15:48 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Eddie James @ 2020-11-10 21:47 UTC (permalink / raw)
  To: linux-spi; +Cc: linux-kernel, joel, broonie, eajames

In the case that the SPI mux isn't set, the transfer_one_message
function returns without finalizing the message. This means that
the transfer never completes, resulting in hung tasks and an
eventual kernel panic. Fix it by finalizing the transfer in this
case.

Fixes: 9211a441e606 ("spi: fsi: Check mux status before transfers")
Signed-off-by: Eddie James <eajames@linux.ibm.com>
---
 drivers/spi/spi-fsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
index 8a440c7078ef..3920cd3286d8 100644
--- a/drivers/spi/spi-fsi.c
+++ b/drivers/spi/spi-fsi.c
@@ -477,7 +477,7 @@ static int fsi_spi_transfer_one_message(struct spi_controller *ctlr,
 
 	rc = fsi_spi_check_mux(ctx->fsi, ctx->dev);
 	if (rc)
-		return rc;
+		goto error;
 
 	list_for_each_entry(transfer, &mesg->transfers, transfer_list) {
 		struct fsi_spi_sequence seq;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: fsi: Fix transfer returning without finalizing message
  2020-11-10 21:47 [PATCH] spi: fsi: Fix transfer returning without finalizing message Eddie James
@ 2020-11-11  0:43 ` Joel Stanley
  2020-11-11 15:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Joel Stanley @ 2020-11-11  0:43 UTC (permalink / raw)
  To: Eddie James; +Cc: linux-spi, Linux Kernel Mailing List, Mark Brown

On Tue, 10 Nov 2020 at 21:47, Eddie James <eajames@linux.ibm.com> wrote:
>
> In the case that the SPI mux isn't set, the transfer_one_message
> function returns without finalizing the message. This means that
> the transfer never completes, resulting in hung tasks and an
> eventual kernel panic. Fix it by finalizing the transfer in this
> case.
>
> Fixes: 9211a441e606 ("spi: fsi: Check mux status before transfers")
> Signed-off-by: Eddie James <eajames@linux.ibm.com>

Reviewed-by: Joel Stanley <joel@jms.id.au>

> ---
>  drivers/spi/spi-fsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-fsi.c b/drivers/spi/spi-fsi.c
> index 8a440c7078ef..3920cd3286d8 100644
> --- a/drivers/spi/spi-fsi.c
> +++ b/drivers/spi/spi-fsi.c
> @@ -477,7 +477,7 @@ static int fsi_spi_transfer_one_message(struct spi_controller *ctlr,
>
>         rc = fsi_spi_check_mux(ctx->fsi, ctx->dev);
>         if (rc)
> -               return rc;
> +               goto error;
>
>         list_for_each_entry(transfer, &mesg->transfers, transfer_list) {
>                 struct fsi_spi_sequence seq;
> --
> 2.26.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: fsi: Fix transfer returning without finalizing message
  2020-11-10 21:47 [PATCH] spi: fsi: Fix transfer returning without finalizing message Eddie James
  2020-11-11  0:43 ` Joel Stanley
@ 2020-11-11 15:48 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-11-11 15:48 UTC (permalink / raw)
  To: Eddie James, linux-spi; +Cc: joel, linux-kernel

On Tue, 10 Nov 2020 15:47:36 -0600, Eddie James wrote:
> In the case that the SPI mux isn't set, the transfer_one_message
> function returns without finalizing the message. This means that
> the transfer never completes, resulting in hung tasks and an
> eventual kernel panic. Fix it by finalizing the transfer in this
> case.

Applied to

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

Thanks!

[1/1] spi: fsi: Fix transfer returning without finalizing message
      commit: ee4ad5d06509b3aea79b6a77bebd09ef891bed8d

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-11 15:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10 21:47 [PATCH] spi: fsi: Fix transfer returning without finalizing message Eddie James
2020-11-11  0:43 ` Joel Stanley
2020-11-11 15:48 ` Mark Brown

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).