diff options
author | John Garry <john.garry@huawei.com> | 2019-07-30 21:29:54 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-06 10:23:45 +0200 |
commit | 71817079db2f4a8c0676b7b02af45ba4b585ffe1 (patch) | |
tree | bdfa9258bfecc61d5b537fe8238f2ec07eb3ddf4 /lib | |
parent | 0a6e7568654317183106fcd8e4641c41d5bdf6e4 (diff) | |
download | linux-stable-71817079db2f4a8c0676b7b02af45ba4b585ffe1.tar.gz linux-stable-71817079db2f4a8c0676b7b02af45ba4b585ffe1.tar.bz2 linux-stable-71817079db2f4a8c0676b7b02af45ba4b585ffe1.zip |
lib: logic_pio: Add logic_pio_unregister_range()
commit b884e2de2afc68ce30f7093747378ef972dde253 upstream.
Add a function to unregister a logical PIO range.
Logical PIO space can still be leaked when unregistering certain
LOGIC_PIO_CPU_MMIO regions, but this acceptable for now since there are no
callers to unregister LOGIC_PIO_CPU_MMIO regions, and the logical PIO
region allocation scheme would need significant work to improve this.
Cc: stable@vger.kernel.org
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/logic_pio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/logic_pio.c b/lib/logic_pio.c index d0165c88f705..905027574e5d 100644 --- a/lib/logic_pio.c +++ b/lib/logic_pio.c @@ -99,6 +99,20 @@ end_register: } /** + * logic_pio_unregister_range - unregister a logical PIO range for a host + * @range: pointer to the IO range which has been already registered. + * + * Unregister a previously-registered IO range node. + */ +void logic_pio_unregister_range(struct logic_pio_hwaddr *range) +{ + mutex_lock(&io_range_mutex); + list_del_rcu(&range->list); + mutex_unlock(&io_range_mutex); + synchronize_rcu(); +} + +/** * find_io_range_by_fwnode - find logical PIO range for given FW node * @fwnode: FW node handle associated with logical PIO range * |