firmware: bcm47xx_nvram: don't warn when NVRAM is already copied
Subsystems (2)
PATCH 1/1 firmware: bcm47xx_nvram: don't warn when NVRAM is already copied
On MIPS BCM47xx the arch code copies NVRAM very early, because the board detection and several drivers need it before platform drivers probe. With a device tree, the brcm_nvram nvmem driver then passes the same NVRAM to bcm47xx_nvram_init_from_iomem(), which warns on every boot:
nvram already initialized
The same can happen on ARM when the MTD fallback reads NVRAM before brcm_nvram probes. In both cases the existing copy is the right one, so log this at debug level. bcm47xx_nvram_find_and_copy(), used by the early init, keeps its warning.
Assisted-by LLM
Signed-off-by Rosen Penev <[email protected]>
--- drivers/firmware/broadcom/bcm47xx_nvram.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/firmware/broadcom/bcm47xx_nvram.c +5 -1
@@ -112,8 +112,12 @@ static int bcm47xx_nvram_find_and_copy(void __iomem *flash_start, size_t res_sizint bcm47xx_nvram_init_from_iomem (void __iomem *nvram_start,size_t res_size) { +/* +* The arch code on MIPS (and the MTD fallback) may have copied the +* NVRAM before the nvmem driver probes. That copy is used. +*/ if (nvram_len) { -pr_warn ("nvram already initialized\n" ); +pr_debug ("nvram already initialized\n" );return -EEXIST ; }
Signature · 1 line
2.56.0