]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-imx: Workaround kernel oops when devtmpfs is enabled.
authorLeon Woestenberg <leon@sidebranch.com>
Thu, 22 Dec 2011 19:32:51 +0000 (20:32 +0100)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 23 Dec 2011 16:20:53 +0000 (16:20 +0000)
More details in head of patch.

Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
meta-fsl-arm/recipes-kernel/linux/linux-imx/devtmpfs-init-options-alignment.patch [new file with mode: 0644]
meta-fsl-arm/recipes-kernel/linux/linux-imx_2.6.35.3.bb

diff --git a/meta-fsl-arm/recipes-kernel/linux/linux-imx/devtmpfs-init-options-alignment.patch b/meta-fsl-arm/recipes-kernel/linux/linux-imx/devtmpfs-init-options-alignment.patch
new file mode 100644 (file)
index 0000000..19e5ef2
--- /dev/null
@@ -0,0 +1,38 @@
+Make the devtmpfs options static. This works around an issue that is still
+under investigation.
+
+The toolchain assumes it can generate unaligned accesses for ARMv6+, as these
+cores can handle this, PROVIDED the bit is set in the CP15 control register.
+
+However, Linux sets this bit lazely (upon first trap), which does not work for
+kernel space code.
+
+There was a lengthy thread over this, the agreement was the kernel should not
+have non-aligned structures on stacks anyway.
+
+Forcing this structure to be aligned on the stack did not help, unsure why.
+This requires further investigation.
+
+This fixes a kernel failure if devtmpfs was enabled in the kernel config.
+
+Signed-off-by: Leon Woestenberg <leon@sidebranch.com>
+diff -Nur orig/drivers/base/devtmpfs.c git/drivers/base/devtmpfs.c
+--- orig/drivers/base/devtmpfs.c       2011-12-22 15:11:18.752904263 +0100
++++ git/drivers/base/devtmpfs.c        2011-12-22 18:03:09.060928840 +0100
+@@ -365,6 +365,8 @@
+       return err;
+ }
++static char options[] = "mode=0755";
++
+ /*
+  * Create devtmpfs instance, driver-core devices will add their device
+  * nodes here.
+@@ -373,7 +375,6 @@
+ {
+       int err;
+       struct vfsmount *mnt;
+-      char options[] = "mode=0755";
+       err = register_filesystem(&dev_fs_type);
+       if (err) {
index 94bfb6f9d3f77e17b9d69e9b65ad6c6420495208..18f6d66c011726341e11dcfb5f2c37ef6f6d049b 100644 (file)
@@ -4,7 +4,7 @@
 DESCRIPTION = "Linux kernel for imx platforms"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
-PR = "r4"
+PR = "r5"
 
 inherit kernel
 COMPATIBLE_MACHINE = "(imx53qsb|imx53ard)"
@@ -12,6 +12,7 @@ COMPATIBLE_MACHINE = "(imx53qsb|imx53ard)"
 SRC_URI = "git://opensource.freescale.com/pub/scm/imx/linux-2.6-imx.git;tag=rel_imx_2.6.35_11.09.01;protocol=http \
            file://egalax_ts-enable-single-event-support.patch \
            file://plat-mxc-double-dma-zone-max.patch \
+           file://devtmpfs-init-options-alignment.patch \
            file://defconfig \
           "