Thread (34 messages) 34 messages, 7 authors, 2025-10-06

Re: [PATCH v1 3/9] parisc: Convert DMA map_page to map_phys interface

From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2025-10-03 15:01:49
Also in: linux-alpha, linux-iommu, linux-mips, lkml, sparclinux, virtualization, xen-devel

On Sun, Sep 28, 2025 at 06:02:23PM +0300, Leon Romanovsky wrote:
+ccio_map_phys(struct device *dev, phys_addr_t phys, size_t size,
+	      enum dma_data_direction direction, unsigned long attrs)
 {
-	return ccio_map_single(dev, page_address(page) + offset, size,
-			direction);
+	if (attrs & DMA_ATTR_MMIO)
+		return DMA_MAPPING_ERROR;
+
+	return ccio_map_single(dev, phys_to_virt(phys), size, direction);
This doesn't actually use the virt at all:

	offset = ((unsigned long) addr) & ~IOVP_MASK;
	if((size % L1_CACHE_BYTES) || ((unsigned long)addr % L1_CACHE_BYTES))
		ccio_io_pdir_entry(pdir_start, KERNEL_SPACE, (unsigned long)addr, hint);

And ccio_io_pdir_entry():
	pa = lpa(vba);

Is a special instruction that uses virt but AI tells me that special
LPA instruction is returning phys. Not sure if that is a different
value than virt_to_phys()..

IDK, I'm not feeling brave enough to drop the LPA but maybe include
this note in the commit message.

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help