An i2c issue found in intel-bmc/openbmc

Jae Hyun Yoo jae.hyun.yoo at linux.intel.com
Sat Sep 12 04:35:52 AEST 2020


Hi Yulei,

On 9/8/2020 5:07 AM, 郁雷 wrote:
> This email is to introduce an issue related to i2c found on
> intel-bmc/openbmc[1].
> 
> I am working on a machine that is based on intel-bmc/openbmc, and it
> has a pca9555 GPIO expander on i2c-8.
> 
> The dts looks like below:
> 
>    &i2c8 {
>      status = "okay";
>      pca0:pca9555 at 24 {
>        compatible = "nxp,pca9555";
>        reg = <0x24>;
>        #address-cells = <1>;
>        #size-cells = <0>;
>        gpio-controller;
>        #gpio-cells = <2>;
>      }
>    }
> 
> If you have a similar setup, you may see the kernel gives below error:
> 
>      [    2.561952] pca953x 8-0024: failed writing register
>      [    2.567061] pca953x: probe of 8-0024 failed with error -110
> 
> It turns out that the patch
> 0075-Refine-initialization-flow-in-I2C-driver.patch[2] caused the
> issue. And if I revert the patch, the issue is gone.

Checked that the patch was wrong. Yong found that aspeed_i2c_init should
be called before calling i2c_add_adapter so the patch should be like this:

+             ret = aspeed_i2c_init(bus, pdev);
+             if (ret < 0)
+                            goto out_free_dma_buf;
+

                ret = i2c_add_adapter(&bus->adap);
                if (ret < 0)
                               goto out_free_dma_buf;

I'll fix the patch. Thanks Yulei and Yong for sharing your findings.

Thanks,
Jae

> A github issue is created at
> https://github.com/Intel-BMC/openbmc/issues/48, hopefully Intel could
> fix this issue :)
> 
> [1]: https://github.com/Intel-BMC/openbmc
> [2]: 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
> 


More information about the openbmc mailing list