Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isDevice16bit function works incorrectly for the 24LC128 EEPROM #15

Closed
Kostr opened this issue Sep 8, 2021 · 3 comments
Closed

isDevice16bit function works incorrectly for the 24LC128 EEPROM #15

Kostr opened this issue Sep 8, 2021 · 3 comments

Comments

@Kostr
Copy link
Contributor

Kostr commented Sep 8, 2021

AMD EthanolX CRB has 24LC128 EEPROM for its FRU data. This EEPROM is a 16-bit device. And it is not getting probed correctly if the EEPROM driver is not predeclared in the devicetree file or the driver is not initialized manually:

root@ethanolx:~# busctl tree xyz.openbmc_project.FruDevice
└─/xyz
  └─/xyz/openbmc_project
    └─/xyz/openbmc_project/FruDevice
      └─/xyz/openbmc_project/FruDevice/3_80
root@ethanolx:~# busctl introspect xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice/3_80
NAME                                         TYPE      SIGNATURE RESULT/VALUE FLAGS
...
xyz.openbmc_project.Inventory.Item.I2CDevice interface -         -            -
.Address                                     property  u         80           emits-change
.Bus                                         property  u         3            emits-change
root@ethanolx:~# echo 24c128 0x50 > /sys/class/i2c-dev/i2c-3/device/new_device
root@ethanolx:~# busctl call xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice xyz.openbmc_project.FruDeviceManager ReScanBus y 3
root@ethanolx:~# busctl tree xyz.openbmc_project.FruDevice
└─/xyz
  └─/xyz/openbmc_project
    └─/xyz/openbmc_project/FruDevice
      └─/xyz/openbmc_project/FruDevice/MY_PRODUCT
root@ethanolx:~# busctl introspect xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice/SP3
NAME                                TYPE      SIGNATURE RESULT/VALUE            FLAGS
...
xyz.openbmc_project.FruDevice       interface -         -                       -
.ADDRESS                            property  u         80                      emits-change
.BOARD_LANGUAGE_CODE                property  s         "25"                    emits-change
.BOARD_MANUFACTURER                 property  s         "MY_MANUFACTURER"       emits-change
.BOARD_MANUFACTURE_DATE             property  s         "2021-09-08 - 08:51:00" emits-change
.BOARD_PART_NUMBER                  property  s         "MY_PART_NUMBER"        emits-change
.BOARD_PRODUCT_NAME                 property  s         "MY_PRODUCT"            emits-change
.BOARD_SERIAL_NUMBER                property  s         "MY_SERIAL"             emits-change
.BUS                                property  u         3                       emits-change
.Common_Format_Version              property  s         "1"                     emits-change

The error comes from a fact that without a binded driver isDevice16Bit function (

static int isDevice16Bit(int file)
) returns 0 for this EEPROM and fru-device tries to parse it as a 8-bit EEPROM.
The isDevice16Bit function was initially added in the commit 2d681f6 But apparently it does not work well for all 16-bit EEPROMs.

@iwoloschin
Copy link

Isn't this basically the same issue as #1?

@iwoloschin
Copy link

I think this is fixed by f805baf.

@edtanous
Copy link
Contributor

I've had multiple reports that the aforementioned commit has fixed this issue. I'm closing; If there are reports of systems for which this fix doesn't work, please comment here and I'll reopen, or file it as a new bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants