CHROMIUM: ramoops: Copy the entire buffer to deal with bit rot
authorSameer Nanda <snanda@chromium.org>
Tue, 4 Sep 2012 20:50:13 +0000 (13:50 -0700)
committerGerrit <chrome-bot@google.com>
Wed, 5 Sep 2012 17:58:33 +0000 (10:58 -0700)
commit37f5c96356f6a0bd34b6844249a849d8d6ea1d12
tree5da5cb4c6842b2f72ffbd6ba65d3f5e79a07d52f
parented1cea48fce1774185dfc37e773da3c7bd338243
CHROMIUM: ramoops: Copy the entire buffer to deal with bit rot

If unclean shutdown is done by yanking power rails, the RAM may be in a
state where it is not getting refreshed for a short period of time. This
can cause bit rotting in RAM and throw off the wraparound and buffer
size calculation logic. To get around this, copy the entire console
buffer. Note that this, of course, won't do anything to fix the bit
rotting but the intent here is that some logs are better than none.

BUG=chrome-os-partner:13249
TEST=on a snow or link system do a warm reboot by pressing
alt-volume_up-r keys together. The system should reboot. Upon bootup,
check contents of "/dev/pstore/console-ramoops" and ensure they are from
dmesg of the previous boot.

Change-Id: I68b2b10a6b3fc29329979cc0c659b440436b771f
Signed-off-by: Sameer Nanda <snanda@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32180
Reviewed-by: Doug Anderson <dianders@chromium.org>
drivers/char/ramoops.c