linux-stable/drivers/mtd/spi-nor
Alexander Sverdlin 2b75ebeea6 mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write
It was observed that reads crossing 4K address boundary are failing.

This limitation is mentioned in Intel documents:

Intel(R) 9 Series Chipset Family Platform Controller Hub (PCH) Datasheet:

"5.26.3 Flash Access
Program Register Access:
* Program Register Accesses are not allowed to cross a 4 KB boundary..."

Enhanced Serial Peripheral Interface (eSPI)
Interface Base Specification (for Client and Server Platforms):

"5.1.4 Address
For other memory transactions, the address may start or end at any byte
boundary. However, the address and payload length combination must not
cross the naturally aligned address boundary of the corresponding Maximum
Payload Size. It must not cross a 4 KB address boundary."

Avoid this by splitting an operation crossing the boundary into two
operations.

Fixes: 8afda8b26d ("spi-nor: Add support for Intel SPI serial flash controller")
Cc: stable@vger.kernel.org
Reported-by: Romain Porte <romain.porte@nokia.com>
Tested-by: Pascal Fabreges <pascal.fabreges@nokia.com>
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
2019-04-01 14:36:23 +02:00
..
aspeed-smc.c treewide: Use struct_size() for devm_kmalloc() and friends 2018-06-06 11:15:43 -07:00
cadence-quadspi.c mtd: spi-nor: cadence-quadspi: fix spelling mistake: "Couldnt't" -> "Couldn't" 2019-02-21 08:58:07 +01:00
hisi-sfc.c mtd: spi-nor: hisi: Avoid generic function names 2018-04-20 22:54:36 +02:00
intel-spi-pci.c mtd: spi-nor: intel-spi: Add support for Intel Ice Lake SPI serial flash 2018-10-12 11:47:07 +02:00
intel-spi-platform.c spi-nor: Add support for Intel SPI serial flash controller 2017-01-03 17:33:36 +00:00
intel-spi.c mtd: spi-nor: intel-spi: Avoid crossing 4K address boundary on read/write 2019-04-01 14:36:23 +02:00
intel-spi.h spi-nor: Add support for Intel SPI serial flash controller 2017-01-03 17:33:36 +00:00
Kconfig spi: Updates for v5.1 2019-03-04 19:23:56 -08:00
Makefile spi: Updates for v5.1 2019-03-04 19:23:56 -08:00
mtk-quadspi.c mtd: spi-nor: mtk-quadspi: add SNOR_HWCAPS_READ to spi_nor_hwcaps mask 2019-01-16 16:00:21 +01:00
nxp-spifi.c mtd: spi-nor: nxp-spifi: release flash_np in nxp_spifi_probe() 2018-06-22 00:26:06 +02:00
spi-nor.c mtd: spi-nor: Fix comment of spi_nor_find_best_erase_type() 2019-03-21 17:24:32 +01:00
stm32-quadspi.c mtd: spi-nor: stm32-quadspi: replace "%p" with "%pK" 2018-08-01 09:18:55 +02:00