From: Linus Walleij Date: Wed, 3 Oct 2012 12:26:12 +0000 (+0200) Subject: ARM: ux500: add DB serial number to entropy pool X-Git-Tag: firefly_0821_release~3680^2~1484^2~37^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4040d10a3d44023703f81083bb90a3eb45a39eee;p=firefly-linux-kernel-4.4.55.git ARM: ux500: add DB serial number to entropy pool This throws the DB (digital baseband, ASIC) serial number, process type etc into the entropy pool by way of the device_add_randomness() call. This should make every device have a unique pool state upon boot. Cc: Theodore Tso Signed-off-by: Linus Walleij --- diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c index bcdfe6b1d453..50202a163e5d 100644 --- a/arch/arm/mach-ux500/cpu-db8500.c +++ b/arch/arm/mach-ux500/cpu-db8500.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include @@ -24,7 +26,6 @@ #include #include #include -#include #include #include "devices-db8500.h" @@ -187,6 +188,8 @@ static const char *db8500_read_soc_id(void) { void __iomem *uid = __io_address(U8500_BB_UID_BASE); + /* Throw these device-specific numbers into the entropy pool */ + add_device_randomness(uid, 0x14); return kasprintf(GFP_KERNEL, "%08x%08x%08x%08x%08x", readl((u32 *)uid+1), readl((u32 *)uid+1), readl((u32 *)uid+2),