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

Commit 309eb4b4 authored by Pradeep P V K's avatar Pradeep P V K
Browse files

mtd: msm_qpic_nand: Parse the ECC data on all page codewords



ECC data on all page codewords needs to be parsed, to confirm if
the page is actually erased.

The existing code logic, parses only page's first codeword ECC
data instead of ECC data on all codewords of the page.

change is made accordingly to parse the ECC data on all codewords
of the page.

Change-Id: I88af1b76d212ea23d810da351ba8cf2411e205d7
Signed-off-by: default avatarPradeep P V K <ppvk@codeaurora.org>
parent d63e9035
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1808,7 +1808,7 @@ static int msm_nand_is_erased_page_ps(struct mtd_info *mtd, loff_t from,
			/* This extra +1 is for oobbuf case */
		} result[MAX_CW_PER_PAGE + 1];
	} *dma_buffer;
	uint8_t *ecc;
	uint8_t *ecc, *ecc_temp;

	total_ecc_byte_cnt = (chip->ecc_parity_bytes * cwperpage);
	memcpy(&raw_ops, ops, sizeof(struct mtd_oob_ops));
@@ -1981,8 +1981,8 @@ static int msm_nand_is_erased_page_ps(struct mtd_info *mtd, loff_t from,
	dma_unmap_single(chip->dev, rw_params->ecc_dma_addr,
			total_ecc_byte_cnt, DMA_FROM_DEVICE);
	/* check for bit flips in ecc data */
	ecc_temp = ecc;
	for (n = rw_params->start_sector; n < cwperpage; n++) {
		uint8_t *ecc_temp = ecc;
		int last_pos = 0, next_pos = 0;
		int ecc_bytes_percw_in_bits = (chip->ecc_parity_bytes * 8);

@@ -2475,7 +2475,7 @@ static int msm_nand_is_erased_page(struct mtd_info *mtd, loff_t from,
			uint32_t erased_cw_status;
		} result[MAX_CW_PER_PAGE];
	} *dma_buffer;
	uint8_t *ecc;
	uint8_t *ecc, *ecc_temp;

	pr_debug("========================================================\n");
	total_ecc_byte_cnt = (chip->ecc_parity_bytes * cwperpage);
@@ -2621,8 +2621,8 @@ static int msm_nand_is_erased_page(struct mtd_info *mtd, loff_t from,
	dma_unmap_single(chip->dev, rw_params->ecc_dma_addr,
			total_ecc_byte_cnt, DMA_FROM_DEVICE);
	/* check for bit flips in ecc data */
	ecc_temp = ecc;
	for (n = rw_params->start_sector; n < cwperpage; n++) {
		uint8_t *ecc_temp = ecc;
		int last_pos = 0, next_pos = 0;
		int ecc_bytes_percw_in_bits = (chip->ecc_parity_bytes * 8);