From 6af9dbc9741f98844d5c7a35dd077d4fea6a6fc0 Mon Sep 17 00:00:00 2001 From: Brandon Bergren Date: Sun, 8 Mar 2020 16:50:09 +0000 Subject: [PATCH] Ignore the SMBus alert line in i2c interrupts. Bit 12 (ASPEED_I2CD_INTR_SMBUS_ALERT) of the i2c interrupt data appears to be directly controlled by SALTnn pins, even when the pins are configured for other tasks. This happens even when bit 4 (ASPEED_I2CD_DEF_ALERT_EN) in the control register is zero. This bit appears to only control whether bit 12 being 1 causes an interrupt by itself or not. Mark bit 12 as handled to prevent error spam. This is especially evident on Blackbird, where the i2c bus 12 interrupts cause constant noise in the logs after poweron. The aspeed driver does not handle SMBus alerts anyway. Even if it did, we would still want to prevent this on Talos II / Blackbird, as the SALT pins aren't wired up to the correct busses anyway, so the value is nonsensical. There might be a better way to fix this, if there's a way to disable SMBus alert behavior without fully disabling the pin. I don't have access to the ASpeed datasheet however. Signed-off-by: Brandon Bergren --- drivers/i2c/busses/i2c-aspeed.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index 6c8b38fd6e64..fe086e5f365b 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -74,6 +74,7 @@ */ #define ASPEED_I2CD_INTR_SDA_DL_TIMEOUT BIT(14) #define ASPEED_I2CD_INTR_BUS_RECOVER_DONE BIT(13) +#define ASPEED_I2CD_INTR_SMBUS_ALERT BIT(12) #define ASPEED_I2CD_INTR_SLAVE_MATCH BIT(7) #define ASPEED_I2CD_INTR_SCL_TIMEOUT BIT(6) #define ASPEED_I2CD_INTR_ABNORMAL BIT(5) @@ -402,6 +403,14 @@ static u32 aspeed_i2c_master_irq(struct aspeed_i2c_bus *bus, u32 irq_status) u8 recv_byte; int ret; + /* + * Ignore SMBus alerts, as we don't have the code to handle them, + * and under certain pinmux configurations, they can be triggered + * erroneously. + */ + if (irq_status & ASPEED_I2CD_INTR_SMBUS_ALERT) + irq_handled |= ASPEED_I2CD_INTR_SMBUS_ALERT; + if (irq_status & ASPEED_I2CD_INTR_BUS_RECOVER_DONE) { bus->master_state = ASPEED_I2C_MASTER_INACTIVE; irq_handled |= ASPEED_I2CD_INTR_BUS_RECOVER_DONE; -- 2.17.0