Timers in PER domain periodically report old time from TCRR in
posted mode if ick < 4*fck. Therefore, set timer to non-posted
whenever ick < 4*fck for all timers.

Signed-off-by: Tarun Kanti DebBarma <tarun.ka...@ti.com>
---
 arch/arm/plat-omap/dmtimer.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
index 15e7882..a81b85e 100644
--- a/arch/arm/plat-omap/dmtimer.c
+++ b/arch/arm/plat-omap/dmtimer.c
@@ -378,6 +378,7 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, 
int source)
 {
        int ret;
        struct dmtimer_platform_data *pdata;
+       struct clk *iclk;
 
        if (unlikely(!timer))
                return -EINVAL;
@@ -388,6 +389,17 @@ int omap_dm_timer_set_source(struct omap_dm_timer *timer, 
int source)
                return -EINVAL;
 
        ret = pdata->set_timer_src(timer->pdev, source);
+       /*
+        * Timers in PER domain periodically report old time
+        * from TCRR in posted mode if ick < 4*fck. Hence,
+        * when this condition is satisfied setting the timer
+        * to non-posted mode, instead.
+        */
+       if (!IS_ERR(&ret)) {
+               iclk = clk_get(&timer->pdev->dev, "ick");
+               if (clk_get_rate(iclk) < (4 * clk_get_rate(timer->fclk)))
+                       timer->posted = 0;
+       }
 
        return ret;
 }
-- 
1.7.0.4

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

Reply via email to