]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
mtd: rawnand: pl353: Allow raw read/write only for on-die ecc flash parts
authorNaga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Mon, 8 Apr 2019 13:16:22 +0000 (18:46 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 9 Apr 2019 13:09:03 +0000 (15:09 +0200)
When using HW-ECC, do not assign pl353_read_page_raw() and
pl353_write_page_raw() to ecc->write_page_raw and ecc->read_page_raw
hooks. if we do that read and writes will fail. We came to know this,
when running mtd_nandbiterrs test. This test case uses raw read/writes
when assigned but with hw-ecc, causes failures in data read
and writes.

Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/nand/raw/pl353_nand.c

index 73c66554613087c1eb251d3b4f03295c49540551..c004dfa505ac72fd16b87b73db488c0c680643c8 100644 (file)
@@ -1119,12 +1119,12 @@ static int pl353_nand_ecc_init(struct mtd_info *mtd, struct nand_ecc_ctrl *ecc,
                container_of(chip, struct pl353_nand_controller, chip);
        int err = 0;
 
-       ecc->write_page_raw = pl353_nand_write_page_raw;
-       ecc->read_page_raw = pl353_nand_read_page_raw;
        ecc->read_oob = pl353_nand_read_oob;
        ecc->write_oob = pl353_nand_write_oob;
 
        if (ecc_mode == NAND_ECC_ON_DIE) {
+               ecc->write_page_raw = pl353_nand_write_page_raw;
+               ecc->read_page_raw = pl353_nand_read_page_raw;
                pl353_smc_set_ecc_mode(PL353_SMC_ECCMODE_BYPASS);
                /*
                 * On-Die ECC spare bytes offset 8 is used for ECC codes