diff options
author | Frank Rowand <frank.rowand@sony.com> | 2018-07-12 14:00:07 -0700 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-07-16 08:41:32 -0600 |
commit | b9952b5218added5577e4a3443969bc20884cea9 (patch) | |
tree | ea6672754a6ec83753a9a3b63bbb3dd0c68ec708 /drivers/of/base.c | |
parent | a47c9b3943164453d4f580ea174a6ddcb37554c3 (diff) | |
download | linux-b9952b5218added5577e4a3443969bc20884cea9.tar.gz linux-b9952b5218added5577e4a3443969bc20884cea9.tar.bz2 linux-b9952b5218added5577e4a3443969bc20884cea9.zip |
of: overlay: update phandle cache on overlay apply and remove
A comment in the review of the patch adding the phandle cache said that
the cache would have to be updated when modules are applied and removed.
This patch implements the cache updates.
Fixes: 0b3ce78e90fc ("of: cache phandle nodes to reduce cost of of_find_node_by_phandle()")
Reported-by: Alan Tull <atull@kernel.org>
Suggested-by: Alan Tull <atull@kernel.org>
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/base.c')
-rw-r--r-- | drivers/of/base.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c index 848f549164cd..466e3c8582f0 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c @@ -102,7 +102,7 @@ static u32 phandle_cache_mask; * - the phandle lookup overhead reduction provided by the cache * will likely be less */ -static void of_populate_phandle_cache(void) +void of_populate_phandle_cache(void) { unsigned long flags; u32 cache_entries; @@ -134,8 +134,7 @@ out: raw_spin_unlock_irqrestore(&devtree_lock, flags); } -#ifndef CONFIG_MODULES -static int __init of_free_phandle_cache(void) +int of_free_phandle_cache(void) { unsigned long flags; @@ -148,6 +147,7 @@ static int __init of_free_phandle_cache(void) return 0; } +#if !defined(CONFIG_MODULES) late_initcall_sync(of_free_phandle_cache); #endif |