Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] drivers: spi: cadence: set cqspi to the driver_data field of struct device
@ 2021-03-11  9:12 Meng.Li
  2021-03-11 13:24 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Meng.Li @ 2021-03-11  9:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: broonie, tudor.ambarus, vigneshr, vadivel.muruganx.ramuthevar,
	linux-spi, meng.li

From: Meng Li <Meng.Li@windriver.com>

When initialize cadence qspi controller, it is need to set cqspi
to the driver_data field of struct device, because it will be
used in function cqspi_remove/suspend/resume(). Otherwise, there
will be a crash trace as below when invoking these finctions.
Call trace:
 cqspi_suspend+0x14/0x44
 dpm_run_callback+0x50/0x1c0
 __device_suspend+0x114/0x514
 ......
 el0_svc+0x20/0x30
 el0_sync_handler+0x1a4/0x1b0
 el0_sync+0x174/0x180

Fixes: 31fb632b5d43("spi: Move cadence-quadspi driver to drivers/spi/")
Cc: stable@vger.kernel.org
Signed-off-by: Meng Li <Meng.Li@windriver.com>
---
 drivers/spi/spi-cadence-quadspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index ba7d40c2922f..d8b0e1f1cb3a 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1198,6 +1198,7 @@ static int cqspi_probe(struct platform_device *pdev)
 	cqspi = spi_master_get_devdata(master);
 
 	cqspi->pdev = pdev;
+	platform_set_drvdata(pdev, cqspi);
 
 	/* Obtain configuration from OF. */
 	ret = cqspi_of_get_pdata(cqspi);
-- 
2.17.1


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

end of thread, other threads:[~2021-03-11 16:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-11  9:12 [PATCH] drivers: spi: cadence: set cqspi to the driver_data field of struct device Meng.Li
2021-03-11 13:24 ` Mark Brown
2021-03-11 13:26 ` Mark Brown
2021-03-11 14:05   ` Li, Meng
2021-03-11 15:42     ` Mark Brown
2021-03-11 16:18 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox