Commit 8f62f59f authored by Baruch Siach's avatar Baruch Siach Committed by Miquel Raynal
Browse files

mtd: parsers: qcom: incompatible with spi-nor 4k sectors



Partition size and offset value are in block size units, which is the
same as 'erasesize'. But when 4K sectors are enabled erasesize is set to
4K. Bail out in that case.

Fixes: 803eb124 ("mtd: parsers: Add Qcom SMEM parser")
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/0a2611f885b894274436ded3ca78bc0440fca74a.1614790096.git.baruch@tkos.co.il
parent c95310e1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -65,6 +65,13 @@ static int parse_qcomsmem_part(struct mtd_info *mtd,
	int ret, i, numparts;
	char *name, *c;

	if (IS_ENABLED(CONFIG_MTD_SPI_NOR_USE_4K_SECTORS)
			&& mtd->type == MTD_NORFLASH) {
		pr_err("%s: SMEM partition parser is incompatible with 4K sectors\n",
				mtd->name);
		return -EINVAL;
	}

	pr_debug("Parsing partition table info from SMEM\n");
	ptable = qcom_smem_get(SMEM_APPS, SMEM_AARM_PARTITION_TABLE, &len);
	if (IS_ERR(ptable)) {