Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems is fdt_init_node (fdt_generic_util.c) #39

Open
cmcoldwell opened this issue Jan 2, 2020 · 9 comments
Open

Problems is fdt_init_node (fdt_generic_util.c) #39

cmcoldwell opened this issue Jan 2, 2020 · 9 comments

Comments

@cmcoldwell
Copy link

Testing the variable compat_len before it is initialized.
Leaking memory (device_type = g_strdup_printf("device_type:%s", device_type);

My gawd: this is bush league stuff.

I'm working on a patch.

@edgarigl
Copy link
Contributor

edgarigl commented Jan 8, 2020

Thanks for contributing!

A few comments:

Unfortunately the patches do not pass checkpatch, you can try on your own by doing:
git show | ./scripts/checkpatch.pl -

It would also be great if you could prefix the summary of the commit message with something.
E.g fdt-generic: Some description
You can see examples in the history for a specific file or submodule with git log -- file.c

Also, if the patch is non-obvious, it would be great if you could provide some context in the commit-message, e.g for patches 2 & 4.

I've fixed up and applied patch 1 & 3.

Could you please fix up and resubmit patch 2 & 4, perhaps as a pull request on github?

Thanks again for contributing!

Cheers,
Edgar

@cmcoldwell
Copy link
Author

cmcoldwell commented Jan 8, 2020 via email

@cmcoldwell
Copy link
Author

cmcoldwell commented Jan 8, 2020 via email

@edgarigl edgarigl reopened this Jan 8, 2020
@edgarigl
Copy link
Contributor

edgarigl commented Jan 8, 2020

Hi,

I've applied patch #1.

Patch number 2 breaks our system though. We rely quite heavily on attaching devices to the actual parent bus. I'm not sure how we'd work around this for device-tree's that don't match this. Perhaps you could find a way to specifically catch the orphaned case and apply your logic only in that case.

Did you publish the device-tree causing problems somewhere?
Is that device-tree auto-generated or are we in a position to hand-edit it?

Thanks,
Edgar

@cmcoldwell
Copy link
Author

The device tree that causes the problem was auto-generated by the Xilinx HSI utility (although I hand edited system-top.dts to add the memory@0 node). I'm attaching the files.

I'll take another look and see if I can find a better way. To be honest, this method felt pretty heavy-handed when I did it.

dts.zip

@cmcoldwell
Copy link
Author

OK, here's another swing at the problem. I'll admit my understanding of QOM and QDev (and the relationship between the two) is limited, but it looks like when MMIO regions (e.g. "amba_pl") are "orphaned", they get added as "child" type properties to the root node of the object tree. This code finds those properties and adds them to the system bus memory map. Passes checkpatch.pl.

0001-Put-orphaned-MMIO-into-system-memory-map.txt

@cmcoldwell
Copy link
Author

cmcoldwell commented Jan 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants