Re: [PATCH v2 08/10] spi: fsl-qspi: Propagate clock errors from fsl_qspi_select_mem()
From: Frieder Schrempf
Date: Tue Dec 01 2026 - 04:05:59 EST
On 27.11.26 16:31, Lee Jones wrote:
> fsl_qspi_select_mem() returns void and silently gives up if either
> clk_set_rate() or fsl_qspi_clk_prep_enable() fails. fsl_qspi_exec_op()
> then carries on with the operation regardless.
>
> When switching between devices, a failed rate change leaves q->selected
> pointing at the previously selected chip, so the operation is issued
> through the previous device's SFAR and AHB window. If the failure
> happens on the first operation, q->selected is still -1 from probe, so
> those offsets are derived from a negative chip select. On controllers
> which need the clocks disabled while the rate is changed, a
> clk_set_rate() failure also leaves the clocks off while registers
> continue to be accessed.
>
> Re-enable the clocks even when setting the rate failed, return any error
> to the caller, and have fsl_qspi_exec_op() abort the operation when
> selecting the device fails.
>
> Fixes: 84d043185dbe ("spi: Add a driver for the Freescale/NXP QuadSPI controller")
> Closes: https://sashiko.dev/#/bug/linux-719261ef-312e-4a94-9a84-fd42a411bee0
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
Reviewed-by: Frieder Schrempf <frieder.schrempf@xxxxxxxxxx>