Re: [PATCH RFC v2 19/35] spi: nxp-fspi: Reject mixed DTR modes
From: Bough Chen
Date: Mon Nov 30 2026 - 06:30:20 EST
On Fri, Nov 27, 2026 at 03:22:41PM +0100, Miquel Raynal wrote:
> The controller only supports operations where all phases use the same
> DTR mode. The mode selection in nxp_fspi_select_mem() assumes either an
> all-DTR or an all-SDR operation; mixed DTR operations would be
> misconfigured.
>
> Reject mixed DTR operations from ->supports_op().
>
> Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
> ---
> drivers/spi/spi-nxp-fspi.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
> index e6fdded67a00..04999369dd1b 100644
> --- a/drivers/spi/spi-nxp-fspi.c
> +++ b/drivers/spi/spi-nxp-fspi.c
> @@ -536,8 +536,18 @@ static bool nxp_fspi_supports_op(struct spi_mem *mem,
> const struct spi_mem_op *op)
> {
> struct nxp_fspi *f = spi_controller_get_devdata(mem->spi->controller);
> + bool all_true, all_false;
> int ret;
>
Better to add a comment here,like: controller only support 8D-8D-8D mode. Do
not support mixed DTR operation. So more readable.
Regards
Haibo Chen
> + all_true = op->cmd.dtr &&
> + (!op->addr.nbytes || op->addr.dtr) &&
> + (!op->data.nbytes || op->data.dtr);
> +
> + all_false = !op->cmd.dtr && !op->addr.dtr && !op->data.dtr;
> +
> + if (!all_true && !all_false)
> + return false;
> +
> ret = nxp_fspi_check_buswidth(f, op->cmd.buswidth);
>
> if (op->addr.nbytes)
>
> --
> 2.56.0
>