linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms
@ 2022-07-21 14:34 Biju Das
  2022-07-21 15:36 ` Geert Uytterhoeven
  2022-07-21 20:38 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Biju Das @ 2022-07-21 14:34 UTC (permalink / raw)
  To: Mark Brown
  Cc: Biju Das, linux-spi, Geert Uytterhoeven, Vinod Koul,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad,
	linux-renesas-soc

RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt
and DMA transfer request. Setting DMARS register for DMA transfer
makes the signal to work as a DMA transfer request signal and
subsequent interrupt requests to the interrupt controller
are masked.

PIO fallback does not work as interrupt signal is disabled.

This patch fixes this issue by re-enabling the interrupts by
calling dmaengine_synchronize().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2->v3:
 * dmaengine_synchronize() called unconditionally and removed need_dmar_clr.
v1->v2:
 * Fixed the typo need_dmar_clr->rspi->ops->need_dmar_clr.
---
 drivers/spi/spi-rspi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c
index 7a014eeec2d0..411b1307b7fd 100644
--- a/drivers/spi/spi-rspi.c
+++ b/drivers/spi/spi-rspi.c
@@ -613,6 +613,10 @@ static int rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
 					       rspi->dma_callbacked, HZ);
 	if (ret > 0 && rspi->dma_callbacked) {
 		ret = 0;
+		if (tx)
+			dmaengine_synchronize(rspi->ctlr->dma_tx);
+		if (rx)
+			dmaengine_synchronize(rspi->ctlr->dma_rx);
 	} else {
 		if (!ret) {
 			dev_err(&rspi->ctlr->dev, "DMA timeout\n");
-- 
2.25.1


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

* Re: [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms
  2022-07-21 14:34 [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms Biju Das
@ 2022-07-21 15:36 ` Geert Uytterhoeven
  2022-07-21 20:38 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-07-21 15:36 UTC (permalink / raw)
  To: Biju Das
  Cc: Mark Brown, linux-spi, Vinod Koul, Chris Paterson, Biju Das,
	Prabhakar Mahadev Lad, Linux-Renesas

On Thu, Jul 21, 2022 at 4:35 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt
> and DMA transfer request. Setting DMARS register for DMA transfer
> makes the signal to work as a DMA transfer request signal and
> subsequent interrupt requests to the interrupt controller
> are masked.
>
> PIO fallback does not work as interrupt signal is disabled.
>
> This patch fixes this issue by re-enabling the interrupts by
> calling dmaengine_synchronize().
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v2->v3:
>  * dmaengine_synchronize() called unconditionally and removed need_dmar_clr.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms
  2022-07-21 14:34 [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms Biju Das
  2022-07-21 15:36 ` Geert Uytterhoeven
@ 2022-07-21 20:38 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-07-21 20:38 UTC (permalink / raw)
  To: Biju Das
  Cc: linux-spi, Biju Das, Geert Uytterhoeven, Prabhakar Mahadev Lad,
	linux-renesas-soc, Vinod Koul, Chris Paterson

On Thu, 21 Jul 2022 15:34:49 +0100, Biju Das wrote:
> RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt
> and DMA transfer request. Setting DMARS register for DMA transfer
> makes the signal to work as a DMA transfer request signal and
> subsequent interrupt requests to the interrupt controller
> are masked.
> 
> PIO fallback does not work as interrupt signal is disabled.
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: spi-rspi: Fix PIO fallback on RZ platforms
      commit: b620aa3a7be346f04ae7789b165937615c6ee8d3

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:[~2022-07-21 20:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-21 14:34 [PATCH v3] spi: spi-rspi: Fix PIO fallback on RZ platforms Biju Das
2022-07-21 15:36 ` Geert Uytterhoeven
2022-07-21 20:38 ` 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).