]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: atmel-quadspi: fix possible MMIO window size overrun
authorTudor Ambarus <tudor.ambarus@microchip.com>
Fri, 28 Feb 2020 15:55:32 +0000 (15:55 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:40 +0000 (07:18 +0100)
commit7541d47b8c158d4e594397030caf60eea1be46c2
treecf2e1aaf29ac15658ca69f775fb2ca3cf028a941
parent5b87ae948d1510dfd5045745a0f65777a77649f8
spi: atmel-quadspi: fix possible MMIO window size overrun

commit 8e093ea4d3593379be46b845b9e823179558047e upstream.

The QSPI controller memory space is limited to 128MB:
0x9000_00000-0x9800_00000/0XD000_0000--0XD800_0000.

There are nor flashes that are bigger in size than the memory size
supported by the controller: Micron MT25QL02G (256 MB).

Check if the address exceeds the MMIO window size. An improvement
would be to add support for regular SPI mode and fall back to it
when the flash memories overrun the controller's memory space.

Fixes: 0e6aae08e9ae ("spi: Add QuadSPI driver for Atmel SAMA5D2")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20200228155437.1558219-1-tudor.ambarus@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/atmel-quadspi.c