From ce4d8b3c5e866a8c515608cf623990e1471a69c7 Mon Sep 17 00:00:00 2001 From: Ziyang Huang Date: Tue, 2 Dec 2025 22:02:30 +0800 Subject: [PATCH 1/2] mtd: rawnand: qpic only support max 4 bytes ID QPIC use a reg (NAND_READ_ID) to transport the ID, so the max bytes of ID is a word (4Bytes). https://github.com/torvalds/linux/blob/3a8660878839faadb4f1a6dd72c3179c1df56787/drivers/mtd/nand/raw/qcom_nandc.c#L1783 Signed-off-by: Ziyang Huang --- drivers/mtd/nand/raw/nand_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -4965,7 +4965,7 @@ static bool find_full_id_nand(struct nan memorg = nanddev_get_memorg(&chip->base); - if (!strncmp(type->id, id_data, type->id_len)) { + if (!strncmp(type->id, id_data, min(4, type->id_len))) { memorg->pagesize = type->pagesize; mtd->writesize = memorg->pagesize; memorg->pages_per_eraseblock = type->erasesize /