rtc: wm831x: Feed the write counter into device_add_randomness()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 5 Jul 2012 20:19:17 +0000 (20:19 +0000)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:41:22 +0000 (23:41 +0200)
commit66e540e96c3ad9e73e49e0fc7292bfe5d5e2bb11
tree022f1b343306ba265ad3074deac3ebccfec4ec75
parenta76be4858901fd9fd0fb8f594f660d1037cb03d8
rtc: wm831x: Feed the write counter into device_add_randomness()

commit 9dccf55f4cb011a7552a8a2749a580662f5ed8ed upstream.

The tamper evident features of the RTC include the "write counter" which
is a pseudo-random number regenerated whenever we set the RTC. Since this
value is unpredictable it should provide some useful seeding to the random
number generator.

Only do this on boot since the goal is to seed the pool rather than add
useful entropy.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/rtc/rtc-wm831x.c