Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb5047eb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mtd: msm_qpic_nand: Continue reading pages when ECC errors occur"

parents f3ee8c95 42d08f88
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
/*
 * Copyright (C) 2007 Google, Inc.
 * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2017, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1996,6 +1996,7 @@ static int msm_nand_read_partial_page(struct mtd_info *mtd,
		if (err < 0) {
			/* Clear previously set EUCLEAN / EBADMSG */
			is_euclean = 0;
			is_ebadmsg = 0;
			ret_len = ops->retlen;
			break;
		}
@@ -2035,6 +2036,7 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
{
	int ret;
	int is_euclean = 0;
	int is_ebadmsg = 0;
	struct mtd_oob_ops ops;
	unsigned char *bounce_buf = NULL;

@@ -2073,9 +2075,14 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
					is_euclean = 1;
					ret = 0;
				}
				if (ret == -EBADMSG) {
					is_ebadmsg = 1;
					ret = 0;
				}
				if (ret < 0) {
					/* Clear previously set EUCLEAN */
					/* Clear previously set errors */
					is_euclean = 0;
					is_ebadmsg = 0;
					break;
				}

@@ -2115,6 +2122,11 @@ static int msm_nand_read(struct mtd_info *mtd, loff_t from, size_t len,
out:
	if (is_euclean == 1)
		ret = -EUCLEAN;

	/* Snub EUCLEAN if we also have EBADMSG */
	if (is_ebadmsg == 1)
		ret = -EBADMSG;

	return ret;
}