]> git.ipfire.org Git - thirdparty/linux.git/commit
spi: spi-nxp-fspi: propagate clock reconfig failures in nxp_fspi_select_mem()
authorHaibo Chen <haibo.chen@nxp.com>
Tue, 28 Jul 2026 10:18:10 +0000 (18:18 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 30 Jul 2026 12:13:50 +0000 (13:13 +0100)
commitb5902b9779796d515b7d65eb9205994b7a8d00cb
tree22452116bfd905d1522eadfb363123ea97ace7d3
parentb4bde5cfff8e43e948219f0a598e4bf057ecfba4
spi: spi-nxp-fspi: propagate clock reconfig failures in nxp_fspi_select_mem()

nxp_fspi_select_mem() disables the FlexSPI clocks before calling
clk_set_rate() and re-enabling them. If clk_set_rate() or the clock
re-enable fails, the function returned early (as void) leaving both the
serial root clock and the register interface clock disabled.

As the function returned void, nxp_fspi_exec_op() had no way to know
about the failure and continued to access FlexSPI registers (LUT setup,
data transfer, AHB buffer invalidation). Accessing the controller
registers while its clock is gated off results in a synchronous external
abort.

Make nxp_fspi_select_mem() return an error code and have
nxp_fspi_exec_op() bail out on failure before any further register
access, including nxp_fspi_invalid().

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://patch.msgid.link/20260728-fspi-clock-v2-3-dbe786a4a6eb@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-nxp-fspi.c