SMMU enabled for PCIE : 64kB gapped with pci_map_sg

On the TX1 platform, flashed using Jetpack 28.1 . Smmu has been enabled. Allocating dma_alloc_coherent memory for PCIE works, and gives a single Bus address that I can use successfully. However trying to remap previously allocated memory using pci_map_sg remaps memory into 64kB chunks with 64kB gaps between them.
i.e.
mapping 256 4k pages using pc_map_sg gives me back 16 entries. such that each entry maps 64kB of memory and the spacing between subsequent addresses is 128kB.

Is there a reason for this gap> Do I need to change a configuration parameter somewhere to fix this?

Akmal

Thanks for your observation. We will get back to you on this soon.

Can you please try with the following patch?

diff --git a/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi b/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
index 8322ffec5626..d4da3fb785dc 100644
--- a/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
+++ b/kernel-dts/tegra210-soc/tegra210-soc-base.dtsi
@@ -270,7 +270,7 @@
                 iova-start = <0x0 0x80000000>;
                 iova-size = <0x0 0x7FF00000>;
                 num-pf-page = <0>;
-                gap-page = <1>;
+                gap-page = <0>;
             };
             ppcs_as: ppcs {
                 iova-start = <0x0 0x80000000>;

@vidyas
Many thanks. This seems to have solved the gapping problem. Are there any effects of this change that I should be aware of?

There are no side effects. You can use that patch without any issues if that solves your concern.