lkml.org 
[lkml]   [2023]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3 2/2] of/platform: increase refcount of fwnode

On Mon, 21 Aug 2023 10:39:28 +0800, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
>
> commit 0f8e5651095b
> ("of/platform: Propagate firmware node by calling device_set_node()")
> use of_fwnode_handle to replace of_node_get, which introduces a side
> effect that the refcount is not increased. Then the out of tree
> jailhouse hypervisor enable/disable test will trigger kernel dump in
> of_overlay_remove, with the following sequence
> "
> of_changeset_revert(&overlay_changeset);
> of_changeset_destroy(&overlay_changeset);
> of_overlay_remove(&overlay_id);
> "
>
> So increase the refcount to avoid issues.
>
> This patch also release the refcount when releasing amba device to avoid
> refcount leakage.
>
> Fixes: 0f8e5651095b ("of/platform: Propagate firmware node by calling device_set_node()")
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>
> V3:
> - Move amba device changes to patch 1/1
>
> V2:
> - Per Andy's comment, use of_fwnode_handle(of_node_get(np))
> - release amba device of_node refcount when releasing amba device, this is
> done from code inspection, no test.
>
> drivers/of/platform.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Applied, thanks!

\
 
 \ /
  Last update: 2023-08-21 23:02    [W:0.097 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site