Skip to contentSkip to conversation

firmware: bcm47xx_nvram: don't warn when NVRAM is already copied

PATCH New Rosen Penev 1 participant 1 message Oct 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
---
 drivers/firmware/broadcom/bcm47xx_nvram.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/firmware/broadcom/bcm47xx_nvram.c +5 -1
index 0ea5206be4c9..3609e1356065 100644
@@ -112,8 +112,12 @@ static int bcm47xx_nvram_find_and_copy(void __iomem *flash_start, size_t res_siz
 
 int 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