Skip to contentSkip to conversation

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

PATCH Superseded Vladimir Yakovlev 2 participants 7 messages Mar 2 – Mar 3 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: spi-dw-dma: fix print error log when wait finish transaction

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.

---
 drivers/spi/spi-dw-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-dw-dma.c +1 -1
index 65adec7c7524..d83466166abe 100644
@@ -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;
 	}
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 4 lines · Vladimir Yakovlev

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,
      |                 ^~~~~~~
#2 lore raw

PATCH v2 1/1 spi: spi-dw-dma: fix print error log when wait finish transaction

In reply to Vladimir Yakovlev

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 ctlr (struct spi_controller*).

---
 drivers/spi/spi-dw-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-dw-dma.c +1 -1
index 65adec7c7524..fe726b9b1780 100644
@@ -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->ctlr->dev,
 			"DMA transaction timed out\n");
 		return -ETIMEDOUT;
 	}
Signature · 1 line
2.34.1
maintainer
#3 lore raw
In reply to Vladimir Yakovlev
Quoted 4 lines · Vladimir Yakovlev

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

#4 lore raw

v2 cover spi: spi-dw-dma: fix print error log when wait finish transaction

Hello!

This patch fixes a system crash if there is no current message for a transaction.

Changes in v2:
- Sorry for the inattention. The variable in the dw_spi structure,
- which has the struct spi_controller type, was renamed from host to ctlr
- starting with version 6.19.

Thanks

Vladimir Yakovlev (1):
spi: spi-dw-dma: fix print error log when wait finish transaction

 drivers/spi/spi-dw-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.34.1
maintainer
#5 lore raw
Quoted 4 lines · Vladimir Yakovlev

Hello!

This patch fixes a system crash if there is no current message for a transaction.

Please don't send cover letters for single patches, if there is anything that needs saying put it in the changelog of the patch or after the --- if it's administrative stuff. This reduces mail volume and ensures that any important information is recorded in the changelog rather than being lost.

maintainer
#6 lore raw
In reply to Vladimir Yakovlev
Quoted 9 lines · Vladimir Yakovlev

This patch fixes a system crash if there is no current message for a transaction.

Changes in v2:
- Sorry for the inattention. The variable in the dw_spi structure,
- which has the struct spi_controller type, was renamed from host to ctlr
- starting with version 6.19.

[...]

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