Subject: [PATCH] arm: sched: stop sched_clock() during suspend

From: [email-masked] (Kevin Hilman)
Date: Mon, 22 Oct 2012 10:05:25 -0700

+Colin Cross, Barry Song also

Felipe Balbi <[email-masked]> writes:

> The scheduler imposes a requirement to sched_clock()
> which is to stop the clock during suspend, if we don't
> do that IRQ threads will be rescheduled in the future
> which might cause transfers to timeout depending on
> how driver is written.

It's not just about IRQ threads, it's about RT throttling.  IOW, not
just IRQ threads will be postponed, but all RT tasks will be throttled
temporarily as well.

The changelog should also mention that this has an inconvenient side
effect of stopping the printk times during suspend.  Based on the
original thread where this feature was discussed and introduced, some
platforms wanted to opt out of this behavior[1], so the optional API was
added.

However, in light of RT throttling, this a correctness issue for process
accounting, so I agree that this should be done for all platforms
instead of providing an optional 'needs suspend' version of the API,
even though it means printk times no longer reflect time spent
suspended.

After a discussion with peterz on this topic, it seems that x86
already ensures that sched_clock stops during suspend for similar
reasons[2].

The question then is whether this is a fix that belongs in v3.7.
Technically, it is not a regression, so I think this should probably be
v3.8 material.  If that's the decision, then the threaded IRQ support
for the OMAP I2C driver needs to be reverted for v3.7 until this fix is merged.

Kevin

[1] http://marc.info/?l=linux-arm-kernel&m=134307004508708&w=2
[2] http://marc.info/?l=linux-arm-kernel&m=135065529907297&w=2