power_suspend: Refactor error checking and add some whitelist entries

This patch adds some much-needed refactoring to the main suspend method,
moving the /var/log/messages parsing code into a separate function. This
allows to get rid of some especially ugly spaghetti code that was
abusing the wakealarm timestamp variable. In addition, fix an issue
where rsyslogd occasionally gets confused by the spew of messages after
resume, and outputs power_suspend's log messages in between the kernel
dmesg output (violating the assumption that /var/log/messages is in
chronological order).

Also expand whitelisting for the serio0|atkbd bug to Butterfly, and add
a new whitelist entry for the Great Lumpy Touchpad Calamity of March 20.

BUG=chromium:341985
TEST=Ran a few iterations on Link, Stout and Daisy.

Change-Id: I6d1a7217148c48a110317aa0720efb552c9cebbc
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204586
Reviewed-by: Sameer Nanda <snanda@chromium.org>
2 files changed