mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] firmware: bcm47xx_nvram: don't warn when NVRAM is already copied
@ 2026-10-10  1:12 Rosen Penev
  0 siblings, 0 replies; only message in thread
From: Rosen Penev @ 2026-10-10  1:12 UTC (permalink / raw)
  To: linux-mips; +Cc: Rafał Miłecki, open list

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 <rosenp@gmail.com>
---
 drivers/firmware/broadcom/bcm47xx_nvram.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/broadcom/bcm47xx_nvram.c b/drivers/firmware/broadcom/bcm47xx_nvram.c
index 0ea5206be4c9..3609e1356065 100644
--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
+++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
@@ -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;
 	}
 
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-10  1:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10  1:12 [PATCH] firmware: bcm47xx_nvram: don't warn when NVRAM is already copied Rosen Penev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®