devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Device tree flattening code not copying properties from blob
@ 2013-06-12 14:32 Collins, Rod
       [not found] ` <8BE8E6569B96CE4AA5EDE9F8314B7FB1EEF696-gEjpXB0kThW1wM3WIAwN2vV4jgPAACGKVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Collins, Rod @ 2013-06-12 14:32 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ


[-- Attachment #1.1.1: Type: text/plain, Size: 2377 bytes --]

I have been chasing a problem where a module device driver that uses the
device tree I install, cannot find a compatible match when I know the
device tree has the match for my driver.

 

So I wrote a small module device driver that dumps the device tree
information. I add it to the device driver list using insmod dtdump.ko.
If I add the insmod to the start of the rc (using uCLinux distribution)
file then I get the proper contents. If I add insmod at the end of the
rc file then the device tree is bad.

 

The problem is in the file fdt.c and the function unflatten_dt_node.

 

When the unflattened tree is created the memory is allocated for the
nodes and the property structures, however the pointers are just
inserted into the property structure. The pointers are pointing in the
memory area freed after initialization. This will work if the embedded
__init memory is not freed but freeing this memory ends up with tree
nodes that have invalid properties and thus the device tree is no good.

 

I am working on a fix to the unflatten_dt_node function. Allocate space
for the property name and value and copy them in also as the node name
is done.

 

Does anyone know if there is already a fix for this?

 

Rod Collins

Principal Software Engineer

Saab Sensis Corporation

315-445-5784

rodc-eu1g02Y2shuDvotElmWtJA@public.gmane.org <mailto:rodc-eu1g02Y2shuDvotElmWtJA@public.gmane.org> 

 

 

-
This message is intended only for the addressee and may contain information that is company confidential or privileged.  Any technical data in this message may be exported only in accordance with the U.S. International Traffic in Arms Regulations (22 CFR Parts 120-130) or the Export Administration Regulations (15 CFR Parts 730-774). Unauthorized use is strictly prohibited and may be unlawful. If you are not the intended recipient, or the person responsible for delivering to the intended recipient, you should not read, copy, disclose or otherwise use this message. If you have received this email in error, please delete it, and advise the sender immediately. 
-                                                                                                                                                                                                                                                       

[-- Attachment #1.1.2: Type: text/html, Size: 5898 bytes --]

[-- Attachment #1.2: image001.png --]
[-- Type: image/png, Size: 13229 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

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

end of thread, other threads:[~2013-06-15 19:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-12 14:32 Device tree flattening code not copying properties from blob Collins, Rod
     [not found] ` <8BE8E6569B96CE4AA5EDE9F8314B7FB1EEF696-gEjpXB0kThW1wM3WIAwN2vV4jgPAACGKVpNB7YpNyf8@public.gmane.org>
2013-06-12 16:02   ` Grant Likely
     [not found]     ` <CACxGe6sdsXp0g9MJ2npupQedXpnge7kp_v=BqnErf+J6oXnyeg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-12 17:33       ` Collins, Rod
     [not found]         ` <8BE8E6569B96CE4AA5EDE9F8314B7FB1EEF722-gEjpXB0kThW1wM3WIAwN2vV4jgPAACGKVpNB7YpNyf8@public.gmane.org>
2013-06-12 18:23           ` Grant Likely
     [not found]             ` <CACxGe6urthkotuwU2OtqEMn8WmBxU=hSmrKyffHR=Pbayo_HKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-12 19:12               ` Walter Goossens
     [not found]                 ` <51B8C827.7060704-CmkmPbn3yAE@public.gmane.org>
2013-06-12 23:21                   ` [Nios2-dev] Device tree flattening code not copying propertiesfrom blob Collins, Rod
2013-06-15 13:14                   ` Device tree flattening code not copying properties from blob Grant Likely
2013-06-15 18:59                     ` Walter Goossens
     [not found]                       ` <51BCB9A9.4040707-CmkmPbn3yAE@public.gmane.org>
2013-06-15 19:46                         ` Grant Likely
2013-06-13 22:49       ` Collins, Rod
     [not found]         ` <8BE8E6569B96CE4AA5EDE9F8314B7FB1EEF975-gEjpXB0kThW1wM3WIAwN2vV4jgPAACGKVpNB7YpNyf8@public.gmane.org>
2013-06-13 23:47           ` Grant Likely
     [not found]             ` <CACxGe6s+Br8mYDfULsDcA9Ym3mqtyXZ41uK1un-nzcZH0BHtDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-06-14 15:55               ` Collins, Rod
     [not found]                 ` <8BE8E6569B96CE4AA5EDE9F8314B7FB1EEFA19-gEjpXB0kThW1wM3WIAwN2vV4jgPAACGKVpNB7YpNyf8@public.gmane.org>
2013-06-15 19:53                   ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).