iommu/tegra: Fix incorrect size calculation

This driver uses a mixture of ways to get the size of a PTE,
tegra_smmu_set_pde() did it as sizeof(*pd) which became wrong when pd
switched to a struct tegra_pd.

Switch pd back to a u32* in tegra_smmu_set_pde() so the sizeof(*pd)
returns 4.

Fixes: 50568f87d1e2 ("iommu/terga: Do not use struct page as the handle for as->pd memory")
Reported-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Closes: https://lore.kernel.org/all/62e7f7fe-6200-4e4f-ad42-d58ad272baa6@tecnico.ulisboa.pt/
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Jerry Snitselaar <jsnitsel@redhat.com>
Tested-by: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Link: https://lore.kernel.org/r/0-v1-da7b8b3d57eb+ce-iommu_terga_sizeof_jgg@nvidia.com
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by Jason Gunthorpe and committed by Joerg Roedel f9705d66 19272b37

Changed files
+2 -2
drivers
iommu
+2 -2
drivers/iommu/tegra-smmu.c
··· 559 559 { 560 560 unsigned int pd_index = iova_pd_index(iova); 561 561 struct tegra_smmu *smmu = as->smmu; 562 - struct tegra_pd *pd = as->pd; 562 + u32 *pd = &as->pd->val[pd_index]; 563 563 unsigned long offset = pd_index * sizeof(*pd); 564 564 565 565 /* Set the page directory entry first */ 566 - pd->val[pd_index] = value; 566 + *pd = value; 567 567 568 568 /* The flush the page directory entry from caches */ 569 569 dma_sync_single_range_for_device(smmu->dev, as->pd_dma, offset,