spi: intel: Keep the BIOS partition inside the first chip
authorMika Westerberg <mika.westerberg@linux.intel.com>
Thu, 1 Feb 2024 12:16:38 +0000 (14:16 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 5 Feb 2024 14:35:47 +0000 (14:35 +0000)
commit83c9c7ec8b914faf91567132ab197c54253c277f
tree2185961b13bb7fbe62f8e24a728369cece392bdf
parente58db3bcd93b9e0bf5068a29f7e1a97c29926830
spi: intel: Keep the BIOS partition inside the first chip

If there are two flash chips connected flash regions can refer to the
second chip too. In this case we may see the following warning:

  mtd: partition "BIOS" extends beyond the end of device "0000:00:1f.5" --
   size truncated to 0x400000

For this reason, check the BIOS partition size against the chip size and
make sure it stays within the that.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20240201121638.207632-2-mika.westerberg@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-intel.c