[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200729033424.2629-3-justin.he@arm.com>
Date: Wed, 29 Jul 2020 11:34:20 +0800
From: Jia He <justin.he@....com>
To: Dan Williams <dan.j.williams@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>
Cc: Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Dave Jiang <dave.jiang@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Steve Capper <steve.capper@....com>,
Mark Rutland <mark.rutland@....com>,
Logan Gunthorpe <logang@...tatee.com>,
Anshuman Khandual <anshuman.khandual@....com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Jason Gunthorpe <jgg@...pe.ca>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Kees Cook <keescook@...omium.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-nvdimm@...ts.01.org, linux-mm@...ck.org,
Wei Yang <richardw.yang@...ux.intel.com>,
Pankaj Gupta <pankaj.gupta.linux@...il.com>,
Ira Weiny <ira.weiny@...el.com>, Kaly Xin <Kaly.Xin@....com>,
Jia He <justin.he@....com>
Subject: [RFC PATCH 2/6] resource: export find_next_iomem_res() helper
The helper is to find the lowest iomem resource that covers part of
[@start..@end]
It is useful when relaxing the alignment check for dax pmem kmem.
Signed-off-by: Jia He <justin.he@....com>
---
include/linux/ioport.h | 3 +++
kernel/resource.c | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 6c2b06fe8beb..203fd16c9f45 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -247,6 +247,9 @@ extern struct resource * __request_region(struct resource *,
extern void __release_region(struct resource *, resource_size_t,
resource_size_t);
+extern int find_next_iomem_res(resource_size_t start, resource_size_t end,
+ unsigned long flags, unsigned long desc,
+ bool first_lvl, struct resource *res);
#ifdef CONFIG_MEMORY_HOTREMOVE
extern int release_mem_region_adjustable(struct resource *, resource_size_t,
resource_size_t);
diff --git a/kernel/resource.c b/kernel/resource.c
index 841737bbda9e..57e6a6802a3d 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -338,7 +338,7 @@ EXPORT_SYMBOL(release_resource);
* @first_lvl: walk only the first level children, if set
* @res: return ptr, if resource found
*/
-static int find_next_iomem_res(resource_size_t start, resource_size_t end,
+int find_next_iomem_res(resource_size_t start, resource_size_t end,
unsigned long flags, unsigned long desc,
bool first_lvl, struct resource *res)
{
@@ -391,6 +391,7 @@ static int find_next_iomem_res(resource_size_t start, resource_size_t end,
read_unlock(&resource_lock);
return p ? 0 : -ENODEV;
}
+EXPORT_SYMBOL(find_next_iomem_res);
static int __walk_iomem_res_desc(resource_size_t start, resource_size_t end,
unsigned long flags, unsigned long desc,
--
2.17.1
Powered by blists - more mailing lists