<b>Chrome OS Version: <From about:version: Platform x.x.x.x></b>
Chrome OS Platform: Teemo
Steps To Reproduce:
(1) Get a device without EEPROM or reset the device's EEPROM
(2) Enter the command `mosys platform version`
Expected Result:
"Unknown"
Actual Result:
"rev6553"
How frequently does this problem reproduce? Always
I looked platform/mosys/drivers/google/cros_ec.c and found some issues:
1. BOARD_VERSION_LEN now is 8, but I think it's too short. In above case, "rev6553" is actually truncated from "rev65536".
2. EC returns -1 in 2 bytes (i.e. 11111111_2) when it fails to get the mainboard revision. However, the variable to record the board version is in type of uint16_t (defined at https://chromium.googlesource.com/chromiumos/platform/mosys/+/master/include/drivers/google/cros_ec_commands.h#588), so the caller cannot detect errors by checking whether this value is less than zero or not.
Comment 1 by yhong@chromium.org
, May 4 2018