From: René Rebe Subject: [PATCH] sparc64: implement DMA mmap and get_sgtable for IOMMU ops The sun4u and sun4v dma_map_ops lack .mmap, so dma_can_mmap() returns false and ALSA strips all MMAP access modes from PCI sound devices, e.g. the ALi M5455 (snd-intel8x0) in the Sun Blade 1500/2500. Without MMAP access the default dmix device and the plug conversion plugins fail. Coherent allocations are page_address() backed lowmem pages, so the generic dma_common_mmap and dma_common_get_sgtable helpers apply, as on alpha and powerpc. Signed-off-by: René Rebe --- diff -urp a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c @@ -763,6 +764,8 @@ static int dma_4u_supported(struct devic static const struct dma_map_ops sun4u_dma_ops = { .alloc = dma_4u_alloc_coherent, .free = dma_4u_free_coherent, + .mmap = dma_common_mmap, + .get_sgtable = dma_common_get_sgtable, .map_phys = dma_4u_map_phys, .unmap_phys = dma_4u_unmap_phys, .map_sg = dma_4u_map_sg, diff -urp a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c --- a/arch/sparc/kernel/pci_sun4v.c +++ b/arch/sparc/kernel/pci_sun4v.c @@ -695,6 +696,8 @@ static int dma_4v_supported(struct devic static const struct dma_map_ops sun4v_dma_ops = { .alloc = dma_4v_alloc_coherent, .free = dma_4v_free_coherent, + .mmap = dma_common_mmap, + .get_sgtable = dma_common_get_sgtable, .map_phys = dma_4v_map_phys, .unmap_phys = dma_4v_unmap_phys, .map_sg = dma_4v_map_sg,