All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends
@ 2023-01-09 14:41 Ross Burton
  2023-01-09 14:41 ` [PATCH][dunfell 2/2] arm/scp-firmware: backport a build race fix Ross Burton
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ross Burton @ 2023-01-09 14:41 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

In "scp-firmware: allow setting log level to INFO or WARN"[1] the base
SRCREV was bumped from db1991 (the 2.6 tag) to fd7c8356. This means a
fair amount of cleanup can be made:

The base recipe should set PV=2.6+git, both of the existing bbappends
already did this so those can be removed.

The base recipe's CMSIS SRCREV should be a SHA, not a tag name. Both
bbappends also did this so those can be removed.

The TC0 SRCREV is in fact earlier than the new base recipe, so remove
the override so unify the versions. There were no TC-specific changes
between the two SHAs so this should be safe.

[1] 9386db13df5134ab68ae3a1618e999584f7a4261

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc        | 4 ----
 meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-tc0.inc | 7 -------
 meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb      | 3 ++-
 3 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc
index ddbaac4a..495f1ed6 100644
--- a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc
+++ b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-n1sdp.inc
@@ -1,14 +1,10 @@
 # N1SDP specific SCP configurations and build instructions
 
-SRCREV_scp    = "fd7c83561a7d76c7681d5d017fb23aa3664c028c"
-SRCREV_cmsis  = "refs/tags/5.2.0"
 SCP_PLATFORM  = "n1sdp"
 SCP_LOG_LEVEL = "INFO"
 
 COMPATIBLE_MACHINE_n1sdp = "n1sdp"
 
-PV = "2.6+git${SRCPV}"
-
 DEPENDS += "fiptool-native"
 DEPENDS += "virtual/trusted-firmware-a"
 
diff --git a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-tc0.inc b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-tc0.inc
index 5b29305b..7df09338 100644
--- a/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-tc0.inc
+++ b/meta-arm-bsp/recipes-bsp/scp-firmware/scp-firmware-tc0.inc
@@ -1,13 +1,6 @@
 # TC0 specicif SCP configuration
 
-# Intermediate SHA with 2.6 baseline version
-SRCREV_scp    = "ba1db5fb0ee4a520836722f7a694177d461ab716"
-# 5.2.0 tag commit
-SRCREV_cmsis  = "80cc44bba16cb4c8f495b7aa9709d41ac50e9529"
-
 COMPATIBLE_MACHINE = "tc0"
 
 SCP_PLATFORM = "tc0"
 FW_TARGETS = "scp"
-
-PV = "2.6+git${SRCPV}"
diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
index 9cb8b642..92c82c58 100644
--- a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
+++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
@@ -13,8 +13,9 @@ SRC_URI = "\
     git://github.com/ARM-software/CMSIS_5.git;protocol=https;name=cmsis;destsuffix=src/cmsis;lfs=0;nobranch=1 \
 "
 
+PV            = "2.6+git${SRCPV}"
 SRCREV_scp    = "fd7c83561a7d76c7681d5d017fb23aa3664c028c"
-SRCREV_cmsis  = "refs/tags/5.2.0"
+SRCREV_cmsis  = "80cc44bba16cb4c8f495b7aa9709d41ac50e9529"
 SRCREV_FORMAT = "scp_cmsis"
 
 require scp-firmware.inc
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH][dunfell 2/2] arm/scp-firmware: backport a build race fix
  2023-01-09 14:41 [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Ross Burton
@ 2023-01-09 14:41 ` Ross Burton
  2023-01-09 16:22 ` [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Jon Mason
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Ross Burton @ 2023-01-09 14:41 UTC (permalink / raw)
  To: meta-arm; +Cc: nd

There is a build race when generating the module includes which causes
errors, backport the fix.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 ..._code-atomically-rewrite-the-generat.patch | 69 +++++++++++++++++++
 .../scp-firmware/scp-firmware_git.bb          |  1 +
 2 files changed, 70 insertions(+)
 create mode 100644 meta-arm/recipes-bsp/scp-firmware/files/0001-tools-gen_module_code-atomically-rewrite-the-generat.patch

diff --git a/meta-arm/recipes-bsp/scp-firmware/files/0001-tools-gen_module_code-atomically-rewrite-the-generat.patch b/meta-arm/recipes-bsp/scp-firmware/files/0001-tools-gen_module_code-atomically-rewrite-the-generat.patch
new file mode 100644
index 00000000..5fc571ec
--- /dev/null
+++ b/meta-arm/recipes-bsp/scp-firmware/files/0001-tools-gen_module_code-atomically-rewrite-the-generat.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+From 8aba6e5159273e2ed82d55780f35356262cb79c8 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Tue, 8 Sep 2020 11:49:08 +0100
+Subject: [PATCH] tools/gen_module_code: atomically rewrite the generated files
+
+The gen_module rule in rules.mk is marked as .PHONY, so make will
+execute it whenever it is mentioned. This results in gen_module_code
+being executed 64 times for a Juno build.
+
+However in heavily parallel builds there's a good chance that
+gen_module_code is writing a file whilst the compiler is reading it
+because make also doesn't know what files are generated by
+gen_module_code.
+
+The correct fix is to adjust the Makefiles so that the dependencies are
+correct but this isn't trivial, so band-aid the problem by atomically
+writing the generated files.
+
+Change-Id: I82d44f9ea6537a91002e1f80de8861d208571630
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ tools/gen_module_code.py | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/tools/gen_module_code.py b/tools/gen_module_code.py
+index 7b3953845..ee099b713 100755
+--- a/tools/gen_module_code.py
++++ b/tools/gen_module_code.py
+@@ -17,6 +17,7 @@
+ import argparse
+ import os
+ import sys
++import tempfile
+ 
+ DEFAULT_PATH = 'build/'
+ 
+@@ -53,13 +54,21 @@ TEMPLATE_C = "/* This file was auto generated using {} */\n" \
+ 
+ def generate_file(path, filename, content):
+     full_filename = os.path.join(path, filename)
+-    with open(full_filename, 'a+') as f:
+-        f.seek(0)
+-        if f.read() != content:
++
++    try:
++        with open(full_filename) as f:
++            rewrite = f.read() != content
++    except FileNotFoundError:
++        rewrite = True
++
++    if rewrite:
++        with tempfile.NamedTemporaryFile(prefix="gen-module-code",
++                                         dir=path,
++                                         delete=False,
++                                         mode="wt") as f:
+             print("[GEN] {}...".format(full_filename))
+-            f.seek(0)
+-            f.truncate()
+             f.write(content)
++        os.replace(f.name, full_filename)
+ 
+ 
+ def generate_header(path, modules):
+-- 
+2.34.1
+
diff --git a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
index 92c82c58..7a9cd348 100644
--- a/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
+++ b/meta-arm/recipes-bsp/scp-firmware/scp-firmware_git.bb
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM += "file://cmsis/LICENSE.txt;md5=e3fc50a88d0a364313df4b21ef20c2
 SRC_URI = "\
     git://github.com/ARM-software/SCP-firmware.git;protocol=https;name=scp;destsuffix=src;nobranch=1 \
     git://github.com/ARM-software/CMSIS_5.git;protocol=https;name=cmsis;destsuffix=src/cmsis;lfs=0;nobranch=1 \
+    file://0001-tools-gen_module_code-atomically-rewrite-the-generat.patch \
 "
 
 PV            = "2.6+git${SRCPV}"
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends
  2023-01-09 14:41 [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Ross Burton
  2023-01-09 14:41 ` [PATCH][dunfell 2/2] arm/scp-firmware: backport a build race fix Ross Burton
@ 2023-01-09 16:22 ` Jon Mason
  2023-01-10 17:02 ` Jon Mason
  2023-01-13 16:17 ` Jon Mason
  3 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2023-01-09 16:22 UTC (permalink / raw)
  To: meta-arm, Ross Burton; +Cc: nd

On Mon, 9 Jan 2023 14:41:29 +0000, Ross Burton wrote:
> In "scp-firmware: allow setting log level to INFO or WARN"[1] the base
> SRCREV was bumped from db1991 (the 2.6 tag) to fd7c8356. This means a
> fair amount of cleanup can be made:
> 
> The base recipe should set PV=2.6+git, both of the existing bbappends
> already did this so those can be removed.
> 
> [...]

Applied, thanks!

[1/2] arm/scp-firmware: rationalise SRCREV/bbappends
      commit: a07dec8ad8a260f293a55e8300f514dee134b2d6
[2/2] arm/scp-firmware: backport a build race fix
      commit: d13be36099aff7ea2975a1a197564e2e801707a3

Best regards,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends
  2023-01-09 14:41 [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Ross Burton
  2023-01-09 14:41 ` [PATCH][dunfell 2/2] arm/scp-firmware: backport a build race fix Ross Burton
  2023-01-09 16:22 ` [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Jon Mason
@ 2023-01-10 17:02 ` Jon Mason
  2023-01-13 16:17 ` Jon Mason
  3 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2023-01-10 17:02 UTC (permalink / raw)
  To: meta-arm, Ross Burton; +Cc: nd

On Mon, 9 Jan 2023 14:41:29 +0000, Ross Burton wrote:
> In "scp-firmware: allow setting log level to INFO or WARN"[1] the base
> SRCREV was bumped from db1991 (the 2.6 tag) to fd7c8356. This means a
> fair amount of cleanup can be made:
> 
> The base recipe should set PV=2.6+git, both of the existing bbappends
> already did this so those can be removed.
> 
> [...]

Applied, thanks!

[1/2] arm/scp-firmware: rationalise SRCREV/bbappends
      commit: a07dec8ad8a260f293a55e8300f514dee134b2d6
[2/2] arm/scp-firmware: backport a build race fix
      commit: d13be36099aff7ea2975a1a197564e2e801707a3

Best regards,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends
  2023-01-09 14:41 [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Ross Burton
                   ` (2 preceding siblings ...)
  2023-01-10 17:02 ` Jon Mason
@ 2023-01-13 16:17 ` Jon Mason
  3 siblings, 0 replies; 5+ messages in thread
From: Jon Mason @ 2023-01-13 16:17 UTC (permalink / raw)
  To: meta-arm, Ross Burton; +Cc: nd

On Mon, 9 Jan 2023 14:41:29 +0000, Ross Burton wrote:
> In "scp-firmware: allow setting log level to INFO or WARN"[1] the base
> SRCREV was bumped from db1991 (the 2.6 tag) to fd7c8356. This means a
> fair amount of cleanup can be made:
> 
> The base recipe should set PV=2.6+git, both of the existing bbappends
> already did this so those can be removed.
> 
> [...]

Applied, thanks!

[1/2] arm/scp-firmware: rationalise SRCREV/bbappends
      commit: a07dec8ad8a260f293a55e8300f514dee134b2d6
[2/2] arm/scp-firmware: backport a build race fix
      commit: d13be36099aff7ea2975a1a197564e2e801707a3

Best regards,
-- 
Jon Mason <jon.mason@arm.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-13 18:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 14:41 [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Ross Burton
2023-01-09 14:41 ` [PATCH][dunfell 2/2] arm/scp-firmware: backport a build race fix Ross Burton
2023-01-09 16:22 ` [PATCH][dunfell 1/2] arm/scp-firmware: rationalise SRCREV/bbappends Jon Mason
2023-01-10 17:02 ` Jon Mason
2023-01-13 16:17 ` Jon Mason

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.