OSDN Git Service

spi: bcm-qspi: switch back to reading flash using smaller chunks
authorRafał Miłecki <rafal@milecki.pl>
Thu, 11 Oct 2018 07:42:17 +0000 (09:42 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 11 Oct 2018 14:00:34 +0000 (15:00 +0100)
commit940ec770c295682993d1cccce3081fd7c74fece8
tree6114fddda9d30a6542e7d39693103c113eb55b4e
parent0976eda7915507fe94e07870c19d717c9994b57a
spi: bcm-qspi: switch back to reading flash using smaller chunks

Fixing/optimizing bcm_qspi_bspi_read() performance introduced two
changes:
1) It added a loop to read all requested data using multiple BSPI ops.
2) It bumped max size of a single BSPI block request from 256 to 512 B.

The later change resulted in occasional BSPI timeouts causing a
regression.

For some unknown reason hardware doesn't always handle reads as expected
when using 512 B chunks. In such cases it may happen that BSPI returns
amount of requested bytes without the last 1-3 ones. It provides the
remaining bytes later but doesn't raise an interrupt until another LR
start.

Switching back to 256 B reads fixes that problem and regression.

Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
drivers/spi/spi-bcm-qspi.c