Skip to contentSkip to conversation

linux-wandboard: Add patch to fix build error with gcc6

PATCH In review Dominic Sacré 2 participants 8 messages Nov 10, 2016 – Nov 16, 2016 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 linux-wandboard: Add patch to fix build error with gcc6

Without this patch, gcc6 fails to build the Vivante driver with -Werror=misleading-indentation.

---
 .../Fix-gcc6-build-error-in-Vivante-driver.patch   | 41 ++++++++++++++++++++++
 recipes-kernel/linux/linux-wandboard_4.1.15.bb     |  5 ++-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 recipes-kernel/linux/linux-wandboard-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch
recipes-kernel/linux/linux-wandboard-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch new file +41 -0
new file mode 100644
index 0000000..5718f9a
@@ -0,0 +1,41 @@
+From 4555b623e15150ca31ee327232b1862227b14565 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Dominic=20Sacr=C3=A9?= <[email protected]>
+Date: Thu, 27 Oct 2016 22:35:04 +0200
+Subject: [PATCH] Fix gcc6 build error in Vivante driver
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+| gc_hal_kernel_platform_imx6q14.c: In function 'gckPLATFORM_AdjustParam':
+| gc_hal_kernel_platform_imx6q14.c:478:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
+|    if(Args->physSize == 0)
+|    ^~
+| gc_hal_kernel_platform_imx6q14.c:481:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
+|      return gcvSTATUS_OK;
+|      ^~~~~~
+
+Signed-off-by: Dominic Sacré <[email protected]>
+
+Upstream-Status: Pending
+---
+ .../linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c  | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
+index e436ada..3d25eb9 100644
+--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
+@@ -475,8 +475,8 @@ gckPLATFORM_AdjustParam(
+ 
+     Args->gpu3DMinClock = initgpu3DMinClock;
+ 
+-  if(Args->physSize == 0)
+-    Args->physSize = 0x80000000;
++    if(Args->physSize == 0)
++      Args->physSize = 0x80000000;
+ 
+     return gcvSTATUS_OK;
+ }
+-- 
+2.10.1
+
recipes-kernel/linux/linux-wandboard_4.1.15.bb +4 -1
index 0a41013..847fa58 100644
@@ -12,6 +12,9 @@ SRCBRANCH = "wandboard_imx_4.1.15_1.1.0_ga"
 SRCREV = "8b015473d34019c3e093c257861e9c6f4930400b"
 LOCALVERSION = "_1.1.0_ga-wandboard"
 
-SRC_URI += "file://Fix-the-compile-issue-under-gcc6.patch"
+SRC_URI += "\
+    file://Fix-the-compile-issue-under-gcc6.patch \
+    file://Fix-gcc6-build-error-in-Vivante-driver.patch \
+"
 
 COMPATIBLE_MACHINE = "(wandboard)"
Signature · 1 line
2.10.2
#1 lore raw

PATCH 2/2 linux-wandboard-rt: Upgrade to version 4.1.15

Upgrade recipe based on the latest versions of linux-wandboard and linux-fslc-imx-rt.

---
 .../0002-fix-build-with-rt-enabled.patch           |  19 -
 .../0001-fix-build.patch                           |   0
 .../0002-no-split-ptlocks.patch}                   |   0
 ...around-CPU-stalls-in-the-imx-sdma-driver.patch} |  53 ++-
 .../Fix-gcc6-build-error-in-Vivante-driver.patch   |  41 ++
 .../Fix-the-compile-issue-under-gcc6.patch         |  92 ++++
 .../defconfig                                      | 470 +++++----------------
 ...-rt_3.14.28.bb => linux-wandboard-rt_4.1.15.bb} |  21 +-
 8 files changed, 291 insertions(+), 405 deletions(-)
 delete mode 100644 recipes-kernel/linux/linux-wandboard-rt-3.14.28/0002-fix-build-with-rt-enabled.patch
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28 => linux-wandboard-rt-4.1.15}/0001-fix-build.patch (100%)
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch => linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch} (100%)
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28/0004-imx-sdma-channel-use-raw-spinlock.patch => linux-wandboard-rt-4.1.15/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch} (69%)
 create mode 100644 recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch
 create mode 100644 recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-the-compile-issue-under-gcc6.patch
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28 => linux-wandboard-rt-4.1.15}/defconfig (20%)
 rename recipes-kernel/linux/{linux-wandboard-rt_3.14.28.bb => linux-wandboard-rt_4.1.15.bb} (37%)
recipes-kernel/linux/linux-wandboard-rt-3.14.28/0002-fix-build-with-rt-enabled.patch deleted +0 -19
deleted file mode 100644
index 83652c9..0000000
@@ -1,19 +0,0 @@
-Fix build error when PREEMPT_RT_FULL is enabled
-
-Upstream-Status: Pending
-
-Signed-off-by: Jacob Kroon <[email protected]>
-
-Index: git/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-===================================================================
---- git.orig/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-+++ git/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-@@ -3266,7 +3266,7 @@ gckOS_CreateMutex(
-     gcmkONERROR(gckOS_Allocate(Os, gcmSIZEOF(struct mutex), Mutex));
- 
-     /* Initialize the mutex. */
--    mutex_init(*Mutex);
-+    mutex_init((struct mutex*)*Mutex);
- 
-     /* Return status. */
-     gcmkFOOTER_ARG("*Mutex=0x%X", *Mutex);
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0001-fix-build.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0001-fix-build.patch +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0001-fix-build.patch
rename to recipes-kernel/linux/linux-wandboard-rt-4.1.15/0001-fix-build.patch
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch
rename to recipes-kernel/linux/linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0004-imx-sdma-channel-use-raw-spinlock.patch +42 -11

103 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch new file +41 -0

41 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-the-compile-issue-under-gcc6.patch new file +92 -0

92 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/defconfig renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/defconfig +104 -366

550 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt_4.1.15.bb renamed from recipes-kernel/linux/linux-wandboard-rt_3.14.28.bb +12 -9
similarity index 37%
rename from recipes-kernel/linux/linux-wandboard-rt_3.14.28.bb
rename to recipes-kernel/linux/linux-wandboard-rt_4.1.15.bb
index 97be1ec..e60e124 100644
@@ -9,19 +9,22 @@ DEPENDS += "lzop-native bc-native"
 
 # Wandboard branch - based on 3.14.28_1.0.0_ga from Freescale git
 
-SRCBRANCH = "wandboard_imx_3.14.28_1.0.0_ga"
-SRCREV = "e2df0421a0a73fa2effb1e866bc3b2d8cb1b5acf"
-LOCALVERSION = "_1.0.0_ga-wandboard"
+SRCBRANCH = "wandboard_imx_4.1.15_1.1.0_ga"
+SRCREV = "8b015473d34019c3e093c257861e9c6f4930400b"
+LOCALVERSION = "_1.1.0_ga-wandboard"
 
 SRC_URI += "\
-    https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/older/patch-3.14.28-rt25.patch.gz;name=rt-patch1 \
+    file://Fix-the-compile-issue-under-gcc6.patch \
+    file://Fix-gcc6-build-error-in-Vivante-driver.patch \
+"
+SRC_URI += "\
+    https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/older/patch-4.1.15-rt18.patch.gz;name=rt-patch \
     file://0001-fix-build.patch \
-    file://0002-fix-build-with-rt-enabled.patch \
-    file://0003-no-split-ptlocks.patch \
-    file://0004-imx-sdma-channel-use-raw-spinlock.patch \
+    file://0002-no-split-ptlocks.patch \
+    file://0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch \
 "
 
-SRC_URI[rt-patch1.md5sum] = "28bfd1e14ccab1ea1fb48f56f982d80c"
-SRC_URI[rt-patch1.sha256sum] = "4c9bd426cf559a99e169208df5535fcb18ec98daec73f148c88859a7c3333e52"
+SRC_URI[rt-patch.md5sum] = "4763c22c4dcf49ba07cdf60984732fe4"
+SRC_URI[rt-patch.sha256sum] = "a317242e5e79fccc204f170328469e79d1aa663501dc4ec5e425199fb0ac9605"
 
 COMPATIBLE_MACHINE = "(wandboard)"
Signature · 1 line
2.10.2
#2 lore raw

PATCH v2 1/1 linux-wandboard-rt: Upgrade to version 4.1.15

Upgrade recipe based on the latest versions of linux-wandboard and linux-fslc-imx-rt.

---
I accidentally sent v1 with an incorrect defconfig, so here's v2 to fix that.

 .../0002-fix-build-with-rt-enabled.patch           |  19 ---
 .../0001-fix-build.patch                           |   0
 .../0002-no-split-ptlocks.patch}                   |   0
 ...around-CPU-stalls-in-the-imx-sdma-driver.patch} |  53 +++++--
 .../Fix-gcc6-build-error-in-Vivante-driver.patch   |  41 ++++++
 .../Fix-the-compile-issue-under-gcc6.patch         |  92 ++++++++++++
 .../defconfig                                      | 160 ++++++++++++---------
 ...-rt_3.14.28.bb => linux-wandboard-rt_4.1.15.bb} |  21 +--
 8 files changed, 281 insertions(+), 105 deletions(-)
 delete mode 100644 recipes-kernel/linux/linux-wandboard-rt-3.14.28/0002-fix-build-with-rt-enabled.patch
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28 => linux-wandboard-rt-4.1.15}/0001-fix-build.patch (100%)
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch => linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch} (100%)
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28/0004-imx-sdma-channel-use-raw-spinlock.patch => linux-wandboard-rt-4.1.15/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch} (69%)
 create mode 100644 recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch
 create mode 100644 recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-the-compile-issue-under-gcc6.patch
 rename recipes-kernel/linux/{linux-wandboard-rt-3.14.28 => linux-wandboard-rt-4.1.15}/defconfig (81%)
 rename recipes-kernel/linux/{linux-wandboard-rt_3.14.28.bb => linux-wandboard-rt_4.1.15.bb} (37%)
recipes-kernel/linux/linux-wandboard-rt-3.14.28/0002-fix-build-with-rt-enabled.patch deleted +0 -19
deleted file mode 100644
index 83652c9..0000000
@@ -1,19 +0,0 @@
-Fix build error when PREEMPT_RT_FULL is enabled
-
-Upstream-Status: Pending
-
-Signed-off-by: Jacob Kroon <[email protected]>
-
-Index: git/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-===================================================================
---- git.orig/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-+++ git/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
-@@ -3266,7 +3266,7 @@ gckOS_CreateMutex(
-     gcmkONERROR(gckOS_Allocate(Os, gcmSIZEOF(struct mutex), Mutex));
- 
-     /* Initialize the mutex. */
--    mutex_init(*Mutex);
-+    mutex_init((struct mutex*)*Mutex);
- 
-     /* Return status. */
-     gcmkFOOTER_ARG("*Mutex=0x%X", *Mutex);
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0001-fix-build.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0001-fix-build.patch +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0001-fix-build.patch
rename to recipes-kernel/linux/linux-wandboard-rt-4.1.15/0001-fix-build.patch
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch +0 -0
similarity index 100%
rename from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0003-no-split-ptlocks.patch
rename to recipes-kernel/linux/linux-wandboard-rt-4.1.15/0002-no-split-ptlocks.patch
recipes-kernel/linux/linux-wandboard-rt-4.1.15/0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/0004-imx-sdma-channel-use-raw-spinlock.patch +42 -11

103 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-gcc6-build-error-in-Vivante-driver.patch new file +41 -0

41 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/Fix-the-compile-issue-under-gcc6.patch new file +92 -0

92 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt-4.1.15/defconfig renamed from recipes-kernel/linux/linux-wandboard-rt-3.14.28/defconfig +94 -66

358 lines not on this page · raw message

recipes-kernel/linux/linux-wandboard-rt_4.1.15.bb renamed from recipes-kernel/linux/linux-wandboard-rt_3.14.28.bb +12 -9
similarity index 37%
rename from recipes-kernel/linux/linux-wandboard-rt_3.14.28.bb
rename to recipes-kernel/linux/linux-wandboard-rt_4.1.15.bb
index 97be1ec..e60e124 100644
@@ -9,19 +9,22 @@ DEPENDS += "lzop-native bc-native"
 
 # Wandboard branch - based on 3.14.28_1.0.0_ga from Freescale git
 
-SRCBRANCH = "wandboard_imx_3.14.28_1.0.0_ga"
-SRCREV = "e2df0421a0a73fa2effb1e866bc3b2d8cb1b5acf"
-LOCALVERSION = "_1.0.0_ga-wandboard"
+SRCBRANCH = "wandboard_imx_4.1.15_1.1.0_ga"
+SRCREV = "8b015473d34019c3e093c257861e9c6f4930400b"
+LOCALVERSION = "_1.1.0_ga-wandboard"
 
 SRC_URI += "\
-    https://www.kernel.org/pub/linux/kernel/projects/rt/3.14/older/patch-3.14.28-rt25.patch.gz;name=rt-patch1 \
+    file://Fix-the-compile-issue-under-gcc6.patch \
+    file://Fix-gcc6-build-error-in-Vivante-driver.patch \
+"
+SRC_URI += "\
+    https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/older/patch-4.1.15-rt18.patch.gz;name=rt-patch \
     file://0001-fix-build.patch \
-    file://0002-fix-build-with-rt-enabled.patch \
-    file://0003-no-split-ptlocks.patch \
-    file://0004-imx-sdma-channel-use-raw-spinlock.patch \
+    file://0002-no-split-ptlocks.patch \
+    file://0003-Work-around-CPU-stalls-in-the-imx-sdma-driver.patch \
 "
 
-SRC_URI[rt-patch1.md5sum] = "28bfd1e14ccab1ea1fb48f56f982d80c"
-SRC_URI[rt-patch1.sha256sum] = "4c9bd426cf559a99e169208df5535fcb18ec98daec73f148c88859a7c3333e52"
+SRC_URI[rt-patch.md5sum] = "4763c22c4dcf49ba07cdf60984732fe4"
+SRC_URI[rt-patch.sha256sum] = "a317242e5e79fccc204f170328469e79d1aa663501dc4ec5e425199fb0ac9605"
 
 COMPATIBLE_MACHINE = "(wandboard)"
Signature · 1 line
2.10.2
#3 lore raw
In reply to Dominic Sacré
Quoted 4 lines · Dominic Sacré

Without this patch, gcc6 fails to build the Vivante driver with -Werror=misleading-indentation.

There is any reason why you are not using the external kernel module?

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#4 lore raw
Quoted 7 lines · Otavio Salvador
Quoted 4 lines · Dominic Sacré

Without this patch, gcc6 fails to build the Vivante driver with -Werror=misleading-indentation.

There is any reason why you are not using the external kernel module?

I was working on linux-wandboard-rt when I noticed this build failure. Am I right in assuming that the external module still doesn't support RT kernels?

As for linux-wandboard itself, I see no particular reason not to use the external kernel module.

Dominic

#5 lore raw
Quoted 7 lines · Dominic Sacré
Quoted 6 lines · Otavio Salvador
Quoted 4 lines · Dominic Sacré

Without this patch, gcc6 fails to build the Vivante driver with -Werror=misleading-indentation.

Quoted 8 lines
Quoted 1 line

There is any reason why you are not using the external kernel module?

I was working on linux-wandboard-rt when I noticed this build failure. Am I right in assuming that the external module still doesn't support RT kernels?

As for linux-wandboard itself, I see no particular reason not to use the external kernel module.

Yes; however if there is a way to detect the presence of RT patch and act accordingly. We can patch the source of the external module to cope with this...

Is it possible for you to try to do that? If so, please see:
https://github.com/Freescale/kernel-module-imx-gpu-viv

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#6 lore raw
Quoted 10 lines · Otavio Salvador
Quoted 2 lines · Dominic Sacré

Am I right in assuming that the external module still doesn't support RT kernels?

Yes; however if there is a way to detect the presence of RT patch and act accordingly. We can patch the source of the external module to cope with this...

Is it possible for you to try to do that? If so, please see:
https://github.com/Freescale/kernel-module-imx-gpu-viv

I'm not sure if we could get the recipe to conditionally apply a patch, but from within the module source code, the RT patch can be detected using #ifdef CONFIG_PREEMPT_RT_FULL.

Should I prepare a pull request for the module itself, or would you prefer a patch as part of the Yocto recipe?

#7 lore raw
Quoted 12 lines · Dominic Sacré
Quoted 10 lines · Otavio Salvador
Quoted 2 lines · Dominic Sacré

Am I right in assuming that the external module still doesn't support RT kernels?

Yes; however if there is a way to detect the presence of RT patch and act accordingly. We can patch the source of the external module to cope with this...

Is it possible for you to try to do that? If so, please see:
https://github.com/Freescale/kernel-module-imx-gpu-viv

Quoted 6 lines

I'm not sure if we could get the recipe to conditionally apply a patch, but from within the module source code, the RT patch can be detected using #ifdef CONFIG_PREEMPT_RT_FULL.

Should I prepare a pull request for the module itself, or would you prefer a patch as part of the Yocto recipe?

A pull request. This makes it easier to merge on the future BSP releases as well as makes it trivial to apply further fixes on it.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750