linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: atmel: Downgrade to dev_dbg when dma_request_chan() fails
@ 2020-10-30 12:11 Tudor Ambarus
  2020-10-30 13:48 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Tudor Ambarus @ 2020-10-30 12:11 UTC (permalink / raw)
  To: broonie
  Cc: nicolas.ferre, alexandre.belloni, ludovic.desroches, linux-spi,
	linux-arm-kernel, Tudor Ambarus

The IP's DMA capabilities are described in the SoC dtsi, to spare
users duplicating the DMA bindings in their board device tree. Users
that don't want to use DMA, have to overwrite the DMA bindings in
their board device tree. An example is:
commit ddcdaeb88242 ("ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions")

When the DMA bindings are overwritten, one could see on the console:
atmel_spi fc018400.spi: error -ENODEV: No TX DMA channel, DMA is disabled
atmel_spi fc018400.spi: Atmel SPI Controller using PIO only

Choosing to not use DMA is not a reason to print an error message.
More, the user is already informed when PIO is used: "Atmel SPI Controller
using PIO only". Downgrade to dev_dbg when dma_request_chan() fails.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/spi/spi-atmel.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 0e5e64a80848..948396b382d7 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -512,8 +512,8 @@ static int atmel_spi_configure_dma(struct spi_master *master,
 
 	master->dma_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(master->dma_tx)) {
-		err = dev_err_probe(dev, PTR_ERR(master->dma_tx),
-				    "No TX DMA channel, DMA is disabled\n");
+		err = PTR_ERR(master->dma_tx);
+		dev_dbg(dev, "No TX DMA channel, DMA is disabled\n");
 		goto error_clear;
 	}
 
@@ -524,7 +524,7 @@ static int atmel_spi_configure_dma(struct spi_master *master,
 		 * No reason to check EPROBE_DEFER here since we have already
 		 * requested tx channel.
 		 */
-		dev_err(dev, "No RX DMA channel, DMA is disabled\n");
+		dev_dbg(dev, "No RX DMA channel, DMA is disabled\n");
 		goto error;
 	}
 
-- 
2.25.1


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

* Re: [PATCH] spi: atmel: Downgrade to dev_dbg when dma_request_chan() fails
  2020-10-30 12:11 [PATCH] spi: atmel: Downgrade to dev_dbg when dma_request_chan() fails Tudor Ambarus
@ 2020-10-30 13:48 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2020-10-30 13:48 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: linux-spi, linux-arm-kernel, ludovic.desroches, alexandre.belloni

On Fri, 30 Oct 2020 14:11:16 +0200, Tudor Ambarus wrote:
> The IP's DMA capabilities are described in the SoC dtsi, to spare
> users duplicating the DMA bindings in their board device tree. Users
> that don't want to use DMA, have to overwrite the DMA bindings in
> their board device tree. An example is:
> commit ddcdaeb88242 ("ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions")
> 
> When the DMA bindings are overwritten, one could see on the console:
> atmel_spi fc018400.spi: error -ENODEV: No TX DMA channel, DMA is disabled
> atmel_spi fc018400.spi: Atmel SPI Controller using PIO only
> 
> [...]

Applied to

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

Thanks!

[1/1] spi: atmel: Downgrade to dev_dbg when dma_request_chan() fails
      commit: 23fc86eb2f30fc975e5705bb1a2cf92956d2edd7

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

end of thread, other threads:[~2020-10-30 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 12:11 [PATCH] spi: atmel: Downgrade to dev_dbg when dma_request_chan() fails Tudor Ambarus
2020-10-30 13: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).