Re: [PATCH] spi: spi-mem: add statistics support to ->exec_op() calls

From: Mark Brown
Date: Tue Feb 13 2024 - 10:29:00 EST


On Tue, Feb 13, 2024 at 12:39:02PM +0000, Tudor Ambarus wrote:
> On 2/9/24 13:51, Théo Lebrun wrote:

> > + if (!ret || ret != -ENOTSUPP || ret != -EOPNOTSUPP) {
> > + spi_mem_add_op_stats(ctlr->pcpu_statistics, op, ret);
> > + spi_mem_add_op_stats(mem->spi->pcpu_statistics, op, ret);
> > +

> Would be good to be able to opt out the statistics if one wants it.

> SPI NORs can write with a single write op maximum page_size bytes, which
> is typically 256 bytes. And since there are SPI NORs that can run at 400
> MHz, I guess some performance penalty shouldn't be excluded.

If we can cope with this sort of statistics collection in the networking
fast path we can probably cope with it for SPI too, the immediate
recording is all per CPU so I'd like to see some numbers showing that
it's a problem before worrying about it too much. Even the people doing
things like saturating CAN buses haven't been raising it as a concern
for the regular SPI data path. We could add a Kconfig if it's an issue.

Attachment: signature.asc
Description: PGP signature