Currently, we trigger ECC HW before setting ecc irq. It is incorrect.
Because ECC starts working once the register ECC_CTL_REG is set as
ECC_OP_ENABLE. And this may lead an abnormal behavior of ecc irq.
So, should enable ecc irq at first, then trigger ECC.
Fixes:
1d6b1e464950 ("mtd: mediatek: driver for MTK Smart Device")
Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
if (ret)
return ret;
- writew(ECC_OP_ENABLE, ecc->regs + ECC_CTL_REG(op));
-
init_completion(&ecc->done);
reg_val = ECC_IRQ_EN;
/*
reg_val |= ECC_PG_IRQ_SEL;
writew(reg_val, ecc->regs + ECC_IRQ_REG(op));
+ writew(ECC_OP_ENABLE, ecc->regs + ECC_CTL_REG(op));
+
return 0;
}
EXPORT_SYMBOL(mtk_ecc_enable);