diff mbox series

dmicheck: Don't check firmware version on anything but NVDIMM devices

Message ID 20240202201215.373-1-mario.limonciello@amd.com
State Accepted
Headers show
Series dmicheck: Don't check firmware version on anything but NVDIMM devices | expand

Commit Message

Mario Limonciello Feb. 2, 2024, 8:12 p.m. UTC
The firmware version offset is only valid for NVDIMM.

Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.pdf
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
 src/dmi/dmicheck/dmicheck.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

Comments

ivanhu Feb. 19, 2024, 2:16 a.m. UTC | #1
Thanks!


Acked-by: Ivan Hu <ivan.hu@canonical.com>

On 2/3/24 04:12, Mario Limonciello wrote:
> The firmware version offset is only valid for NVDIMM.
> 
> Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.0.pdf
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
>   src/dmi/dmicheck/dmicheck.c | 10 +++++++++-
>   1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index b7cca5e4..49d33ce3 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -1678,7 +1678,15 @@ static void dmicheck_entry(fwts_framework *fw,
>   			dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7);
>   			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 0, 0);
>   			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15);
> -			dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
> +			switch(hdr->data[0x28]) {
> +			case 0x04:
> +			case 0x05:
> +			case 0x06:
> +				dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
> +				break;
> +			default:
> +				break;
> +			}
>   			if (hdr->length < 0x54)
>   				break;
>   			dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31);
diff mbox series

Patch

diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index b7cca5e4..49d33ce3 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -1678,7 +1678,15 @@  static void dmicheck_entry(fwts_framework *fw,
 			dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7);
 			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 0, 0);
 			dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15);
-			dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
+			switch(hdr->data[0x28]) {
+			case 0x04:
+			case 0x05:
+			case 0x06:
+				dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b);
+				break;
+			default:
+				break;
+			}
 			if (hdr->length < 0x54)
 				break;
 			dmi_reserved_bits_check(fw, table, addr, "Extended Speed", hdr, sizeof(uint32_t), 0x54, 31, 31);