]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit5eb962242262e56c9e33197a19dbc9782076bf59
tree4ea7ea27c0496898ad52b036432e172c66c951c1
parent291af6bed1a9840782b7e2fa06868d235d76bd28
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: 26065c233a18 ("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