On Fri, Nov 08, 2019 at 10:35:30AM +0200, Stefan Mavrodiev wrote: > > On 11/7/19 6:56 PM, David Gibson wrote: > > On Tue, Nov 05, 2019 at 10:09:52AM +0200, Stefan Mavrodiev wrote: > > > When libfdt applies overlay, which has aliases, they are added to > > > the __symbols__ node. Since the overlay path is string, it ends with > > > trailing zero. However, when calculating path length, this symbol should > > > be excluded. The effect is, that the property is threated as integer > > > instead of string. > > > > > > Here is a simple example. Using test/overlay_base: > > > / { > > > test-node { > > > ... > > > }; > > > __symbols__ { > > > test = "/test-node"; > > > ... > > > }; > > > }; > > > > > > Compaling simple overlay with alias node: > > > / { > > > fragment@0 { > > > target = <0xffffffff>; > > > __overlay__ { > > > foo { > > > bar = "bar"; > > > phandle = <0x00000001>; > > > }; > > > }; > > > }; > > > __symbols__ { > > > foo = "/fragment@0/__overlay__/foo"; > > > }; > > > __fixups__ { > > > test = "/fragment@0:target:0"; > > > }; > > > }; > > > > > > After merge: > > > / { > > > ... > > > __symbols__ { > > > foo = <0x2f746573 0x742d6e6f 0x64652f66 0x6f6f0000>; > > > ... > > > }; > > > }; > > > > > > You can see that the foo value is wrong. It's parsed as int, instead of string. Same > > > test with the fix: > > > > > > / { > > > ... > > > __symbols__ { > > > foo = "/test-node/foo"; > > > ... > > > }; > > > }; > > > > > > Signed-off-by: Stefan Mavrodiev <stefan@xxxxxxxxxx> > > LGTM, but it'd be great if you could add a test case for this as well. > > Sure, I could do that. Should I do this by re-sending this series as v2 or > as separate? As a v2, please. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
signature.asc
Description: PGP signature