linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* spi: *: Call the dedicated transfer completion function.
@ 2021-01-07 23:58 Vincent Pelletier
  2021-01-07 23:58 ` [1/3] spi: bcm2835: " Vincent Pelletier
  0 siblings, 1 reply; 6+ messages in thread
From: Vincent Pelletier @ 2021-01-07 23:58 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, linux-spi, linux-rockchip,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	linux-rpi-kernel

Hello,

I started this fix on bcm2835.c and, because of its simplicity, thought
I should check other controllers as well.
This patch set should fix all occurrences, as of v5.11-rc2, of an SPI
controller driver calling
  complete(&...->xfer_completion);
when it could call
  spi_finalize_current_transfer(...);
as requested in Documentation/spi/spi-summary.rst .

While I did build all modified files, and these should be trivial to
check for correctness, I have not exercised all codepaths.
I have exercised spi-bcm2835 IRQ and DMA tx, but I am still hunting
for another issue which causes completion timeouts at spi/spi.c level
which seem to affect spi-bcm2835 dma transfers (both before and after
this patch set).

Regards,
Vincent Pelletier



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

* [1/3] spi: bcm2835: Call the dedicated transfer completion function.
  2021-01-07 23:58 spi: *: Call the dedicated transfer completion function Vincent Pelletier
@ 2021-01-07 23:58 ` Vincent Pelletier
  2021-01-07 23:58   ` [2/3] spi: bcm2835aux: " Vincent Pelletier
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vincent Pelletier @ 2021-01-07 23:58 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, linux-spi, linux-rockchip,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	linux-rpi-kernel

spi_finalize_current_transfer currently only calls "complete", so no
functional change is expected.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
---
 drivers/spi/spi-bcm2835.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c
index 197485f2c2b2..dbadbc4638e9 100644
--- a/drivers/spi/spi-bcm2835.c
+++ b/drivers/spi/spi-bcm2835.c
@@ -386,7 +386,7 @@ static irqreturn_t bcm2835_spi_interrupt(int irq, void *dev_id)
 		/* Transfer complete - reset SPI HW */
 		bcm2835_spi_reset_hw(bs);
 		/* wake up the framework */
-		complete(&bs->ctlr->xfer_completion);
+		spi_finalize_current_transfer(bs->ctlr);
 	}
 
 	return IRQ_HANDLED;
@@ -608,7 +608,7 @@ static void bcm2835_spi_dma_rx_done(void *data)
 	bcm2835_spi_reset_hw(bs);
 
 	/* and mark as completed */;
-	complete(&ctlr->xfer_completion);
+	spi_finalize_current_transfer(ctlr);
 }
 
 /**
@@ -640,7 +640,7 @@ static void bcm2835_spi_dma_tx_done(void *data)
 
 	bcm2835_spi_undo_prologue(bs);
 	bcm2835_spi_reset_hw(bs);
-	complete(&ctlr->xfer_completion);
+	spi_finalize_current_transfer(ctlr);
 }
 
 /**
-- 
2.30.0


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

* [2/3] spi: bcm2835aux: Call the dedicated transfer completion function.
  2021-01-07 23:58 ` [1/3] spi: bcm2835: " Vincent Pelletier
@ 2021-01-07 23:58   ` Vincent Pelletier
  2021-01-14 16:48     ` Mark Brown
  2021-01-07 23:58   ` [3/3] spi: rockchip: " Vincent Pelletier
  2021-01-14 16:48   ` [1/3] spi: bcm2835: " Mark Brown
  2 siblings, 1 reply; 6+ messages in thread
From: Vincent Pelletier @ 2021-01-07 23:58 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, linux-spi, linux-rockchip,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	linux-rpi-kernel

spi_finalize_current_transfer currently only calls "complete", so no
functional change is expected.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
---
 drivers/spi/spi-bcm2835aux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c
index 1a26865c42f8..75589ac6e95f 100644
--- a/drivers/spi/spi-bcm2835aux.c
+++ b/drivers/spi/spi-bcm2835aux.c
@@ -254,7 +254,7 @@ static irqreturn_t bcm2835aux_spi_interrupt(int irq, void *dev_id)
 	/* and if rx_len is 0 then disable interrupts and wake up completion */
 	if (!bs->rx_len) {
 		bcm2835aux_wr(bs, BCM2835_AUX_SPI_CNTL1, bs->cntl[1]);
-		complete(&master->xfer_completion);
+		spi_finalize_current_transfer(master);
 	}
 
 	return IRQ_HANDLED;
-- 
2.30.0


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

* [3/3] spi: rockchip: Call the dedicated transfer completion function.
  2021-01-07 23:58 ` [1/3] spi: bcm2835: " Vincent Pelletier
  2021-01-07 23:58   ` [2/3] spi: bcm2835aux: " Vincent Pelletier
@ 2021-01-07 23:58   ` Vincent Pelletier
  2021-01-14 16:48   ` [1/3] spi: bcm2835: " Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Vincent Pelletier @ 2021-01-07 23:58 UTC (permalink / raw)
  To: Mark Brown, Heiko Stuebner, linux-spi, linux-rockchip,
	Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	linux-rpi-kernel

spi_finalize_current_transfer currently only calls "complete", so no
functional change is expected.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
---
 drivers/spi/spi-rockchip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 09d8e92400eb..936ef54e0903 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -566,7 +566,7 @@ static int rockchip_spi_slave_abort(struct spi_controller *ctlr)
 	struct rockchip_spi *rs = spi_controller_get_devdata(ctlr);
 
 	rs->slave_abort = true;
-	complete(&ctlr->xfer_completion);
+	spi_finalize_current_transfer(ctlr);
 
 	return 0;
 }
-- 
2.30.0


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

* Re: [2/3] spi: bcm2835aux: Call the dedicated transfer completion function.
  2021-01-07 23:58   ` [2/3] spi: bcm2835aux: " Vincent Pelletier
@ 2021-01-14 16:48     ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-01-14 16:48 UTC (permalink / raw)
  To: Vincent Pelletier, Nicolas Saenz Julienne, linux-spi, Ray Jui,
	linux-rpi-kernel, Florian Fainelli, linux-rockchip,
	Heiko Stuebner, Scott Branden

On Thu, 7 Jan 2021 23:58:31 +0000, Vincent Pelletier wrote:
> spi_finalize_current_transfer currently only calls "complete", so no
> functional change is expected.

Applied to

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

Thanks!

[2/3] spi: bcm2835aux: Call the dedicated transfer completion function.
      commit: 7dfa69af2b5a57fcd48c96752818c1fa9925a8de

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] 6+ messages in thread

* Re: [1/3] spi: bcm2835: Call the dedicated transfer completion function.
  2021-01-07 23:58 ` [1/3] spi: bcm2835: " Vincent Pelletier
  2021-01-07 23:58   ` [2/3] spi: bcm2835aux: " Vincent Pelletier
  2021-01-07 23:58   ` [3/3] spi: rockchip: " Vincent Pelletier
@ 2021-01-14 16:48   ` Mark Brown
  2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2021-01-14 16:48 UTC (permalink / raw)
  To: Vincent Pelletier, Nicolas Saenz Julienne, linux-spi, Ray Jui,
	linux-rpi-kernel, Florian Fainelli, linux-rockchip,
	Heiko Stuebner, Scott Branden

On Thu, 7 Jan 2021 23:58:30 +0000, Vincent Pelletier wrote:
> spi_finalize_current_transfer currently only calls "complete", so no
> functional change is expected.

Applied to

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

Thanks!

[1/3] spi: bcm2835: Call the dedicated transfer completion function.
      commit: ccae0b408ba08203d5f50a301b105284374217a5
[3/3] spi: rockchip: Call the dedicated transfer completion function.
      commit: 6bd2c867cd6e03d88dfa21f9fc8c610159061152

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] 6+ messages in thread

end of thread, other threads:[~2021-01-14 16:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 23:58 spi: *: Call the dedicated transfer completion function Vincent Pelletier
2021-01-07 23:58 ` [1/3] spi: bcm2835: " Vincent Pelletier
2021-01-07 23:58   ` [2/3] spi: bcm2835aux: " Vincent Pelletier
2021-01-14 16:48     ` Mark Brown
2021-01-07 23:58   ` [3/3] spi: rockchip: " Vincent Pelletier
2021-01-14 16:48   ` [1/3] spi: bcm2835: " 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).