Intel-BMC/openbmc

kernel: i2c: pca9555 fails to probe

Opened this issue · 3 comments

If we add pca9555 in dts, it fails to probe with below errors:

[    2.561952] pca953x 8-0024: failed writing register
[    2.567061] pca953x: probe of 8-0024 failed with error -110
[    3.601837] pca953x 8-0025: failed writing register
[    3.606933] pca953x: probe of 8-0025 failed with error -110

The example dts is:

&i2c8 {
    multi-master;
    aspeed,dma-buf-size = <4095>;
    aspeed,hw-timeout-ms = <300>;
    status = "okay";
    pca0:pca9555@24 {
        compatible = "nxp,pca9555";
        reg = <0x24>;
        #address-cells = <1>;
        #size-cells = <0>;
        gpio-controller;
        #gpio-cells = <2>;
        ...

If we revert the patch https://github.com/Intel-BMC/openbmc/blob/intel/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0075-Refine-initialization-flow-in-I2C-driver.patch, the issue is gone.

So it looks like something is wrong with the patch.

@leiyu-bytedance I did not find the I2C-8 whith "i2cdetect -l" command. Let us perform these steps to narrow down this issue:

  1. Do not revert the 0075 patch
  2. Do not Add pca9555 into the dts file
    Boot into shell, run "i2cdetect -y 8" to check if the pca9555 is persist
    cd /sys/bus/i2c/devices/i2c-8
    echo pca9555 SlaveAddr > new_device

Check if you can load the driver manually

@leiyu-bytedance I did not find the I2C-8 whith "i2cdetect -l" command. Let us perform these steps to narrow down this issue:

  1. Do not revert the 0075 patch
  2. Do not Add pca9555 into the dts file
    Boot into shell, run "i2cdetect -y 8" to check if the pca9555 is persist
    cd /sys/bus/i2c/devices/i2c-8
    echo pca9555 SlaveAddr > new_device

Check if you can load the driver manually

Yup, if I do not add the device in dts and load the driver after BMC is booted, it's OK.
The issue only occurs when the device is in dts.

Please be noted that the device has to be in dts, because it exposes the GPIOs for other devices (e.g. gpio-keys-polled)