]> git.baikalelectronics.ru Git - kernel.git/commit
spi: spi-mem: add automatic poll status functions
authorPatrice Chotard <patrice.chotard@foss.st.com>
Tue, 18 May 2021 16:27:52 +0000 (18:27 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 3 Jun 2021 13:04:56 +0000 (14:04 +0100)
commitefa2bda70612d7dd45d2cbbb22814430541c02b3
tree0ee6eae99184df1a2b4e992b02c2aeb39cc486a0
parent9fb51bb203ba1c67f480638e9d0605db59810687
spi: spi-mem: add automatic poll status functions

With STM32 QSPI, it is possible to poll the status register of the device.
This could be done to offload the CPU during an operation (erase or
program a SPI NAND for example).

spi_mem_poll_status API has been added to handle this feature.
This new function take care of the offload/non-offload cases.

For the non-offload case, use read_poll_timeout() to poll the status in
order to release CPU during this phase.
For example, previously, when erasing large area, in non-offload case,
CPU load can reach ~50%, now it decrease to ~35%.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://lore.kernel.org/r/20210518162754.15940-2-patrice.chotard@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mem.c
include/linux/spi/spi-mem.h