2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 13:13:57 +08:00

OMAP: omap_device: use read_persistent_clock() instead of getnstimeofday()

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>
This commit is contained in:
Kevin Hilman 2009-12-08 16:34:23 -07:00 committed by paul
parent 5f1b6ef76f
commit d22926677f

View File

@ -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)) (od->dev_wakeup_lat <= od->_dev_wakeup_lat_limit))
break; break;
getnstimeofday(&a); read_persistent_clock(&a);
/* XXX check return code */ /* XXX check return code */
odpl->activate_func(od); odpl->activate_func(od);
getnstimeofday(&b); read_persistent_clock(&b);
c = timespec_sub(b, a); c = timespec_sub(b, a);
act_lat = timespec_to_ns(&c) * NSEC_PER_USEC; act_lat = timespec_to_ns(&c) * NSEC_PER_USEC;
@ -190,12 +190,12 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
od->_dev_wakeup_lat_limit)) od->_dev_wakeup_lat_limit))
break; break;
getnstimeofday(&a); read_persistent_clock(&a);
/* XXX check return code */ /* XXX check return code */
odpl->deactivate_func(od); odpl->deactivate_func(od);
getnstimeofday(&b); read_persistent_clock(&b);
c = timespec_sub(b, a); c = timespec_sub(b, a);
deact_lat = timespec_to_ns(&c) * NSEC_PER_USEC; deact_lat = timespec_to_ns(&c) * NSEC_PER_USEC;