Skip to content

Commit 93df74f

Browse files
Hi-Im-Davidcarlescufi
authored andcommitted
[nrf fromtree] drivers: mspi_dw: Edit core disable to after PM init
There is a scenario where a Bus fault occurs as the power management isn't initialised yet and the core is attempted to be turned off via the ssienr register. This commit edits this so the core register is written to after the initialisation of the power management. Signed-off-by: David Jewsbury <[email protected]> (cherry picked from commit 4bf6a756280be4d90edf96f1a4c088c4620be41d)
1 parent dd437b9 commit 93df74f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/mspi/mspi_dw.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,9 +1864,6 @@ static int dev_init(const struct device *dev)
18641864
}
18651865
}
18661866

1867-
/* Make sure controller is disabled. */
1868-
write_ssienr(dev, 0);
1869-
18701867
#if defined(CONFIG_PINCTRL)
18711868
if (IS_ENABLED(CONFIG_PM_DEVICE_RUNTIME)) {
18721869
rc = pinctrl_apply_state(dev_config->pcfg, PINCTRL_STATE_SLEEP);
@@ -1877,7 +1874,15 @@ static int dev_init(const struct device *dev)
18771874
}
18781875
#endif
18791876

1880-
return pm_device_driver_init(dev, dev_pm_action_cb);
1877+
rc = pm_device_driver_init(dev, dev_pm_action_cb);
1878+
if (rc < 0) {
1879+
return rc;
1880+
}
1881+
1882+
/* Make sure controller is disabled. */
1883+
write_ssienr(dev, 0);
1884+
1885+
return 0;
18811886
}
18821887

18831888
static DEVICE_API(mspi, drv_api) = {

0 commit comments

Comments
 (0)