When checking measured [de]activate latencies against expected
latencies, only print warning if driver has provided a non-zero
latency.

This allows drivers to set their [de]activate latencies to zero when
they are not known, or are don't care, and the omap_device core will
not complain about unexpected latencies.

RFC: Maybe the measuring of latency should also avoided all together
     in this case?

Signed-off-by: Kevin Hilman <khil...@deeprootsystems.com>
---
 arch/arm/plat-omap/omap_device.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index f6cdf1a..83bee1c 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -148,10 +148,12 @@ static int _omap_device_activate(struct omap_device *od, 
u8 ignore_lat)
                         "%llu usec\n", od->pdev.name, od->pm_lat_level,
                         act_lat);
 
-               WARN(act_lat > odpl->activate_lat, "omap_device: %s.%d: "
-                    "activate step %d took longer than expected (%llu > %d)\n",
-                    od->pdev.name, od->pdev.id, od->pm_lat_level,
-                    act_lat, odpl->activate_lat);
+               if (odpl->activate_lat)
+                       WARN(act_lat > odpl->activate_lat,
+                            "omap_device: %s.%d: activate step %d "
+                            "took longer than expected (%llu > %d)\n",
+                            od->pdev.name, od->pdev.id, od->pm_lat_level,
+                            act_lat, odpl->activate_lat);
 
                od->dev_wakeup_lat -= odpl->activate_lat;
        }
@@ -204,10 +206,12 @@ static int _omap_device_deactivate(struct omap_device 
*od, u8 ignore_lat)
                         "%llu usec\n", od->pdev.name, od->pm_lat_level,
                         deact_lat);
 
-               WARN(deact_lat > odpl->deactivate_lat, "omap_device: %s.%d: "
-                    "deactivate step %d took longer than expected "
-                    "(%llu > %d)\n", od->pdev.name, od->pdev.id,
-                    od->pm_lat_level, deact_lat, odpl->deactivate_lat);
+               if (odpl->deactivate_lat)
+                       WARN(deact_lat > odpl->deactivate_lat,
+                            "omap_device: %s.%d: "
+                            "deactivate step %d took longer than expected "
+                            "(%llu > %d)\n", od->pdev.name, od->pdev.id,
+                            od->pm_lat_level, deact_lat, odpl->deactivate_lat);
 
                od->dev_wakeup_lat += odpl->deactivate_lat;
 
-- 
1.6.5.1

--
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