* [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly
@ 2018-11-24 9:04 Thomas Petazzoni
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-11-24 9:04 UTC (permalink / raw)
To: buildroot
When c7ffd8a75d55e24d793106eabbb80964ab91081f ("package/dtc: fix
include guards for older kernel/u-boot") introduced a new patch to the
dtc package, it used the 0001 number, which was already used by
another patch. Let's fix that.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename package/dtc/{0001-Fix-include-guards-for-older-kernel-u-boot-sources.patch => 0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch} (100%)
diff --git a/package/dtc/0001-Fix-include-guards-for-older-kernel-u-boot-sources.patch b/package/dtc/0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch
similarity index 100%
rename from package/dtc/0001-Fix-include-guards-for-older-kernel-u-boot-sources.patch
rename to package/dtc/0002-Fix-include-guards-for-older-kernel-u-boot-sources.patch
--
2.19.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files
2018-11-24 9:04 [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Thomas Petazzoni
@ 2018-11-24 9:04 ` Thomas Petazzoni
2018-11-26 16:26 ` Peter Korsgaard
2018-11-26 18:04 ` Peter Korsgaard
2018-11-26 16:26 ` [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Peter Korsgaard
2018-11-26 18:03 ` Peter Korsgaard
2 siblings, 2 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2018-11-24 9:04 UTC (permalink / raw)
To: buildroot
The build of U-Boot on Microchip (formerly Atmel) platforms currently
fails to build with an Assertion Error in dtc. This happens since we
bumped dtc from 1.4.4 to 1.4.7, as a regression was introduced in dtc
1.4.6, and fixed post-1.4.7. This commit backports the upstream commit
to resolve this Assertion Error.
The build error was:
dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
Aborted (core dumped)
Fixes:
https://gitlab.com/buildroot.org/buildroot/-/jobs/124434438
(and numerous other similar build failures)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
...s-fix-simple-bus-compatible-matching.patch | 120 ++++++++++++++++++
1 file changed, 120 insertions(+)
create mode 100644 package/dtc/0003-checks-fix-simple-bus-compatible-matching.patch
diff --git a/package/dtc/0003-checks-fix-simple-bus-compatible-matching.patch b/package/dtc/0003-checks-fix-simple-bus-compatible-matching.patch
new file mode 100644
index 0000000000..ab95214a53
--- /dev/null
+++ b/package/dtc/0003-checks-fix-simple-bus-compatible-matching.patch
@@ -0,0 +1,120 @@
+From 5277449e5fd13a2f3778ed3380ba157cb9d4ea55 Mon Sep 17 00:00:00 2001
+From: Rob Herring <robh@kernel.org>
+Date: Thu, 20 Sep 2018 14:30:03 -0700
+Subject: [PATCH] checks: fix simple-bus compatible matching
+
+Since commit 7975f6422260 ("Fix widespread incorrect use of strneq(),
+replace with new strprefixeq()") simple-bus checks have been silently
+skipped. The problem was 'end - str' is one more than the string length
+and the strnlen in strprefixeq fails. This can't be fixed simply by
+subtracting one as it is possible to have multiple '\0' at the end of
+the property. Fix this by making the 'compatible' property string list
+check a dependency, and then we can assume the property is null
+terminated and we can just use streq() for comparisons.
+
+Add some tests so the problem doesn't happen again.
+
+Fixes: 7975f6422260 ("Fix widespread incorrect use of strneq(), replace with new strprefixeq()")
+Reported-by: Kumar Gala <kumar.gala@linaro.org>
+Signed-off-by: Rob Herring <robh@kernel.org>
+Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
+[Backport from upstream commit e84742aa7b934cd6603e3a64f8c0966f683c5711]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ checks.c | 5 +++--
+ tests/run_tests.sh | 4 ++++
+ tests/unit-addr-simple-bus-compatible.dts | 18 ++++++++++++++++++
+ tests/unit-addr-simple-bus-reg-mismatch.dts | 18 ++++++++++++++++++
+ 4 files changed, 43 insertions(+), 2 deletions(-)
+ create mode 100644 tests/unit-addr-simple-bus-compatible.dts
+ create mode 100644 tests/unit-addr-simple-bus-reg-mismatch.dts
+
+diff --git a/checks.c b/checks.c
+index a2cc103..acf91c3 100644
+--- a/checks.c
++++ b/checks.c
+@@ -910,7 +910,7 @@ static bool node_is_compatible(struct node *node, const char *compat)
+
+ for (str = prop->val.val, end = str + prop->val.len; str < end;
+ str += strnlen(str, end - str) + 1) {
+- if (strprefixeq(str, end - str, compat))
++ if (streq(str, compat))
+ return true;
+ }
+ return false;
+@@ -921,7 +921,8 @@ static void check_simple_bus_bridge(struct check *c, struct dt_info *dti, struct
+ if (node_is_compatible(node, "simple-bus"))
+ node->bus = &simple_bus;
+ }
+-WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL, &addr_size_cells);
++WARNING(simple_bus_bridge, check_simple_bus_bridge, NULL,
++ &addr_size_cells, &compatible_is_string_list);
+
+ static void check_simple_bus_reg(struct check *c, struct dt_info *dti, struct node *node)
+ {
+diff --git a/tests/run_tests.sh b/tests/run_tests.sh
+index 7348c9c..c4354d2 100755
+--- a/tests/run_tests.sh
++++ b/tests/run_tests.sh
+@@ -652,6 +652,10 @@ dtc_tests () {
+ check_tests pci-bridge-bad1.dts pci_bridge
+ check_tests pci-bridge-bad2.dts pci_bridge
+
++ check_tests unit-addr-simple-bus-reg-mismatch.dts simple_bus_reg
++ check_tests unit-addr-simple-bus-compatible.dts simple_bus_reg
++
++
+ # Check warning options
+ run_sh_test dtc-checkfails.sh address_cells_is_cell interrupt_cells_is_cell -n size_cells_is_cell -- -Wno_size_cells_is_cell -I dts -O dtb bad-ncells.dts
+ run_sh_test dtc-fails.sh -n test-warn-output.test.dtb -I dts -O dtb bad-ncells.dts
+diff --git a/tests/unit-addr-simple-bus-compatible.dts b/tests/unit-addr-simple-bus-compatible.dts
+new file mode 100644
+index 0000000..c8f9341
+--- /dev/null
++++ b/tests/unit-addr-simple-bus-compatible.dts
+@@ -0,0 +1,18 @@
++/dts-v1/;
++
++/ {
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ bus at 10000000 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "foo-bus", "simple-bus";
++ ranges = <0x0 0x10000000 0x10000>;
++
++ node at 100 {
++ reg = <0x1000 1>;
++ };
++ };
++
++};
+diff --git a/tests/unit-addr-simple-bus-reg-mismatch.dts b/tests/unit-addr-simple-bus-reg-mismatch.dts
+new file mode 100644
+index 0000000..2823377
+--- /dev/null
++++ b/tests/unit-addr-simple-bus-reg-mismatch.dts
+@@ -0,0 +1,18 @@
++/dts-v1/;
++
++/ {
++ #address-cells = <1>;
++ #size-cells = <1>;
++
++ bus at 10000000 {
++ #address-cells = <1>;
++ #size-cells = <1>;
++ compatible = "simple-bus";
++ ranges = <0x0 0x10000000 0x10000>;
++
++ node at 100 {
++ reg = <0x1000 1>;
++ };
++ };
++
++};
+--
+2.19.1
+
--
2.19.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly
2018-11-24 9:04 [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Thomas Petazzoni
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
@ 2018-11-26 16:26 ` Peter Korsgaard
2018-11-26 18:03 ` Peter Korsgaard
2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2018-11-26 16:26 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> When c7ffd8a75d55e24d793106eabbb80964ab91081f ("package/dtc: fix
> include guards for older kernel/u-boot") introduced a new patch to the
> dtc package, it used the 0001 number, which was already used by
> another patch. Let's fix that.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
@ 2018-11-26 16:26 ` Peter Korsgaard
2018-11-26 18:04 ` Peter Korsgaard
1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2018-11-26 16:26 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> The build of U-Boot on Microchip (formerly Atmel) platforms currently
> fails to build with an Assertion Error in dtc. This happens since we
> bumped dtc from 1.4.4 to 1.4.7, as a regression was introduced in dtc
> 1.4.6, and fixed post-1.4.7. This commit backports the upstream commit
> to resolve this Assertion Error.
> The build error was:
> dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
> dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
> Aborted (core dumped)
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/124434438
> (and numerous other similar build failures)
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly
2018-11-24 9:04 [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Thomas Petazzoni
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
2018-11-26 16:26 ` [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Peter Korsgaard
@ 2018-11-26 18:03 ` Peter Korsgaard
2 siblings, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2018-11-26 18:03 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> When c7ffd8a75d55e24d793106eabbb80964ab91081f ("package/dtc: fix
> include guards for older kernel/u-boot") introduced a new patch to the
> dtc package, it used the 0001 number, which was already used by
> another patch. Let's fix that.
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2018.08.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
2018-11-26 16:26 ` Peter Korsgaard
@ 2018-11-26 18:04 ` Peter Korsgaard
1 sibling, 0 replies; 6+ messages in thread
From: Peter Korsgaard @ 2018-11-26 18:04 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> The build of U-Boot on Microchip (formerly Atmel) platforms currently
> fails to build with an Assertion Error in dtc. This happens since we
> bumped dtc from 1.4.4 to 1.4.7, as a regression was introduced in dtc
> 1.4.6, and fixed post-1.4.7. This commit backports the upstream commit
> to resolve this Assertion Error.
> The build error was:
> dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
> dtc: livetree.c:438: propval_cell: Assertion `prop->val.len == sizeof(cell_t)' failed.
> Aborted (core dumped)
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/124434438
> (and numerous other similar build failures)
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Committed to 2018.08.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-11-26 18:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 9:04 [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Thomas Petazzoni
2018-11-24 9:04 ` [Buildroot] [PATCH 2/2] package/dtc: backport upstream fix solving Assertion Error with some .dts files Thomas Petazzoni
2018-11-26 16:26 ` Peter Korsgaard
2018-11-26 18:04 ` Peter Korsgaard
2018-11-26 16:26 ` [Buildroot] [PATCH 1/2] package/dtc: renumber patches correctly Peter Korsgaard
2018-11-26 18:03 ` Peter Korsgaard
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.