All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
@ 2024-01-10  8:54 ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2024-01-10  8:54 UTC (permalink / raw)
  To: Mark Brown, Shawn Guo, Sascha Hauer, Fabio Estevam
  Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
	linux-spi, linux-arm-kernel

If dma_request_chan() fails, no error is shown nor any information is
shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
Use dev_err_probe to fix both problems.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Sorry, I lost sight of the replies from v1 series. I'll address Fabio's
concern here instead.

It's true that running spi-imx with SDMA is valid. But if provided DMA
channels are not available, aka -EPROBE_DEFER, there is no information
why so. This can simply be seen by disabling the sdma1 node on imx8mp:
$ cat /sys/kernel/debug/devices_deferred 
30820000.spi
30830000.spi
30840000.spi

There is no indication what is wrong/missing here. There is also no fallback
to pio mode.
This patch addresses this by setting the defer probe reason.

Changes in v2:
* Rebase to next-20240110

[1] https://lore.kernel.org/all/CAOMZO5CcD5iDkaempdxnQHx1fAgnXAmMq_0MdEq5wNgOLHcMuw@mail.gmail.com/

 drivers/spi/spi-imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 272bc871a848b..546cdce525fc5 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1344,7 +1344,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
 	controller->dma_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(controller->dma_tx)) {
 		ret = PTR_ERR(controller->dma_tx);
-		dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret);
+		dev_err_probe(dev, ret, "can't get the TX DMA channel!\n");
 		controller->dma_tx = NULL;
 		goto err;
 	}
@@ -1353,7 +1353,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
 	controller->dma_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(controller->dma_rx)) {
 		ret = PTR_ERR(controller->dma_rx);
-		dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret);
+		dev_err_probe(dev, ret, "can't get the RX DMA channel!\n");
 		controller->dma_rx = NULL;
 		goto err;
 	}
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
@ 2024-01-10  8:54 ` Alexander Stein
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Stein @ 2024-01-10  8:54 UTC (permalink / raw)
  To: Mark Brown, Shawn Guo, Sascha Hauer, Fabio Estevam
  Cc: Alexander Stein, Pengutronix Kernel Team, NXP Linux Team,
	linux-spi, linux-arm-kernel

If dma_request_chan() fails, no error is shown nor any information is
shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
Use dev_err_probe to fix both problems.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
Sorry, I lost sight of the replies from v1 series. I'll address Fabio's
concern here instead.

It's true that running spi-imx with SDMA is valid. But if provided DMA
channels are not available, aka -EPROBE_DEFER, there is no information
why so. This can simply be seen by disabling the sdma1 node on imx8mp:
$ cat /sys/kernel/debug/devices_deferred 
30820000.spi
30830000.spi
30840000.spi

There is no indication what is wrong/missing here. There is also no fallback
to pio mode.
This patch addresses this by setting the defer probe reason.

Changes in v2:
* Rebase to next-20240110

[1] https://lore.kernel.org/all/CAOMZO5CcD5iDkaempdxnQHx1fAgnXAmMq_0MdEq5wNgOLHcMuw@mail.gmail.com/

 drivers/spi/spi-imx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 272bc871a848b..546cdce525fc5 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -1344,7 +1344,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
 	controller->dma_tx = dma_request_chan(dev, "tx");
 	if (IS_ERR(controller->dma_tx)) {
 		ret = PTR_ERR(controller->dma_tx);
-		dev_dbg(dev, "can't get the TX DMA channel, error %d!\n", ret);
+		dev_err_probe(dev, ret, "can't get the TX DMA channel!\n");
 		controller->dma_tx = NULL;
 		goto err;
 	}
@@ -1353,7 +1353,7 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx,
 	controller->dma_rx = dma_request_chan(dev, "rx");
 	if (IS_ERR(controller->dma_rx)) {
 		ret = PTR_ERR(controller->dma_rx);
-		dev_dbg(dev, "can't get the RX DMA channel, error %d\n", ret);
+		dev_err_probe(dev, ret, "can't get the RX DMA channel!\n");
 		controller->dma_rx = NULL;
 		goto err;
 	}
-- 
2.34.1


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

* Re: [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
  2024-01-10  8:54 ` Alexander Stein
@ 2024-01-10  9:07   ` Francesco Dolcini
  -1 siblings, 0 replies; 6+ messages in thread
From: Francesco Dolcini @ 2024-01-10  9:07 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Mark Brown, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, linux-spi,
	linux-arm-kernel

On Wed, Jan 10, 2024 at 09:54:03AM +0100, Alexander Stein wrote:
> If dma_request_chan() fails, no error is shown nor any information is
> shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
> Use dev_err_probe to fix both problems.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>


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

* Re: [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
@ 2024-01-10  9:07   ` Francesco Dolcini
  0 siblings, 0 replies; 6+ messages in thread
From: Francesco Dolcini @ 2024-01-10  9:07 UTC (permalink / raw)
  To: Alexander Stein
  Cc: Mark Brown, Shawn Guo, Sascha Hauer, Fabio Estevam,
	Pengutronix Kernel Team, NXP Linux Team, linux-spi,
	linux-arm-kernel

On Wed, Jan 10, 2024 at 09:54:03AM +0100, Alexander Stein wrote:
> If dma_request_chan() fails, no error is shown nor any information is
> shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
> Use dev_err_probe to fix both problems.
> 
> Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
  2024-01-10  8:54 ` Alexander Stein
@ 2024-01-22 22:07   ` Mark Brown
  -1 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-01-22 22:07 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Fabio Estevam, Alexander Stein
  Cc: Pengutronix Kernel Team, NXP Linux Team, linux-spi, linux-arm-kernel

On Wed, 10 Jan 2024 09:54:03 +0100, Alexander Stein wrote:
> If dma_request_chan() fails, no error is shown nor any information is
> shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
> Use dev_err_probe to fix both problems.
> 
> 

Applied to

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

Thanks!

[1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
      commit: fbc7ee6cc16918ea64a963a4ee097699cc159a8d

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: [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
@ 2024-01-22 22:07   ` Mark Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2024-01-22 22:07 UTC (permalink / raw)
  To: Shawn Guo, Sascha Hauer, Fabio Estevam, Alexander Stein
  Cc: Pengutronix Kernel Team, NXP Linux Team, linux-spi, linux-arm-kernel

On Wed, 10 Jan 2024 09:54:03 +0100, Alexander Stein wrote:
> If dma_request_chan() fails, no error is shown nor any information is
> shown in /sys/kernel/debug/devices_deferred if -EPROBE_DEFER is returned.
> Use dev_err_probe to fix both problems.
> 
> 

Applied to

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

Thanks!

[1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests
      commit: fbc7ee6cc16918ea64a963a4ee097699cc159a8d

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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2024-01-22 22:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-10  8:54 [PATCH v2 1/1] spi: spi-imx: Use dev_err_probe for failed DMA channel requests Alexander Stein
2024-01-10  8:54 ` Alexander Stein
2024-01-10  9:07 ` Francesco Dolcini
2024-01-10  9:07   ` Francesco Dolcini
2024-01-22 22:07 ` Mark Brown
2024-01-22 22:07   ` 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.