[PATCH v3 04/13] spi: spi-mem: add spi_mem_apply_base_freq_cap()

Miquel Raynal miquel.raynal at bootlin.com
Thu May 28 01:43:39 PDT 2026


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



More information about the linux-mtd mailing list