diff options
author | Jarkko Nikula <jarkko.nikula@linux.intel.com> | 2022-11-07 15:42:43 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-11-12 07:37:49 +0100 |
commit | cdbd2f169bf1aff9f679a3e07d62244fc4341968 (patch) | |
tree | d33d5d998f3cb42eb2f4dfe4cf4758c0d53cf4ec | |
parent | 4c7107c2974270ff369342f6f1bd5d3669c182f1 (diff) | |
download | linux-stable-cdbd2f169bf1aff9f679a3e07d62244fc4341968.tar.gz linux-stable-cdbd2f169bf1aff9f679a3e07d62244fc4341968.tar.bz2 linux-stable-cdbd2f169bf1aff9f679a3e07d62244fc4341968.zip |
i2c: designware: Do not process interrupt when device is suspended
Do not return with interrupt handled if host controller is off and thus
interrupt is originating from other device or is spurious.
Add a check to detect when controller is runtime suspended or
transitioning/reset. In latter case all raw interrupt status register
bits may read one. In both cases return IRQ_NONE to indicate interrupt
was not from this device.
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
-rw-r--r-- | drivers/i2c/busses/i2c-designware-master.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index 1b7db2b58f31..d6fcf955dfc0 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -778,6 +778,8 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) dev_dbg(dev->dev, "enabled=%#x stat=%#x\n", enabled, stat); if (!enabled || !(stat & ~DW_IC_INTR_ACTIVITY)) return IRQ_NONE; + if (pm_runtime_suspended(dev->dev) || stat == GENMASK(31, 0)) + return IRQ_NONE; i2c_dw_irq_handler_master(dev); |