iommu/tegra: smmu: fix unaliged sg mapping
authorHiroshi Doyu <hdoyu@nvidia.com>
Thu, 10 Apr 2014 06:43:00 +0000 (09:43 +0300)
committerWinnie Hsu <whsu@nvidia.com>
Fri, 11 Apr 2014 23:09:59 +0000 (16:09 -0700)
commit9e3033947d91e80a45a17ff68401e03cbf33c38a
tree9e8afd2c359187a1246e14c11794cf38a55c547c
parent9cd95e97a9b248eaeda9d232eb20da28bb912e43
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>
(cherry picked from commit 7b4dac1d522cf48e4e6bd227ff235bffa82cb755)
Signed-off-by: Winnie Hsu <whsu@nvidia.com>
Reviewed-on: http://git-master/r/394993
drivers/iommu/tegra-smmu.c