Skip to content

Commit

Permalink
OMAP: omap_device: use read_persistent_clock() instead of getnstimeof…
Browse files Browse the repository at this point in the history
…day()

During suspend and resume, when omap_device deactivation and
activation is happening, the timekeeping subsystem has likely already
been suspended.  Thus getnstimeofday() will fail and trigger a WARN().

Use read_persistent_clock() instead of getnstimeofday() to avoid this.

Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
  • Loading branch information
Kevin Hilman authored and paul committed Dec 12, 2009
1 parent 5f1b6ef commit d229266
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/arm/plat-omap/omap_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
(od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
break;

getnstimeofday(&a);
read_persistent_clock(&a);

/* XXX check return code */
odpl->activate_func(od);

getnstimeofday(&b);
read_persistent_clock(&b);

c = timespec_sub(b, a);
act_lat = timespec_to_ns(&c) * NSEC_PER_USEC;
Expand Down Expand Up @@ -190,12 +190,12 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
od->_dev_wakeup_lat_limit))
break;

getnstimeofday(&a);
read_persistent_clock(&a);

/* XXX check return code */
odpl->deactivate_func(od);

getnstimeofday(&b);
read_persistent_clock(&b);

c = timespec_sub(b, a);
deact_lat = timespec_to_ns(&c) * NSEC_PER_USEC;
Expand Down

0 comments on commit d229266

Please sign in to comment.