mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
mtd: rawnand: fsl_ifc: return errors for failed page reads
commitf9a13e05a3upstream. fsl_ifc_run_command() logs controller timeout and other non-OPC completion states in ctrl->nand_stat. fsl_ifc_read_page() then only increments the ECC failure counter for non-OPC status and still returns max_bitflips, which can be zero. Return -ETIMEDOUT when the command did not complete at all and -EIO for other non-OPC read completions so the NAND core does not treat a failed page read as a clean page. Fixes:82771882d9("NAND Machine support for Integrated Flash Controller") Cc: stable@vger.kernel.org Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7ee7a77ec2
commit
f3da9bc7c8
@@ -683,8 +683,15 @@ static int fsl_ifc_read_page(struct nand_chip *chip, uint8_t *buf,
|
||||
return check_erased_page(chip, buf);
|
||||
}
|
||||
|
||||
if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC)
|
||||
if (!ctrl->nand_stat) {
|
||||
mtd->ecc_stats.failed++;
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
if (ctrl->nand_stat != IFC_NAND_EVTER_STAT_OPC) {
|
||||
mtd->ecc_stats.failed++;
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return nctrl->max_bitflips;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user