Re: Regression: spi: core: avoid waking pump thread from spi_sync instead run teardown delayed

From: Mark Brown
Date: Fri Jan 18 2019 - 14:12:11 EST


On Fri, Jan 18, 2019 at 06:11:31PM +0100, kernel@xxxxxxxxxxxxxxxx wrote:

> Does something like this looks acceptable?

> diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
> index ec210286567c..677fc5025033 100644
> --- a/include/linux/spi/spi.h
> +++ b/include/linux/spi/spi.h
> @@ -288,6 +288,21 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
> module_driver(__spi_driver, spi_register_driver, \
> spi_unregister_driver)
>
> +/* define SPI Controller states in the state machine */
> +enum spi_controller_state {
> + SPI_CONTROLLER_STATE_SHUTDOWN = 0,
> + SPI_CONTROLLER_STATE_IDLE = 1,
> + SPI_CONTROLLER_STATE_IN_PROCESS = 2,
> + SPI_CONTROLLER_STATE_IN_TRANSFER = 3,
> +};

Yes, it does!

> SPI_CONTROLLER_MODE_EXCLUSIVE could replace the bus_lock_flag.
> I am also not sure of the âconventionâ of memory mode (i.e
> using mem_ops). Is it maybe implicitly spi_bus_locked - i.e
> typically only a single device?

Yes, it does - we're basically handing over the entire SPI bus to
another bit of hardware that will do memory mapped flash access so we
can't really have anything else trying to do SPI operations at the same
time.

Attachment: signature.asc
Description: PGP signature