Skip to content

Commit

Permalink
Added hinote when hardinfo is not able to read full DDR4 SPD data.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocerman authored and lpereira committed May 13, 2019
1 parent 89e6dbc commit ae93b3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ void scan_dtree(gboolean reload);
void scan_device_resources(gboolean reload);

gboolean root_required_for_resources(void);
gboolean spd_decode_show_hinote(const char**);

gchar *hi_more_info(gchar *entry);

Expand Down Expand Up @@ -833,5 +834,11 @@ const gchar *hi_note_func(gint entry)
return g_strdup(_("Resource information requires superuser privileges"));
}
}
else if (entry == ENTRY_SPD){
const char *msg;
if (spd_decode_show_hinote(&msg)) {
return msg;
}
}
return NULL;
}
12 changes: 12 additions & 0 deletions modules/devices/spd-decode.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,8 @@ static const char **vendors[VENDORS_BANKS] = { vendors1, vendors2, vendors3, ven
vendors7
};

gboolean ddr4_partial_data = FALSE;

/*
* We consider that no data was written to this area of the SPD EEPROM if
* all bytes read 0x00 or all bytes read 0xff
Expand Down Expand Up @@ -1654,6 +1656,7 @@ static gchar *decode_dimms(GSList * dimm_list, gboolean use_sysfs, int max_size)
detailed_info = decode_ddr4_sdram(bytes, &module_size);
decode_ddr4_part_number(bytes, spd_size, part_number);
decode_ddr4_module_manufacturer(bytes, spd_size, &manufacturer);
ddr4_partial_data = ddr4_partial_data || (spd_size < 512);
break;
case DDR_SDRAM:
detailed_info = decode_ddr_sdram(bytes, &module_size);
Expand Down Expand Up @@ -1746,3 +1749,12 @@ void scan_spd_do(void)
_("Bank"), _("Size"), _("Manufacturer"), _("Model") );
g_free(list);
}

gboolean spd_decode_show_hinote(const char **msg){
if (ddr4_partial_data){
*msg = g_strdup(_("A current driver has provided only partial DDR4 SPD data. Please load and\nconfigure ee1004 driver to obtain additional information about DDR4 SPD."));
return TRUE;
}

return FALSE;
}

0 comments on commit ae93b3b

Please sign in to comment.