Thread (51 messages) 51 messages, 6 authors, 2021-05-31

Re: [PATCH v7 14/15] dt-bindings: of: Add restricted DMA pool

flat view

From: Claire Chang <hidden>
Date: 2021-05-27 11:29:51
Also in: dri-devel, intel-gfx, linux-iommu, linux-pci, linuxppc-dev, lkml, xen-devel

On Wed, May 26, 2021 at 11:53 PM Will Deacon [off-list ref] wrote:
On Wed, May 26, 2021 at 01:13:22PM +0100, Will Deacon wrote:
quoted
On Tue, May 18, 2021 at 02:42:14PM +0800, Claire Chang wrote:
quoted
@@ -138,4 +160,9 @@ one for multimedia processing (named multimedia-memory@77000000, 64MiB).
            memory-region = <&multimedia_reserved>;
            /* ... */
    };
+
+   pcie_device: pcie_device@0,0 {
+           memory-region = <&restricted_dma_mem_reserved>;
+           /* ... */
+   };
I still don't understand how this works for individual PCIe devices -- how
is dev->of_node set to point at the node you have above?

I tried adding the memory-region to the host controller instead, and then
I see it crop up in dmesg:

  | pci-host-generic 40000000.pci: assigned reserved memory node restricted_dma_mem_reserved

but none of the actual PCI devices end up with 'dma_io_tlb_mem' set, and
so the restricted DMA area is not used. In fact, swiotlb isn't used at all.

What am I missing to make this work with PCIe devices?
Aha, looks like we're just missing the logic to inherit the DMA
configuration. The diff below gets things working for me.
I guess what was missing is the reg property in the pcie_device node.
Will update the example dts.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help