raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i2c failing to initialize and detect devices

EdgarSouSousa opened this issue · comments

Describe the bug

The i2c bus fails to detect and communicate with connected i2c devices. Dmesg output:
[ 1.878285] i2c_dev: i2c /dev entries driver
[ 2.368416] brcmstb-i2c 107d508200.i2c: @97500hz registered in interrupt mode
[ 2.380348] brcmstb-i2c 107d508280.i2c: @97500hz registered in interrupt mode
[ 63.352260] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352340] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352408] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352476] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352564] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352627] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352703] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration

Steps to reproduce the behaviour

Enable the i2c interface using raspi-config
Connect any i2c device
run sudo i2cdetect -y 1
sudo dmesg | grep i2c

Device (s)

Raspberry Pi 5

System

Raspberry Pi reference 2024-03-15

2024/02/16 15:28:41
Copyright (c) 2012 Broadcom
version 4c845bd3 (release) (embedded)

Linux raspberrypi-722 6.6.21-v8-16k+ #1 SMP PREEMPT Mon Mar 18 17:00:44 UTC 2024 aarch64 GNU/Linux

Logs

No response

Additional context

I have already flashed a new image , installed most recent firmware and tried with multiple i2c devices

Likely duplicate of #6056.

  1. Which devices are attached?
  2. Have you set the I2C clock rate?
  3. When it fails, what does pinctrl 2-3 show?
  1. Currently attached a VEML7700 sensor
  2. I have not , I simply enabled the i2c using raspi-config
  3. 2: a3 pu | hi // GPIO2 = SDA1 3: a3 pu | hi // GPIO3 = SCL1

Thank you for your speedy response

Is that a self-built kernel? If so, what was the head-of-tree? If not, where did it come from?

It is not a self built kernel, I updated the kernel when facing the issues using 'sudo apt full-upgrade'.

Thank you.

Linux raspberrypi-722 6.6.21-v8-16k+ https://github.com/raspberrypi/linux/issues/1 SMP PREEMPT Mon Mar 18 17:00:44 UTC 2024 aarch64 GNU/Linux

It is not a self built kernel, I updated the kernel when facing the issues using 'sudo apt full-upgrade'.

from RPiOS bookworm?

That doesn't seem right. The latest apt version is 6.6.20 (2024-03-07)

Thanks - I was just coming to the same conclusion

I apologize for my mistake, I forgot i tried to upgrade the kernel previously to posting this issue, as seen in #6056 (comment).

The issue was first encountered in the latest apt version and persisted to the version present in pull 6050.

A VEML7700 arrived in the post today and it is showing this behaviour. I can make it fail on vanilla 6.1 kernels, so I don't think it is a new issue. There seem to be situations where it is behaving in a non-compliant fashion, but the failure should not kill the I2C bus in the way it does.

PR #6071 is a fix/workaround for the bus lockup. It's still not clear to me what your system is doing to provoke the problem - is it really just i2cdetect -y 1?

Originally the issue was found after attempting to read from the i2c slave, and after failure I ran i2c detect. After reboot the issues persists, when just running i2cdetect -y 1. At a later date I will attempt with the new workaround and with a fresh RaspberryPi5.

Thank you.