Commit 4c8613fb authored by Pali Rohár's avatar Pali Rohár Committed by Jialin Zhang
Browse files

mtd: rawnand: fsl_elbc: Fix none ECC mode

stable inclusion
from stable-v5.10.150
commit 3a9d7d8dcf9803783fbc1066bb6d022e75af232b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0XA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3a9d7d8dcf9803783fbc1066bb6d022e75af232b



--------------------------------

[ Upstream commit 049e43b9 ]

Commit f6424c22 ("mtd: rawnand: fsl_elbc: Make SW ECC work") added
support for specifying ECC mode via DTS and skipping autodetection.

But it broke explicit specification of HW ECC mode in DTS as correct
settings for HW ECC mode are applied only when NONE mode or nothing was
specified in DTS file.

Also it started aliasing NONE mode to be same as when ECC mode was not
specified and disallowed usage of ON_DIE mode.

Fix all these issues. Use autodetection of ECC mode only in case when mode
was really not specified in DTS file by checking that ecc value is invalid.
Set HW ECC settings either when HW ECC was specified in DTS or it was
autodetected. And do not fail when ON_DIE mode is set.

Fixes: f6424c22 ("mtd: rawnand: fsl_elbc: Make SW ECC work")
Signed-off-by: default avatarPali Rohár <pali@kernel.org>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarMarek Behún <kabel@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220707184328.3845-1-pali@kernel.org


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent bdfacfa8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment