Re: [PATCH] OF: kobj node lifecycle fixes
From: Pantelis Antoniou
Date: Thu Mar 13 2014 - 02:40:51 EST
Hi Grant,
On Mar 13, 2014, at 12:49 AM, Grant Likely wrote:
> From: Pantelis Antoniou <panto@xxxxxxxxxxxxxxxxxxxxxxx>
>
> After the move to having device nodes be proper kobjects the lifecycle
> of the node needs to be controlled better.
>
> At first convert of_add_node() in the unflattened functions to
> of_init_node() which initializes the kobject so that of_node_get/put
> work correctly even before of_init is called.
>
> Afterwards introduce of_node_is_initialized & of_node_is_attached that
> query the underlying kobject about the state (attached means kobj
> is visible in sysfs)
>
> Using that make sure the lifecycle of the tree is correct at all
> times.
>
> Signed-off-by: Pantelis Antoniou <panto@xxxxxxxxxxxxxxxxxxxxxxx>
> [grant.likely: moved of_node_init() calls, fixed up locking, and
> dropped __of_populate() hunks]
> Signed-off-by: Grant Likely <grant.likely@xxxxxxxxxx>
> ---
>
> I've reworked Pantelis' patch to work on my tree. Here's the result.
> I've already got this in my tree and will be pushing it out shortly.
>
> g.
>
> drivers/of/base.c | 35 ++++++++++++++++++++++++++---------
> drivers/of/fdt.c | 3 +--
> drivers/of/pdt.c | 3 +--
> include/linux/of.h | 19 +++++++++++++++++++
> 4 files changed, 47 insertions(+), 13 deletions(-)
>
Looks good; booted and tested overlays with no issues.
Regards
-- Pantelis
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/