[PATCH] spi: spi-dw-dma: fix print error log when wait finish transaction

Vladimir Yakovlev posted 1 patch 1 month, 1 week ago
There is a newer version of this series
drivers/spi/spi-dw-dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] spi: spi-dw-dma: fix print error log when wait finish transaction
Posted by Vladimir Yakovlev 1 month, 1 week ago
If an error occurs, the device may not have a current message. In this
case, the system will crash.

In this case, it's better to use dev from the struct host.

Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
---
 drivers/spi/spi-dw-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index 65adec7c7524..d83466166abe 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -271,7 +271,7 @@ static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)
 					 msecs_to_jiffies(ms));
 
 	if (ms == 0) {
-		dev_err(&dws->ctlr->cur_msg->spi->dev,
+		dev_err(&dws->host->dev,
 			"DMA transaction timed out\n");
 		return -ETIMEDOUT;
 	}
-- 
2.34.1
Re: [PATCH] spi: spi-dw-dma: fix print error log when wait finish transaction
Posted by Mark Brown 1 month ago
On Mon, 02 Mar 2026 14:32:33 +0300, Vladimir Yakovlev wrote:
> If an error occurs, the device may not have a current message. In this
> case, the system will crash.
> 
> In this case, it's better to use dev from the struct host.

Applied to

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

Thanks!

[1/1] spi: spi-dw-dma: fix print error log when wait finish transaction
      commit: 3b46d61890632c8f8b117147b6923bff4b42ccb7

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
Re: [PATCH] spi: spi-dw-dma: fix print error log when wait finish transaction
Posted by Mark Brown 1 month, 1 week ago
On Mon, Mar 02, 2026 at 02:32:33PM +0300, Vladimir Yakovlev wrote:
> If an error occurs, the device may not have a current message. In this
> case, the system will crash.
> 
> In this case, it's better to use dev from the struct host.

Are you sure:

/build/stage/linux/drivers/spi/spi-dw-dma.c: In function ‘dw_spi_dma_wait’:
/build/stage/linux/drivers/spi/spi-dw-dma.c:274:29: error: ‘struct dw_spi’ has no member named ‘host’
  274 |                 dev_err(&dws->host->dev,
      |                             ^~
/build/stage/linux/include/linux/dev_printk.h:110:25: note: in definition of macro ‘dev_printk_index_wrap’
  110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
      |                         ^~~
/build/stage/linux/drivers/spi/spi-dw-dma.c:274:17: note: in expansion of macro ‘dev_err’
  274 |                 dev_err(&dws->host->dev,
      |                 ^~~~~~~