video: tegra: host: Recover if syncpt max < min
Arto Merilainen [Mon, 28 Jan 2013 11:45:41 +0000 (13:45 +0200)]
This patch makes the syncpoint max to be resetted to the current
min if maximum is smaller than the minimum.

Change-Id: I2e4f06ce9a65244aa43e7bf32a5bf20413c7bc76
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/194670
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Juha Tukkinen <jtukkinen@nvidia.com>

drivers/video/tegra/host/host1x/host1x_syncpt.c

index 5810b47..81d86da 100644 (file)
@@ -71,13 +71,15 @@ static u32 t20_syncpt_update_min(struct nvhost_syncpt *sp, u32 id)
                live = readl(sync_regs + (host1x_sync_syncpt_0_r() + id * 4));
        } while ((u32)atomic_cmpxchg(&sp->min_val[id], old, live) != old);
 
-       if (!nvhost_syncpt_check_max(sp, id, live))
+       if (!nvhost_syncpt_check_max(sp, id, live)) {
                dev_err(&syncpt_to_dev(sp)->dev->dev,
                                "%s failed: id=%u, min=%d, max=%d\n",
                                __func__,
                                id,
                                nvhost_syncpt_read_min(sp, id),
                                nvhost_syncpt_read_max(sp, id));
+               nvhost_syncpt_set_max(sp, id, live);
+       }
 
        return live;
 }