diff options
author | tkasivajhula <tkasivajhula@nvidia.com> | 2010-05-04 21:44:39 -0700 |
---|---|---|
committer | Gary King <gking@nvidia.com> | 2010-05-07 08:57:20 -0700 |
commit | 9c8f647c00ebfe7c87e8dc940f64c82f952bf5a3 (patch) | |
tree | 430a224fec38c7521dcd7aeb498b7d8a436a9682 | |
parent | e05af1739a03127735a6c6708fa72991b8b18324 (diff) |
tegra power: Fix gart suspend/resume operations
Apply proper barriers to suspend/resume operations.
The dmb() in suspend is required to prevent a race
between the next ENTRY_ADDR write and the previous
ENTRY_DATA read. The dsb+outer_sync() in resume()
is needed to ensure that the writes and reads occur
as expected.
Change-Id: I2e66ecce6ceb4f4647bde82cb706b739affeb858
Reviewed-on: http://git-master/r/1291
Reviewed-by: Gary King <gking@nvidia.com>
Reviewed-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
Tested-by: Mayuresh Kulkarni <mkulkarni@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/iovmm-gart.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/iovmm-gart.c b/arch/arm/mach-tegra/iovmm-gart.c index e11b7d8b821b..c1d3a1a88a6f 100644 --- a/arch/arm/mach-tegra/iovmm-gart.c +++ b/arch/arm/mach-tegra/iovmm-gart.c @@ -108,6 +108,7 @@ static int gart_suspend(struct platform_device *pdev, pm_message_t state) GART_ENTRY_ADDR_TABLE_ADDR, gpfn_to_gart(gart,i)); writel(reg, gart->regs + MC_GART_ENTRY_ADDR_0); gart->savedata[i] = readl(gart->regs + MC_GART_ENTRY_DATA_0); + dmb(); } spin_unlock(&gart->pte_lock); return 0; @@ -131,7 +132,10 @@ static int gart_resume(struct platform_device *pdev) GART_ENTRY_ADDR_TABLE_ADDR, gpfn_to_gart(gart, i)); writel(reg, gart->regs + MC_GART_ENTRY_ADDR_0); writel(gart->savedata[i], gart->regs + MC_GART_ENTRY_DATA_0); + dsb(); + outer_sync(); } + reg = NV_DRF_DEF(MC, GART_CONFIG, GART_ENABLE, ENABLE); writel(reg, gart->regs + MC_GART_CONFIG_0); spin_unlock(&gart->pte_lock); |