imx6-dongle / linux-imx

Linux kernel for GK802/HI802, i.MX6 based HDMI-dongle/tv-stick computers
Other
28 stars 22 forks source link

cpufreq scaling causes system instability #9

Closed abrasive closed 11 years ago

abrasive commented 11 years ago

CPU frequency changes cause random memory corruption. Not yet clear whether on write or read, and how the cache is involved.

Failure pattern: data at physical addresses 0x???3b, 0x???4b, 0x???5b, 0x???6b usually replaced with 0. See test log at http://pastebin.com/zW5J7rQ3

To reproduce: load the userspace governor and toggle the CPU frequency manually (or run ondemand and get unlucky). If compiled with CONFIG_DEBUG_PAGEALLOC then it might catch it before the kernel dies.

To avoid: use performance governor or disable cpufreq.

Tried:

No successes.

rzk commented 11 years ago

Did you check the official errata? http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&nodeId=018rH3ZrDRB24A&fpsp=1&tab=Documentation_Tab IMX6DQCE.pdf It was updated a week ago, might have something about this.

abrasive commented 11 years ago

I can't find anything applicable.

I wrote a quick test tool that suggests the issue is when CPU freq changes while dirty data is in the cache; try it here: http://pastebin.com/dr32QcWZ

I'd like to know if anyone else experiences this issue? You need the userspace governor available to run the test.

abrasive commented 11 years ago

(I suggest cranking MAX_MEGS up to 1024 for maximum failure likelihood; it gets a bit slow though)

mtx512 commented 11 years ago

We may have an issue in that DDR timing values not correctly set in Uboot as per the Nitrogen6X issue http://boundarydevices.com/i-mx-6dq-u-boot-updates/. Try and run their test scripts.

HSTe commented 11 years ago

There are some new patches for hdmidongle here updated 20130221

https://community.freescale.com/docs/DOC-93821

patch readme ver 0.02

  1. New features: a. ldo bypass b. uboot fastboot c. ntfs support d. bluetooth A2DP e. fake an alway full battery f. no screen locker g. check the video mode
  2. Bug fix a. WifiDirect connect issue b. realtek throughput issue with TPLink AP c. uboot mmu enable bug fix
    d. fix 0008-boot_unlock_screen.patch issue e. adjust wm8326 voltage change rate to make system more stable f. lowmem killer issue fix g. Update realtek wifi driver to fix the soft ap issue h. Wifi p2p framework fix to resovle wifi direct only one side work issue.
  3. File list:

    README.TXT --- this file 0001-uboot_fastboot.patch --- uboot fastboot patch 0002-LDOBYPASS.patch --- enable ldo bypass patch 0003-WifiDirect.patch --- wifi direct connect patch 0004-ntfs_support.patch --- ntfs support patch 0005-BT_enable.patch --- enable bluetooth A2DP 0006-1G_boot_stable.patch --- make 1G bootup stable 0007-battery_always_full.patch --- fake an alway full battery 0008-boot_unlock_screen.patch --- no screen locker please reverse 0009-uboot-enable-mmu-fix.patch --- uboot mmu enable bug fix 0010-boot_disable_screenlocker.patch --- For fix 0008-boot_unlock_screen.patch 0011-wm8326-DC_CONTROL_RATE.patch --- Change the wm8326 pmic rate to immediate voltage change 0012-Added-default-video-mode-check-make-sur.patch --- Video mode check 0013-the-force-contiguous-lowmem-killer.patch --- low memory killer fix 0014-Fixed-kernel-panic-in-lower-memory-kill.patch --- low memory killer panic fix 0015-patch_vpu_wrapper_r13.4_ga_seekfailure_3D_Underwater.patch --- vpu wrapper seek fail fix 0016-patch_r13.4.ga_vpu5.4.6_vc1_BWB_disable.patch --- disable vc1 BWB vpu 0017-qiyi.patch --- qiyi 6 min stop issue 0018-Nu-Player-ENGR00214824-Green-video-during-seeking-on.patch --- For reverse 0019-WifiDirect2.patch --- Wifi Direct Only one side fix ntfs-3g.tar.gz --- open source ntfs-3g for ntfs support rtl8192_8188CE_linux_v4.0.0_6594.20130219_FS.tgz --- realtek new driver for SoftAP issue MD5SUM.TXT --- md5 check sum

  4. Patch guide Please run md5sum -c MD5SUM.TXT first to confirm all the files received are ok. All these patches are based on the patch release hdmidongle_REVB_R13.4_patch-20121115.tgz You need to do as following: R13.4 GA--->patch hdmidongle_REVB_R13.4_patch-20121115.tgz --> patch hdmidongle_REVB_R13.4_patch-20130221.tgz Supposed the ~/myandroid is your top directory of the android source tree.
    Please run the following command to apply the patches . $tar zfvx hdmidongle_REVB_R13.4_patch-20130221.tgz -C ~/ $cd ~/myandroid $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0001-uboot_fastboot.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0002-LDOBYPASS.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0003-WifiDirect.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0004-ntfs_support.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0005-BT_enable.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0007-battery_always_full.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0009-uboot-enable-mmu-fix.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0010-boot_disable_screenlocker.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0011-wm8326-DC_CONTROL_RATE.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0012-Added-default-video-mode-check-make-sur.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0013-the-force-contiguous-lowmem-killer.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0014-Fixed-kernel-panic-in-lower-memory-kill.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0015-patch_vpu_wrapper_r13.4_ga_seekfailure_3D_Underwater.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0016-patch_r13.4.ga_vpu5.4.6_vc1_BWB_disable.patch --verbose $git apply ~/hdmidongle_REVB_R13.4_patch-20130221/0017-qiyi.patch --verbose $rm -rf kernel_imx/drivers/net/wireless/rtl8192ce $tar zfvx ~/hdmidongle_REVB_R13.4_patch-20130221/rtl8192_8188CE_linux_v4.0.0_6594.20130219_FS.tgz $tar zfvx ~/hdmidongle_REVB_R13.4_patch-20130221/ntfs-3g.tar.gz -C external $cp -f ~/hdmidongle_REVB_R13.4_patch-20130221/lib_mp4_parser_arm11_elinux.3.0.so device/fsl-proprietary/codec/lib/

    If you have applied the 0008-boot_unlock_screen.patch, please use the following command to reverse the patch. $git apply -R ~/hdmidongle_REVB_R13.4_patch-20130221/0008-boot_unlock_screen.patch --verbose

    If you have applied the 0006-1G_boot_stable.patch, please use the following command to reverse the patch. Please !!!! reverse the patch 0006-1G_boot_stable.patch, the issue has been fixed by 0011-wm8326-DC_CONTROL_RATE.patch. $git apply -R ~/hdmidongle_REVB_R13.4_patch-20130221/0006-1G_boot_stable.patch --verbose

    Please reverse the 0018-Nu-Player-ENGR00214824-Green-video-during-seeking-on.patch $git apply -R ~/hdmidongle_REVB_R13.4_patch-20130221/0018-Nu-Player-ENGR00214824-Green-video-during-seeking-on.patch --verbose

    Please note, the realtek wifi concurrent is disabled in the rtl8192_8188CE_linux_v4.0.0_6594.20130219_FS.tgz.

  5. Build and run
abrasive commented 11 years ago

This is a DDR timing issue. Have ported u-boot and included Nitrogen6X timing fixes for this issue. Does not include RAM calibration for our boards but appears to improve stability nonetheless. See the imx6-dongle/uboot-imx6dongle tree.