Message ID | 20190219075339.14226-1-oohall@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/4] hdata/test: Fix up linux,sml-base property | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | master/apply_patch Successfully applied |
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot | success | Test snowpatch/job/snowpatch-skiboot on branch master |
"Oliver O'Halloran" <oohall@gmail.com> writes: > The linux,sml-base property stores a raw pointer into the HDAT area. > When running the hdat parser tester the load address of the HDAT will > change each time the tool is run so we need to sanatise the property > to get consistent output. > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > --- > hdata/test/hdata_to_dt.c | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) Series merged to master as of 4822a7ba9d33468a15d1c90ee8c0823826d33320. I added in the dts result for the OP920 HDAT test data as it looks like you missed 'git add'ing it (or something messed up along the way)
On Thu, Feb 21, 2019 at 5:15 PM Stewart Smith <stewart@linux.ibm.com> wrote: > > "Oliver O'Halloran" <oohall@gmail.com> writes: > > The linux,sml-base property stores a raw pointer into the HDAT area. > > When running the hdat parser tester the load address of the HDAT will > > change each time the tool is run so we need to sanatise the property > > to get consistent output. > > > > Signed-off-by: Oliver O'Halloran <oohall@gmail.com> > > --- > > hdata/test/hdata_to_dt.c | 15 +++++++++++++++ > > 1 file changed, 15 insertions(+) > > Series merged to master as of 4822a7ba9d33468a15d1c90ee8c0823826d33320. > > I added in the dts result for the OP920 HDAT test data as it looks like > you missed 'git add'ing it (or something messed up along the way) I'd say I just forgot :) Thanks > > -- > Stewart Smith > OPAL Architect, IBM. >
diff --git a/hdata/test/hdata_to_dt.c b/hdata/test/hdata_to_dt.c index fd2957ce60d0..a5f152e86b63 100644 --- a/hdata/test/hdata_to_dt.c +++ b/hdata/test/hdata_to_dt.c @@ -253,8 +253,23 @@ static void squash_blobs(struct dt_node *root) static void dump_hdata_fdt(struct dt_node *root) { + struct dt_node *n; void *fdt_blob; + /* delete some properties that hardcode pointers */ + dt_for_each_node(dt_root, n) { + struct dt_property *base; + + /* + * sml-base is a raw pointer into the HDAT area so it changes + * on each execution of hdata_to_dt. Work around this by + * zeroing it. + */ + base = __dt_find_property(n, "linux,sml-base"); + if (base) + memset(base->prop, 0, base->len); + } + fdt_blob = create_dtb(root, false); if (!fdt_blob) {
The linux,sml-base property stores a raw pointer into the HDAT area. When running the hdat parser tester the load address of the HDAT will change each time the tool is run so we need to sanatise the property to get consistent output. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> --- hdata/test/hdata_to_dt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)