arm: tegra: retry on vpr update config failure
Krishna Reddy [Thu, 28 Aug 2014 22:06:27 +0000 (15:06 -0700)]
sleep and retry on vpr update config on failure.

Bug 1517584

Change-Id: Ib3320037aba651de56d2f9f9efcb2cfb9bbdca0a
Signed-off-by: Krishna Reddy <vdumpa@nvidia.com>
Reviewed-on: http://git-master/r/494000
(cherry picked from commit 98bf6523b1b2ddc54529aa392a6ec5f111f17c4b)
Reviewed-on: http://git-master/r/592896
GVS: Gerrit_Virtual_Submit

arch/arm/mach-tegra/common.c

index 7e98f7c..271e822 100644 (file)
@@ -201,12 +201,22 @@ static int tegra_update_resize_cfg(phys_addr_t base , size_t size)
 {
        int err = 0;
 #ifdef CONFIG_TRUSTED_LITTLE_KERNEL
+#define MAX_RETRIES 6
+       int retries = MAX_RETRIES;
 
+retry:
        err = gk20a_do_idle();
        if (!err) {
                /* Config VPR_BOM/_SIZE in MC */
                err = te_set_vpr_params((void *)(uintptr_t)base, size);
                gk20a_do_unidle();
+       } else {
+               if (retries--) {
+                       pr_err("%s:%d: fail retry=%d",
+                               __func__, __LINE__, MAX_RETRIES - retries);
+                       msleep(1);
+                       goto retry;
+               }
        }
 #endif
        return err;