Patchwork [1/1] iommu/tegra: smmu: Fix incorrect mask for regbase

login
register
mail settings
Submitter Hiroshi Doyu
Date Feb. 6, 2013, 5:38 p.m.
Message ID <1360172295-21500-1-git-send-email-hdoyu@nvidia.com>
Download mbox | patch
Permalink /patch/218706/
State Not Applicable, archived
Headers show

Comments

Hiroshi Doyu - Feb. 6, 2013, 5:38 p.m.
This fixes kernel crash because of BUG() in register address
validation.

Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
---
Verified with Tegra 114 based Dalmore board
---
 drivers/iommu/tegra-smmu.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Stephen Warren - Feb. 6, 2013, 6:25 p.m.
On 02/06/2013 10:38 AM, Hiroshi Doyu wrote:
> This fixes kernel crash because of BUG() in register address
> validation.
> 
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>

Tested-by: Stephen Warren <swarren@nvidia.com>

(on Tegra30 Cardhu, with this patch applied on top of next-20130206 plus
some other build and bug-fixes).
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joerg Roedel - Feb. 7, 2013, 8:57 p.m.
On Wed, Feb 06, 2013 at 07:38:15PM +0200, Hiroshi Doyu wrote:
> This fixes kernel crash because of BUG() in register address
> validation.
> 
> Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>

Applied to arm/tegra, thanks.


--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 4d11069..05a8ddb 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -1192,7 +1192,7 @@  static int tegra_smmu_probe(struct platform_device *pdev)
 		smmu->rege[i] = smmu->regs[i] + resource_size(res) - 1;
 	}
 	/* Same as "mc" 1st regiter block start address */
-	smmu->regbase = (void __iomem *)((u32)smmu->regs[0] & ~PAGE_MASK);
+	smmu->regbase = (void __iomem *)((u32)smmu->regs[0] & PAGE_MASK);
 
 	err = of_get_dma_window(dev->of_node, NULL, 0, NULL, &base, &size);
 	if (err)