spi: cadence-quadspi: fix incorrect supports_op() return value
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 6 Apr 2022 13:28:32 +0000 (15:28 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 13 Apr 2022 13:43:58 +0000 (14:43 +0100)
commitf1d388f216aeb41a5df518815ae559d14a6d438e
tree4ea7ea27c0496898ad52b036432e172c66c951c1
parent299d8b74519d04042f8803d0604e08a1a7e31e5e
spi: cadence-quadspi: fix incorrect supports_op() return value

Since the conversion to spi-mem, the driver advertised support for
various operations that cqspi_set_protocol() was never expected to handle
correctly - in particuar all non-DTR operations with command or address
buswidth > 1. For DTR, all operations except for 8-8-8 would fail, as
cqspi_set_protocol() returns -EINVAL.

In non-DTR mode, this resulted in data corruption for SPI-NOR flashes that
support such operations. As a minimal fix that can be backported to stable
kernels, simply disallow the unsupported operations again to avoid this
issue.

Fixes: a314f6367787 ("mtd: spi-nor: Convert cadence-quadspi to use spi-mem framework")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20220406132832.199777-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c