EDAC L1 and L2 cache error detection and correction on LS1043A in Kernel 6.1.22

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EDAC L1 and L2 cache error detection and correction on LS1043A in Kernel 6.1.22

EDAC L1 and L2 cache error detection and correction on LS1043A in Kernel 6.1.22

 

ARM Cortex A57 and A53 L1/L2 cache error reporting

 

 The attached patch adds error detection for A53 and A57 cores. Hardware error injection is supported on A53. Software error injection is supported on both.

For hardware error injection on A53 to work, proper access to L2ACTLR_EL1, CPUACTLR_EL1 needs to be granted by EL3 firmware. This is done by making an SMC call in the driver. Failure to enable access disables hardware error injection. For error interrupt to work, another SMC call enables access to L2ECTLR_EL1. Failure to enable access disables interrupt for error reporting.

CPU Memory Error Syndrome and L2 Memory Error Syndrome registers can be used for checking L1 and L2 memory errors. However, only A53 supports double-bit error injection to L1 and L2 memory. This driver uses the hardware error injection when available, but also provides a way to inject errors by software. Both A53 and A57 supports interrupt when multi-bit errors happen.

To use hardware error injection and the interrupt, proper access needs to be granted in ACTLR_EL3 (and/or ACTLR_EL2) register by EL3 firmware SMC call.

Correctable errors do not trigger such interrupt. This driver uses dynamic polling internal to check for errors. The more errors detected, the more frequently it polls. Combining with interrupt, this driver can detect correctable and uncorrectable errors. However, if the uncorrectable errors cause system abort exception, this driver is not able to report errors in time.

 

 Build ATF and Kernel image with EDAC L1 and L2 cache error detection enabled in LSDK

In LLDPUG_RevL6.1.22_2.0.0 Yocto build environment, please rebuild ATF as the following.

$ source build_ls1043ardb/SOURCE_THIS

$ bitbake qoriq-atf -c cleansstate

$ bitbake qoriq-atf -c patch

Please go to atf source code folder build_ls1043ardb/tmp/work/ls1043ardb-fsl-linux/qoriq-atf/2.8+AUTOINC+atf-r0/git/, please apply patch 0001-Porting-helper-functions-for-EDAC-support-based-on-L.patch.

$ patch -p1 < 0001-Porting-helper-functions-for-EDAC-support-based-on-L.patch

And rebuild atf image.

$ bitbake qoriq-atf

Please rebuild Linux Kernel with the following commands.

$ source build_ls1043ardb/SOURCE_THIS

$ bitbake virtual/kernel -c cleansstate

$ bitbake virtual/kernel -c patch

Please go to Linux Kernel source code folder build_ls1043ardb/tmp/work/ls1043ardb-fsl-linux/linux-qoriq/6.1.y+gitAUTOINC+66e442bc7f-r0/git/ to apply patch 0001-drivers-edac-Add-L1-and-L2-error-detection-for-A53-a.patch.

$ patch -p1 < 0001-drivers-edac-Add-L1-and-L2-error-detection-for-A53-a.patch

 

$ bitbake virtual/kernel -c menuconfig

yipingwang_0-1783326465815.png

 

$ bitbake virtual/kernel

 

L1/L2 cache error detection and correction EDAC feature verification

root@localhost:~# dmesg | grep edac

[ 3.478641] EDAC DEVICE0: Giving out device to module edac-a53 controller cortex_edac_l1_l2: DEV edac-a53 (POLLED)

root@localhost:~# echo 1 > /sys/devices/system/edac/cpu_cache/l1_ue_sw_inject

root@localhost:~# [ 74.784912] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L1 count: 1 'Fatal error(s) on CPU 0

[ 74.784912] '

root@localhost:~# echo 1 > /sys/devices/system/edac/cpu_cache/l1_ue_hw_inject

[ 83.429371] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L1 count: 1 'Fatal error(s) on CPU 3

[ 83.429371] '

root@localhost:~# echo 1 > /sys/devices/system/edac/cpu_cache/l2_ue_sw_inject

root@localhost:~# echo 1 > /sys/devices/system/edac/cpu_cache/l2_ue_hw_inject

[ 106.985393] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 0

[ 106.985393] '

[ 106.997164] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 1

[ 106.997164] '

root@localhost:~# [ 115.232986] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 0

[ 115.232986] '

root@localhost:~# dmesg | grep EDAC

[ 1.638675] EDAC MC: Ver: 3.0.0

[ 3.478641] EDAC DEVICE0: Giving out device to module edac-a53 controller cortex_edac_l1_l2: DEV edac-a53 (POLLED)

[ 74.784840] EDAC cortex_edac_l1_l2: CPU 0 L1-I Tag RAM error(s) detected

[ 74.784869] EDAC cortex_edac_l1_l2: CPU 0 L1 fatal error(s) detected (0x8000000080000000)

[ 74.784912] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L1 count: 1 'Fatal error(s) on CPU 0

[ 83.429298] EDAC cortex_edac_l1_l2: CPU 3 L1-D Data RAM error(s) detected

[ 83.429329] EDAC cortex_edac_l1_l2: CPU 3 L1 fatal error(s) detected (0x8000000089100010)

[ 83.429371] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L1 count: 1 'Fatal error(s) on CPU 3

[ 106.985331] EDAC cortex_edac_l1_l2: CPU 0 L2 fatal error(s) detected (0x80000000910dc138)

[ 106.985349] EDAC cortex_edac_l1_l2: CPU 1 L2 fatal error(s) detected (0x8000000080000000)

[ 106.985393] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 0

[ 106.997164] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 1

[ 115.232936] EDAC cortex_edac_l1_l2: CPU 0 L2 fatal error(s) detected (0x80000000910c0598)

[ 115.232986] EDAC DEVICE0: UE: cortex_edac_l1_l2 instance: cpu_cache0 block: L2 count: 1 'Fatal error(s) on CPU 0

 

Labels (1)
Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-2390980%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EEDAC%20L1%20and%20L2%20cache%20error%20detection%20and%20correction%20on%20LS1043A%20in%20Kernel%206.1.22%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2390980%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EARM%20Cortex%20A57%20and%20A53%20L1%2FL2%20cache%20error%20reporting%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%26nbsp%3BThe%20attached%20patch%20adds%20error%20detection%20for%20A53%20and%20A57%20cores.%20Hardware%20error%20injection%20is%20supported%20on%20A53.%20Software%20error%20injection%20is%20supported%20on%20both.%3C%2FP%3E%0A%3CP%3EFor%20hardware%20error%20injection%20on%20A53%20to%20work%2C%20proper%20access%20to%20L2ACTLR_EL1%2C%20CPUACTLR_EL1%20needs%20to%20be%20granted%20by%20EL3%20firmware.%20This%20is%20done%20by%20making%20an%20SMC%20call%20in%20the%20driver.%20Failure%20to%20enable%20access%20disables%20hardware%20error%20injection.%20For%20error%20interrupt%20to%20work%2C%20another%20SMC%20call%20enables%20access%20to%20L2ECTLR_EL1.%20Failure%20to%20enable%20access%20disables%20interrupt%20for%20error%20reporting.%3C%2FP%3E%0A%3CP%3ECPU%20Memory%20Error%20Syndrome%20and%20L2%20Memory%20Error%20Syndrome%20registers%20can%20be%20used%20for%20checking%20L1%20and%20L2%20memory%20errors.%20However%2C%20only%20A53%20supports%20double-bit%20error%20injection%20to%20L1%20and%20L2%20memory.%20This%20driver%20uses%20the%20hardware%20error%20injection%20when%20available%2C%20but%20also%20provides%20a%20way%20to%20inject%20errors%20by%20software.%20Both%20A53%20and%20A57%20supports%20interrupt%20when%20multi-bit%20errors%20happen.%3C%2FP%3E%0A%3CP%3ETo%20use%20hardware%20error%20injection%20and%20the%20interrupt%2C%20proper%20access%20needs%20to%20be%20granted%20in%20ACTLR_EL3%20(and%2For%20ACTLR_EL2)%20register%20by%20EL3%20firmware%20SMC%20call.%3C%2FP%3E%0A%3CP%3ECorrectable%20errors%20do%20not%20trigger%20such%20interrupt.%20This%20driver%20uses%20dynamic%20polling%20internal%20to%20check%20for%20errors.%20The%20more%20errors%20detected%2C%20the%20more%20frequently%20it%20polls.%20Combining%20with%20interrupt%2C%20this%20driver%20can%20detect%20correctable%20and%20uncorrectable%20errors.%20However%2C%20if%20the%20uncorrectable%20errors%20cause%20system%20abort%20exception%2C%20this%20driver%20is%20not%20able%20to%20report%20errors%20in%20time.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%26nbsp%3B%3CSTRONG%3EBuild%20ATF%20and%20Kernel%20image%20with%20EDAC%20L1%20and%20L2%20cache%20error%20detection%20enabled%20in%20LSDK%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20LLDPUG_RevL6.1.22_2.0.0%20Yocto%20build%20environment%2C%20please%20rebuild%20ATF%20as%20the%20following.%3C%2FP%3E%0A%3CP%3E%24%20source%20build_ls1043ardb%2FSOURCE_THIS%3C%2FP%3E%0A%3CP%3E%24%20bitbake%20qoriq-atf%20-c%20cleansstate%3C%2FP%3E%0A%3CP%3E%24%20bitbake%20qoriq-atf%20-c%20patch%3C%2FP%3E%0A%3CP%3EPlease%20go%20to%20atf%20source%20code%20folder%20build_ls1043ardb%2Ftmp%2Fwork%2Fls1043ardb-fsl-linux%2Fqoriq-atf%2F2.8%2BAUTOINC%2Batf-r0%2Fgit%2F%2C%20please%20apply%20patch%200001-Porting-helper-functions-for-EDAC-support-based-on-L.patch.%3C%2FP%3E%0A%3CP%3E%24%20patch%20-p1%20%26lt%3B%200001-Porting-helper-functions-for-EDAC-support-based-on-L.patch%3C%2FP%3E%0A%3CP%3EAnd%20rebuild%20atf%20image.%3C%2FP%3E%0A%3CP%3E%24%20bitbake%20qoriq-atf%3C%2FP%3E%0A%3CP%3EPlease%20rebuild%20Linux%20Kernel%20with%20the%20following%20commands.%3C%2FP%3E%0A%3CP%3E%24%20source%20build_ls1043ardb%2FSOURCE_THIS%3C%2FP%3E%0A%3CP%3E%24%20bitbake%20virtual%2Fkernel%20-c%20cleansstate%3C%2FP%3E%0A%3CP%3E%24%20bitbake%20virtual%2Fkernel%20-c%20patch%3C%2FP%3E%0A%3CP%3EPlease%20go%20to%20Linux%20Kernel%20source%20code%20folder%20build_ls1043ardb%2Ftmp%2Fwork%2Fls1043ardb-fsl-linux%2Flinux-qoriq%2F6.1.y%2BgitAUTOINC%2B66e442bc7f-r0%2Fgit%2F%20to%20apply%20patch%200001-drivers-edac-Add-L1-and-L2-error-detection-for-A53-a.patch.%3C%2FP%3E%0A%3CP%3E%24%20patch%20-p1%20%26lt%3B%200001-drivers-edac-Add-L1-and-L2-error-detection-for-A53-a.patch%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%24%20bitbake%20virtual%2Fkernel%20-c%20menuconfig%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22yipingwang_0-1783326465815.png%22%20style%3D%22width%3A%20505px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22yipingwang_0-1783326465815.png%22%20style%3D%22width%3A%20505px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F391330i10AA71C5B73B6C84%2Fimage-dimensions%2F505x284%3Fv%3Dv2%22%20width%3D%22505%22%20height%3D%22284%22%20role%3D%22button%22%20title%3D%22yipingwang_0-1783326465815.png%22%20alt%3D%22yipingwang_0-1783326465815.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%24%20bitbake%20virtual%2Fkernel%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E%3CSTRONG%3EL1%2FL2%20cache%20error%20detection%20and%20correction%20EDAC%20feature%20verification%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20dmesg%20%7C%20grep%20edac%3C%2FP%3E%0A%3CP%3E%5B%203.478641%5D%20EDAC%20DEVICE0%3A%20Giving%20out%20device%20to%20module%20edac-a53%20controller%20cortex_edac_l1_l2%3A%20DEV%20edac-a53%20(POLLED)%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20echo%201%20%26gt%3B%20%2Fsys%2Fdevices%2Fsystem%2Fedac%2Fcpu_cache%2Fl1_ue_sw_inject%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20%5B%2074.784912%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L1%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CP%3E%5B%2074.784912%5D%20'%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20echo%201%20%26gt%3B%20%2Fsys%2Fdevices%2Fsystem%2Fedac%2Fcpu_cache%2Fl1_ue_hw_inject%3C%2FP%3E%0A%3CP%3E%5B%2083.429371%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L1%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%203%3C%2FP%3E%0A%3CP%3E%5B%2083.429371%5D%20'%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20echo%201%20%26gt%3B%20%2Fsys%2Fdevices%2Fsystem%2Fedac%2Fcpu_cache%2Fl2_ue_sw_inject%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20echo%201%20%26gt%3B%20%2Fsys%2Fdevices%2Fsystem%2Fedac%2Fcpu_cache%2Fl2_ue_hw_inject%3C%2FP%3E%0A%3CP%3E%5B%20106.985393%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CP%3E%5B%20106.985393%5D%20'%3C%2FP%3E%0A%3CP%3E%5B%20106.997164%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%201%3C%2FP%3E%0A%3CP%3E%5B%20106.997164%5D%20'%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20%5B%20115.232986%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CP%3E%5B%20115.232986%5D%20'%3C%2FP%3E%0A%3CP%3Eroot%40localhost%3A~%23%20dmesg%20%7C%20grep%20EDAC%3C%2FP%3E%0A%3CP%3E%5B%201.638675%5D%20EDAC%20MC%3A%20Ver%3A%203.0.0%3C%2FP%3E%0A%3CP%3E%5B%203.478641%5D%20EDAC%20DEVICE0%3A%20Giving%20out%20device%20to%20module%20edac-a53%20controller%20cortex_edac_l1_l2%3A%20DEV%20edac-a53%20(POLLED)%3C%2FP%3E%0A%3CP%3E%5B%2074.784840%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%200%20L1-I%20Tag%20RAM%20error(s)%20detected%3C%2FP%3E%0A%3CP%3E%5B%2074.784869%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%200%20L1%20fatal%20error(s)%20detected%20(0x8000000080000000)%3C%2FP%3E%0A%3CP%3E%5B%2074.784912%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L1%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CP%3E%5B%2083.429298%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%203%20L1-D%20Data%20RAM%20error(s)%20detected%3C%2FP%3E%0A%3CP%3E%5B%2083.429329%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%203%20L1%20fatal%20error(s)%20detected%20(0x8000000089100010)%3C%2FP%3E%0A%3CP%3E%5B%2083.429371%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L1%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%203%3C%2FP%3E%0A%3CP%3E%5B%20106.985331%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%200%20L2%20fatal%20error(s)%20detected%20(0x80000000910dc138)%3C%2FP%3E%0A%3CP%3E%5B%20106.985349%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%201%20L2%20fatal%20error(s)%20detected%20(0x8000000080000000)%3C%2FP%3E%0A%3CP%3E%5B%20106.985393%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CP%3E%5B%20106.997164%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%201%3C%2FP%3E%0A%3CP%3E%5B%20115.232936%5D%20EDAC%20cortex_edac_l1_l2%3A%20CPU%200%20L2%20fatal%20error(s)%20detected%20(0x80000000910c0598)%3C%2FP%3E%0A%3CP%3E%5B%20115.232986%5D%20EDAC%20DEVICE0%3A%20UE%3A%20cortex_edac_l1_l2%20instance%3A%20cpu_cache0%20block%3A%20L2%20count%3A%201%20'Fatal%20error(s)%20on%20CPU%200%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2390980%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EQorIQ%20LS1%20Devices%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
an hour ago
Updated by: