[PATCH v2] mtd: nand: tango: import driver for tango chips

Marc Gonzalez marc_gonzalez at sigmadesigns.com
Thu Sep 8 09:37:25 PDT 2016


On 08/09/2016 17:55, Marc Gonzalez wrote:

> +static int decode_error_report(struct tango_nfc *nfc)
> +{
> +	u32 status, res;
> +
> +	status = readl_relaxed(nfc->reg_base + NFC_XFER_STATUS);
> +	if (status & PAGE_IS_EMPTY)
> +		return 0;
> +
> +	res = readl_relaxed(nfc->mem_base + ERROR_REPORT);
> +
> +	if (DECODE_ERR_ON_PKT_0(res) || DECODE_ERR_ON_PKT_N(res))
> +		return -EBADMSG;
> +
> +	return max(ERR_COUNT_PKT_0(res), ERR_COUNT_PKT_N(res));
> +}

This is probably an incorrect implementation. Boris mentioned that
we shouldn't return -EBADMSG?

# time insmod mtd/mtd_nandbiterrs.ko dev=1
[   19.498729] 
[   19.501435] ==================================================
[   19.508199] mtd_nandbiterrs: MTD device: 1
[   19.512372] mtd_nandbiterrs: MTD device size 536870912, eraseblock=131072, page=2048, oob=64
[   19.520893] mtd_nandbiterrs: Device uses 2 subpages of 1024 bytes
[   19.527034] mtd_nandbiterrs: Using page=0, offset=0, eraseblock=0
[   19.533986] mtd_nandbiterrs: incremental biterrors test
[   19.539297] mtd_nandbiterrs: write_page
[   19.543413] mtd_nandbiterrs: rewrite page
[   19.547766] mtd_nandbiterrs: read_page
[   19.551746] mtd_nandbiterrs: error: read failed at 0x0
[   19.556924] mtd_nandbiterrs: After 0 biterrors per subpage, read reported error -74
[   19.565432] mtd_nandbiterrs: finished successfully.
[   19.570343] ==================================================

It says "finished successfully", should I believe that?

Regards.




More information about the linux-mtd mailing list