diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2024-05-14 11:23:02 +0200 |
---|---|---|
committer | Jean Delvare <jdelvare@suse.de> | 2024-05-14 11:23:02 +0200 |
commit | 4d1b28a8119c615f1e932520f9ee1f80bdda5204 (patch) | |
tree | 03f25601cb7af51cb68658f9383445ac65b403ae /drivers/firmware/dmi_scan.c | |
parent | 0ef11f604503b1862a21597436283f158114d77e (diff) | |
download | linux-4d1b28a8119c615f1e932520f9ee1f80bdda5204.tar.gz linux-4d1b28a8119c615f1e932520f9ee1f80bdda5204.tar.bz2 linux-4d1b28a8119c615f1e932520f9ee1f80bdda5204.zip |
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.
[JD: Static variable dmi_memdev_populated_nr is only used in __init
functions, so it can be marked __initdata.]
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Diffstat (limited to 'drivers/firmware/dmi_scan.c')
-rw-r--r-- | drivers/firmware/dmi_scan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index ac2a5d2d4746..68231c638c55 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -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 __initdata; static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s) { @@ -459,6 +460,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++; } @@ -835,6 +839,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); } |