]> git.baikalelectronics.ru Git - kernel.git/commit
spi: mux: repair mux usage
authorPeter Rosin <peda@axentia.se>
Mon, 25 May 2020 10:43:52 +0000 (12:43 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 25 May 2020 12:25:34 +0000 (13:25 +0100)
commitabd80752e44d55711f54f53ae0b34e0a01853b3b
tree7eac3865cd9c085b6081d51d1b391fd3d63ff0e5
parent4fa8c456ffef660068686ce1649b4e3bdf0704c1
spi: mux: repair mux usage

It is not valid to cache/short out selection of the mux.

mux_control_select() only locks the mux until mux_control_deselect()
is called. mux_control_deselect() may put the mux in some low power
state or some other user of the mux might select it for other purposes.
These things are probably not happening in the original setting where
this driver was developed, but it is said to be a generic SPI mux.

Also, the mux framework will short out the actual low level muxing
operation when/if that is possible.

Fixes: 7e820b14cb2f ("spi: Add generic SPI multiplexer")
Signed-off-by: Peter Rosin <peda@axentia.se>
Link: https://lore.kernel.org/r/20200525104352.26807-1-peda@axentia.se
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-mux.c