Skip to contentSkip to conversation

firmware: dmi: Add info message for number of populated and total memory slots

PATCH Applied Heiner Kallweit 2 participants 2 messages Mar 5, 2024 – May 7, 2024 Dmi/smbios support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: dmi: Add info message for number of populated and total memory slots

As part of adding support for calling i2c_register_spd() on muxed SMBUS segments the same message has been removed from i2c_register_spd(). However users may find it useful, therefore reintroduce it as part of the DMI scan code.

---
 drivers/firmware/dmi_scan.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/firmware/dmi_scan.c +6 -0
index 015c95a82..2c682b580 100644
@@ -42,6 +42,7 @@ static struct dmi_memdev_info {
 	u8 type;		/* DDR2, DDR3, DDR4 etc */
 } *dmi_memdev;
 static int dmi_memdev_nr;
+static int dmi_memdev_populated_nr;
 
 static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
 {
@@ -448,6 +449,9 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)
 	else
 		bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20;
 
+	if (bytes)
+		dmi_memdev_populated_nr++;
+
 	dmi_memdev[nr].size = bytes;
 	nr++;
 }
@@ -824,6 +828,8 @@ void __init dmi_setup(void)
 		return;
 
 	dmi_memdev_walk();
+	pr_info("DMI: Memory slots populated: %d/%d\n",
+		dmi_memdev_populated_nr, dmi_memdev_nr);
 	dump_stack_set_arch_desc("%s", dmi_ids_string);
 }
 
Signature · 1 line
2.44.0
maintainer Applied
#1 lore raw

Hi Heiner,

Quoted 34 lines · Heiner Kallweit

As part of adding support for calling i2c_register_spd() on muxed SMBUS segments the same message has been removed from i2c_register_spd(). However users may find it useful, therefore reintroduce it as part of the DMI scan code.

---
 drivers/firmware/dmi_scan.c | 6 ++++++

 1 file changed, 6 insertions(+)
drivers/firmware/dmi_scan.c +0 -0
index 015c95a82..2c682b580 100644
@@ -42,6 +42,7 @@ static struct dmi_memdev_info {

        u8 type;                /* DDR2, DDR3, DDR4 etc */
 } *dmi_memdev;
 static int dmi_memdev_nr;
+static int dmi_memdev_populated_nr;

 static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) {

drivers/firmware/dmi_scan.c +0 -0
@@ -448,6 +449,9 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v)

        else
                bytes = (u64)get_unaligned((u32 *)&d[0x1C]) << 20;
+       if (bytes)
+               dmi_memdev_populated_nr++;
+
        dmi_memdev[nr].size = bytes;
        nr++;
 }

drivers/firmware/dmi_scan.c +0 -0
@@ -824,6 +828,8 @@ void __init dmi_setup(void)
                 return;
Quoted 7 lines


        dmi_memdev_walk();
+       pr_info("DMI: Memory slots populated: %d/%d\n", +               dmi_memdev_populated_nr, dmi_memdev_nr); dump_stack_set_arch_desc("%s", dmi_ids_string); }

Applied, thanks.

Signature · 2 lines
Jean Delvare
SUSE L3 Support