diff options
| author | Evan Wilson <evan@oliodevices.com> | 2016-11-29 20:09:05 -0800 |
|---|---|---|
| committer | Evan Wilson <evan@oliodevices.com> | 2016-11-29 20:09:05 -0800 |
| commit | 2ae2f3393361a18327d3f2a031eb7e80bdf3eb8e (patch) | |
| tree | 9e287d253e0bea6d51c97c0652ae55ed6b3f9e83 | |
| parent | 331191c033074de043977bf66a51b49a06989774 (diff) | |
| download | olio-linux-3.10-2ae2f3393361a18327d3f2a031eb7e80bdf3eb8e.tar.xz olio-linux-3.10-2ae2f3393361a18327d3f2a031eb7e80bdf3eb8e.zip | |
WA-1362: Potential fix for unresponsive watchesHEADolio-h1-production
This essentially reverts e3a36b207f76364c281aeecaf14c1b22a7247278
The problem was originally fixed in f08ac4e79424c266aed8282939649104b37f53b4
Essentially there is a race condition when the system is suspending and accessing the i2c bus
Many drivers use the i2c bus in their suspend routine (PMICs, RTCs, etc.)
The original fixed no longer worked with the introduction of pm_runtime
and with the addition of this commit 2f3dcb081e91c074580fcd3da1ca1495634a8378
This commit ensures that we don't handle the interrupt if the device is supposed to already be suspended
Change-Id: Icfe32eb28973eeac35f0623fcabba6db3c79cc45
| -rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 00fb5ac811c..aaeb93e44e0 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -960,6 +960,11 @@ omap_i2c_isr_handler(struct omap_i2c_dev *dev) u16 stat; int err = 0, count = 0; + if (pm_runtime_suspended(dev->dev)) { + WARN_ONCE(true, "We should never be here!\n"); + return IRQ_NONE; + } + do { bits = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG); stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); @@ -1109,6 +1114,11 @@ omap_i2c_isr(int irq, void *dev_id) u16 mask; u16 stat; + if (pm_runtime_suspended(dev->dev)) { + WARN_ONCE(true, "We should never be here!\n"); + return IRQ_NONE; + } + spin_lock(&dev->lock); mask = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG); stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG); |