Re: [PATCH v7 45/50] drivers/of: Avoid recursively calling unflatten_dt_node()
From: Guenter Roeck <hidden>
Date: 2015-12-06 21:49:29
Also in:
linux-pci, linuxppc-dev
On 12/06/2015 12:28 PM, Rob Herring wrote:
+Guenter On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan [off-list ref] wrote:quoted
In current implementation, unflatten_dt_node() is called recursively to unflatten device nodes in FDT blob. It's stress to limited stack capacity. This avoids calling the function recursively, meaning the device nodes are unflattened in one call on unflatten_dt_node(): two arrays are introduced to track the parent path size and the device node of current level of depth, which will be used by the device node on next level of depth to be unflattened. Also, the parameter "poffset" and "fpsize" are unused and dropped.Do you plan to respin the OF parts at least soon? There's another problem Guenter found that of_fdt_unflatten_tree is not re-entrant due to "depth" being static and this series fixes that. So I'd rather apply this and avoid adding a mutex if possible.
Hi Rob, We see this problem in 4.1, so whatever patch you accept should be back-ported to at least that release. Any idea when this patch will be accepted ? We actively see the problem in our kernel, so I'll need a solution soon. Otherwise I'll have to apply my patch to our kernel and revert it as soon as the 'real' patch has been back-ported. Thanks, Guenter -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html