All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported
@ 2022-10-26 15:56 Jon Hunter
  2022-10-28 11:22 ` Thierry Reding
  2022-10-28 18:41 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Hunter @ 2022-10-26 15:56 UTC (permalink / raw)
  To: Thierry Reding, Mark Brown, Sumit Semwal
  Cc: linux-tegra, linux-spi, Krishna Yarlagadda, Jon Hunter

The following error messages are observed on boot for Tegra234 ...

 ERR KERN tegra-qspi 3270000.spi: cannot use DMA: -19
 ERR KERN tegra-qspi 3270000.spi: falling back to PIO

Tegra234 does not support DMA for the QSPI and so initialising the DMA
is expected to fail. The above error messages are misleading for devices
that don't support DMA and so fix this by skipping the DMA
initialisation for devices that don't support DMA.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/spi/spi-tegra210-quad.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-tegra210-quad.c b/drivers/spi/spi-tegra210-quad.c
index 904972606bd4..10f0c5a6e0dc 100644
--- a/drivers/spi/spi-tegra210-quad.c
+++ b/drivers/spi/spi-tegra210-quad.c
@@ -720,6 +720,9 @@ static int tegra_qspi_start_cpu_based_transfer(struct tegra_qspi *qspi, struct s
 
 static void tegra_qspi_deinit_dma(struct tegra_qspi *tqspi)
 {
+	if (!tqspi->soc_data->has_dma)
+		return;
+
 	if (tqspi->tx_dma_buf) {
 		dma_free_coherent(tqspi->dev, tqspi->dma_buf_size,
 				  tqspi->tx_dma_buf, tqspi->tx_dma_phys);
@@ -750,6 +753,9 @@ static int tegra_qspi_init_dma(struct tegra_qspi *tqspi)
 	u32 *dma_buf;
 	int err;
 
+	if (!tqspi->soc_data->has_dma)
+		return 0;
+
 	dma_chan = dma_request_chan(tqspi->dev, "rx");
 	if (IS_ERR(dma_chan)) {
 		err = PTR_ERR(dma_chan);
-- 
2.25.1


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

* Re: [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported
  2022-10-26 15:56 [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported Jon Hunter
@ 2022-10-28 11:22 ` Thierry Reding
  2022-10-28 18:41 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2022-10-28 11:22 UTC (permalink / raw)
  To: Jon Hunter
  Cc: Mark Brown, Sumit Semwal, linux-tegra, linux-spi, Krishna Yarlagadda

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

On Wed, Oct 26, 2022 at 04:56:33PM +0100, Jon Hunter wrote:
> The following error messages are observed on boot for Tegra234 ...
> 
>  ERR KERN tegra-qspi 3270000.spi: cannot use DMA: -19
>  ERR KERN tegra-qspi 3270000.spi: falling back to PIO
> 
> Tegra234 does not support DMA for the QSPI and so initialising the DMA
> is expected to fail. The above error messages are misleading for devices
> that don't support DMA and so fix this by skipping the DMA
> initialisation for devices that don't support DMA.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/spi/spi-tegra210-quad.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Acked-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported
  2022-10-26 15:56 [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported Jon Hunter
  2022-10-28 11:22 ` Thierry Reding
@ 2022-10-28 18:41 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-10-28 18:41 UTC (permalink / raw)
  To: Thierry Reding, Jon Hunter, Sumit Semwal
  Cc: linux-spi, Krishna Yarlagadda, linux-tegra

On Wed, 26 Oct 2022 16:56:33 +0100, Jon Hunter wrote:
> The following error messages are observed on boot for Tegra234 ...
> 
>  ERR KERN tegra-qspi 3270000.spi: cannot use DMA: -19
>  ERR KERN tegra-qspi 3270000.spi: falling back to PIO
> 
> Tegra234 does not support DMA for the QSPI and so initialising the DMA
> is expected to fail. The above error messages are misleading for devices
> that don't support DMA and so fix this by skipping the DMA
> initialisation for devices that don't support DMA.
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: tegra210-quad: Don't initialise DMA if not supported
      commit: ae4b3c1252f0fd0951d2f072a02ba46cac8d6c92

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-10-28 18:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-26 15:56 [PATCH] spi: tegra210-quad: Don't initialise DMA if not supported Jon Hunter
2022-10-28 11:22 ` Thierry Reding
2022-10-28 18:41 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.