Skip to content

io_remap_pfn_range: intro.

Randy.Dunlap linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4io_remap_pfn_range: add for all arch-esarch/sparc/kernel/sparc_ksyms.c arch/sparc/mm/generic.c arch/sparc64/kernel/pci.c +21 more+251 -212 replies
2/4io_remap_pfn_range: convert sparc callersdrivers/char/drm/drm_vm.c drivers/sbus/char/vfc_dev.c drivers/video/fbmem.c +1 more+15 -110 replies
3/4io_remap_pfn_range: fix some callers for XENdrivers/char/agp/frontend.c drivers/char/drm/drm_vm.c drivers/char/drm/i810_dma.c +3 more+10 -80 replies
4/4io_remap_pfn_range: convert last callersDocumentation/feature-removal-schedule.txt arch/sh/kernel/cpu/sh4/sq.c drivers/video/acornfb.c +4 more+16 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] io_remap_pfn_range: intro.

This is a combination of io_remap_pfn_range patches posted in the last week or so by Keir Fraser and me.

This description is mostly from Keir's original post.

This patch introduces a new interface function for mapping bus/device
memory: io_remap_pfn_range. This accepts the same parameters as remap_pfn_range and io_remap_page_range but should be used in any situation where the caller is not simply remapping ordinary RAM. For example, when mapping device registers the new function should be used.

The distinction between remapping device memory and ordinary RAM is critical for the Xen hypervisor.

This patch series also cleans up the remaining users of io_remap_page_range (in particular, the several sparc-specific sections in various drivers that use a special form of io_remap_page_range:
an extra <iospace> argument for SPARC arch.) by converting them to use io_remap_pfn_range(), where io_remap_pfn_range() supports passing <iospace> as part of the pfn argument.

The sparc32 & sparc64 code needs live testing.

(from Keir:)
I have audited the drivers/ and sound/ directories. Most uses of remap_pfn_range are okay, but there are a small handful that are remapping device memory (mostly AGP and DRM drivers).

Of particular driver is the HPET driver, whose mmap function is broken even for native (non-Xen) builds. If nothing else, vmalloc_to_phys should be used instead of __pa to convert an ioremapped virtual address to a valid physical address. The fix in this patch is to remember the original bus address as probed at boot time and to pass this to io_remap_pfn_range.

---
~Randy
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>