]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: gpio: No MISO does not imply no RX
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 9 Sep 2018 22:28:05 +0000 (00:28 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2018 19:12:25 +0000 (11:12 -0800)
commitd70f08ad016276d2f8bc1eb119c2986c7e55c422
treed3a0c79e6e16a36c6302a99cf65986e0c6819c47
parente67ec9ef7925eb153a531265e71d36bead1b0f5c
spi: gpio: No MISO does not imply no RX

[ Upstream commit abf5feef3ff0cefade0c76be53b59e55fdd46093 ]

There is a logical problem in spi-gpio with host just
assigning a MOSI line and no MISO: this is interpreted
as the host cannot do RX and the host is flagged with
SPI_MASTER_NO_RX.

This is wrong: since GPIO lines can switch direction,
in 3WIRE operation the host will simply reverse the
direction of the GPIO line and start reading from it,
there is even code for doing this in the driver, but
it went unnoticed because it was tested by using a
master with 4 wires but a device using just 3 wires.

Remove the offending flag.

Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-gpio.c