Tegra: smmu: change exit criteria for context size calculation

Tegra SoCs currently do not have a SMMU register at address 0xFFFFFFFF.
This patch changes the search criteria, to look for this marker, to
calculate the size of the saved context.

Change-Id: I15d91945ecb78267f91c45f37985dbb2327ca3ae
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
This commit is contained in:
Varun Wadekar 2017-11-08 14:03:16 -08:00
parent c63ec2639a
commit 2ad1bddca9
1 changed files with 2 additions and 1 deletions

View File

@ -101,12 +101,13 @@ void tegra_smmu_save_context(uint64_t smmu_ctx_addr)
* the last entry. Sanity check the table size before we start with * the last entry. Sanity check the table size before we start with
* the context save operation. * the context save operation.
*/ */
while (smmu_ctx_regs[num_entries].val != 0xFFFFFFFFU) { while ((smmu_ctx_regs[num_entries].reg != 0xFFFFFFFFU)) {
num_entries++; num_entries++;
} }
/* panic if the sizes do not match */ /* panic if the sizes do not match */
if (num_entries != smmu_ctx_regs[0].val) { if (num_entries != smmu_ctx_regs[0].val) {
ERROR("SMMU context size mismatch!");
panic(); panic();
} }