[RK3128][Android7.1] I2C总线被挂起导致无法重启

[RK3128][Android7.1] I2C总线被挂起导致无法重启

Platform: Rockchip
OS: Android 7.1.2
Kernel: 3.10

解决方案:直接去掉I2C通信同步锁

kernel\drivers\i2c\busses\i2c-rockchip.c

static int rockchip_i2c_xfer(struct i2c_adapter *adap,
			struct i2c_msg *msgs, int num)
{
	int ret;
	struct rockchip_i2c *i2c = i2c_get_adapdata(adap);
	unsigned long scl_rate = i2c->scl_rate;
	int can_sleep = !(in_atomic() || irqs_disabled());

	/*if (can_sleep) {
		mutex_lock(&i2c->suspend_lock);
		if (i2c->suspended) {
			dev_err(i2c->dev, "i2c is suspended\n");
			mutex_unlock(&i2c->suspend_lock);
			return -EIO;
		}
	}*/

你可能感兴趣的:(Rockchip)