Re: [PATCH v3 04/13] spi: spi-mem: add spi_mem_apply_base_freq_cap()
From: Miquel Raynal
Date: Thu May 28 2026 - 04:48:52 EST
Hi Santhosh,
> --- a/drivers/spi/spi-mem.c
> +++ b/drivers/spi/spi-mem.c
> @@ -398,7 +398,11 @@ int spi_mem_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
> u8 *tmpbuf;
> int ret;
>
> - /* Make sure the operation frequency is correct before going futher */
> + /*
> + * Ops not configured for maximum speed are limited to the conservative
> + * base speed; spi_mem_adjust_op_freq() then caps to the device maximum.
> + */
> + spi_mem_apply_base_freq_cap(mem, (struct spi_mem_op *)op);
> spi_mem_adjust_op_freq(mem, (struct spi_mem_op *)op);
There are many more spi_mem_adjust_op_freq() calls in the core where we would
not apply the base frequency. Aren't we missing these places? Wouldn't it
be more appropriate to call spi_mem_apply_base_freq_cap() at the beginning
of spi_mem_adjust_op_freq() ?
Thanks,
Miquèl