Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2292667 authored by Kevin Hilman's avatar Kevin Hilman Committed by paul
Browse files

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: default avatarKevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 5f1b6ef7
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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;