From afa85aa291e848cce802f2fe6903687479e970d2 Mon Sep 17 00:00:00 2001 From: Pradeep P V K Date: Mon, 17 May 2021 15:51:08 +0530 Subject: [PATCH] mtd: msm_qpic_nand: Enable one code word read along with PS read Enable one code word read support along with pagescope read feature support. Change-Id: Ib99a37140ec1bd929be34ebf21cd177df6493257 Signed-off-by: Pradeep P V K --- drivers/mtd/devices/msm_qpic_nand.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/msm_qpic_nand.c b/drivers/mtd/devices/msm_qpic_nand.c index 7de758780067..e93965cd1ee8 100644 --- a/drivers/mtd/devices/msm_qpic_nand.c +++ b/drivers/mtd/devices/msm_qpic_nand.c @@ -2941,7 +2941,14 @@ static int msm_nand_read_partial_page(struct mtd_info *mtd, no_copy = false; ops->datbuf = no_copy ? actual_buf : bounce_buf; - if (info->nand_chip.caps & MSM_NAND_CAP_PAGE_SCOPE_READ) + + /* + * Do a Pagescope read only if PAGE_SCOPE_READ is enabled + * and request length is greater than codeword size or + * the page offset is not aligned to start of the page. + */ + if ((info->nand_chip.caps & MSM_NAND_CAP_PAGE_SCOPE_READ) && + ((len > ONE_CODEWORD_SIZE) || (offset != 0))) err = msm_nand_read_pagescope(mtd, aligned_from, ops); else { if ((len <= ONE_CODEWORD_SIZE) && (offset == 0))