mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
fdt: Update CRC check for rng-seed
Commit428826f535("fdt: add support for rng-seed") moves of_fdt_crc32 from early_init_dt_verify() to early_init_dt_scan() since early_init_dt_scan_chosen() may modify fdt to erase rng-seed. However, arm and some other arch won't call early_init_dt_scan(), they call early_init_dt_verify() then early_init_dt_scan_nodes(). Restore of_fdt_crc32 to early_init_dt_verify() then update it in early_init_dt_scan_chosen() if fdt if updated. Fixes:428826f535("fdt: add support for rng-seed") Reported-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Hsin-Yi Wang <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Will Deacon <[email protected]>
This commit is contained in:
parent
7f591fa7a6
commit
dd753d961c
1 changed files with 6 additions and 2 deletions
|
|
@ -1086,6 +1086,10 @@ int __init early_init_dt_scan_chosen(unsigned long node, const char *uname,
|
|||
|
||||
/* try to clear seed so it won't be found. */
|
||||
fdt_nop_property(initial_boot_params, node, "rng-seed");
|
||||
|
||||
/* update CRC check value */
|
||||
of_fdt_crc32 = crc32_be(~0, initial_boot_params,
|
||||
fdt_totalsize(initial_boot_params));
|
||||
}
|
||||
|
||||
/* break now */
|
||||
|
|
@ -1176,6 +1180,8 @@ bool __init early_init_dt_verify(void *params)
|
|||
|
||||
/* Setup flat device-tree pointer */
|
||||
initial_boot_params = params;
|
||||
of_fdt_crc32 = crc32_be(~0, initial_boot_params,
|
||||
fdt_totalsize(initial_boot_params));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1205,8 +1211,6 @@ bool __init early_init_dt_scan(void *params)
|
|||
return false;
|
||||
|
||||
early_init_dt_scan_nodes();
|
||||
of_fdt_crc32 = crc32_be(~0, initial_boot_params,
|
||||
fdt_totalsize(initial_boot_params));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue