The patch titled Subject: mm/devm_memremap_pages: introduce devm_memunmap_pages has been added to the -mm tree. Its filename is mm-devm_memremap_pages-introduce-devm_memunmap_pages.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-devm_memremap_pages-introduce-devm_memunmap_pages.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-devm_memremap_pages-introduce-devm_memunmap_pages.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Dan Williams <dan.j.williams@xxxxxxxxx> Subject: mm/devm_memremap_pages: introduce devm_memunmap_pages Use the new devm_relase_action() facility to allow devm_memremap_pages_release() to be manually triggered. Link: http://lkml.kernel.org/r/155727337088.292046.5774214552136776763.stgit@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx> Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx> Reviewed-by: Logan Gunthorpe <logang@xxxxxxxxxxxx> Cc: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: "Jérôme Glisse" <jglisse@xxxxxxxxxx> Cc: "Rafael J. Wysocki" <rafael@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/memremap.h | 6 ++++++ kernel/memremap.c | 6 ++++++ 2 files changed, 12 insertions(+) --- a/include/linux/memremap.h~mm-devm_memremap_pages-introduce-devm_memunmap_pages +++ a/include/linux/memremap.h @@ -100,6 +100,7 @@ struct dev_pagemap { #ifdef CONFIG_ZONE_DEVICE void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap); +void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap); struct dev_pagemap *get_dev_pagemap(unsigned long pfn, struct dev_pagemap *pgmap); @@ -118,6 +119,11 @@ static inline void *devm_memremap_pages( return ERR_PTR(-ENXIO); } +static inline void devm_memunmap_pages(struct device *dev, + struct dev_pagemap *pgmap) +{ +} + static inline struct dev_pagemap *get_dev_pagemap(unsigned long pfn, struct dev_pagemap *pgmap) { --- a/kernel/memremap.c~mm-devm_memremap_pages-introduce-devm_memunmap_pages +++ a/kernel/memremap.c @@ -269,6 +269,12 @@ void *devm_memremap_pages(struct device } EXPORT_SYMBOL_GPL(devm_memremap_pages); +void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap) +{ + devm_release_action(dev, devm_memremap_pages_release, pgmap); +} +EXPORT_SYMBOL_GPL(devm_memunmap_pages); + unsigned long vmem_altmap_offset(struct vmem_altmap *altmap) { /* number of pfns from base where pfn_to_page() is valid */ _ Patches currently in -mm which might be from dan.j.williams@xxxxxxxxx are drivers-base-devres-introduce-devm_release_action.patch mm-devm_memremap_pages-introduce-devm_memunmap_pages.patch pci-p2pdma-fix-the-gen_pool_add_virt-failure-path.patch lib-genalloc-introduce-chunk-owners.patch pci-p2pdma-track-pgmap-references-per-resource-not-globally.patch mm-devm_memremap_pages-fix-final-page-put-race.patch