The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [PATCH v6 05/17] spi: spi-mem: add execute_tuning callback and spi_mem_execute_tuning()
       [not found] ` <20260723110219.3180747-6-s-k6@ti.com>
@ 2026-07-29  8:37   ` Miquel Raynal
  0 siblings, 0 replies; only message in thread
From: Miquel Raynal @ 2026-07-29  8:37 UTC (permalink / raw)
  To: Santhosh Kumar K
  Cc: broonie, robh, krzk+dt, conor+dt, richard, vigneshr, pratyush,
	mwalle, takahiro.kuwano, linux-spi, devicetree, linux-kernel,
	linux-mtd, praneeth, u-kumar1, a-dutta

Hello Santhosh,

On 23/07/2026 at 16:32:07 +0530, Santhosh Kumar K <s-k6@ti.com> wrote:

> Add an execute_tuning callback to struct spi_controller_mem_ops. The
> callback receives a mandatory read op template and an optional write op
> template. On success the controller sets op->max_freq in each provided
> template to the validated clock rate.
>
> Add the corresponding spi_mem_execute_tuning() wrapper that checks for
> callback availability and returns -EOPNOTSUPP when the controller has
> not implemented it, allowing callers to handle controllers that do not
> support tuning gracefully.
>
> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
> Signed-off-by: Santhosh Kumar K <s-k6@ti.com>

Sashiko found two issues which I think are easy yet worth fixing:

- [High] spi_mem_execute_tuning() directly invokes the controller callback without acquiring the SPI bus locks or ensuring the controller is powered on.
- [High] spi_mem_execute_tuning() does not check if the SPI device is using a GPIO chip select before invoking the hardware tuning callback.

Can you please have a look?

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-29  8:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260723110219.3180747-1-s-k6@ti.com>
     [not found] ` <20260723110219.3180747-6-s-k6@ti.com>
2026-07-29  8:37   ` [PATCH v6 05/17] spi: spi-mem: add execute_tuning callback and spi_mem_execute_tuning() Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox