iommu/tegra: smmu: fix unaliged sg mapping
authorHiroshi Doyu <hdoyu@nvidia.com>
Thu, 10 Apr 2014 06:43:00 +0000 (09:43 +0300)
committerHiroshi Doyu <hdoyu@nvidia.com>
Thu, 10 Apr 2014 12:21:34 +0000 (05:21 -0700)
commit7b4dac1d522cf48e4e6bd227ff235bffa82cb755
tree2ca98dea700bbc6d0d5c13e53f62696814bbedfc
parent7cb44192bfc117c1642e2b8af67cacff8a5304be
iommu/tegra: smmu: fix unaliged sg mapping

map_sg() miscaluculated the number of pages to map where 'offset' and
PAGE_ALIGN was ignored. This patch fixes the ext4 memory corruption
problem when USB is used. This patch was based on Nilesh More's hard
working journey to narrow down the root cause of this problem. This bug
was introduced by the commit:

  f46788a6f7d9 - iommu/tegra: smmu: Optimize smmu_iommu_map_sg()

Bug 1418514

Change-Id: I3492ca3aad48f63bc81e50886eefc32cb6a17a8b
Reported-by: Nilesh More <nmore@nvidia.com>
Tested-by: Nilesh More <nmore@nvidia.com>
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/394554
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nilesh More <nmore@nvidia.com>
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
drivers/iommu/tegra-smmu.c