Re: [PATCH 1/1] drivers: of: bugfix partition fixups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 07, 2018 at 05:40:11PM +0000, Pascal Vizeli wrote:
> If we load a new device tree for linux kernel with a diferent layout,
> the fixup of partition going into endless loop. Exactly the of_find_property
> function will never come back on a invalid device_node.

of_find_property is not called directly from the code you are changing,
so how excatly is the code path that fails?

> 
> My patch check, if the device will exists on device tree before we run the
> fixup.
> 
> Signed-off-by: Pascal Vizeli <pvizeli@xxxxxxxxxx>
> ---
>  drivers/of/partition.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/of/partition.c b/drivers/of/partition.c
> index aa6e601b7..17e420964 100644
> --- a/drivers/of/partition.c
> +++ b/drivers/of/partition.c
> @@ -140,6 +140,9 @@ static int of_partition_fixup(struct device_node *root, void *ctx)
>  	if (!cdev->device_node)
>  		return -EINVAL;
>  
> +	if (!of_find_node_by_path(cdev->device_node->full_name))
> +		return -EINVAL;
> +

What are you doing to get into this situation? This test should never
fail or else we are in trouble. Is there some "oftree -f" command
involved? I should really remove this command since in a device tree
based system there are always references to device nodes which are not
expected to become invalid.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux