Skip to content

Commit 757b422

Browse files
committed
Avoid responding to unexpected I2C interrupts
1 parent e244fae commit 757b422

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/i2c/busses/i2c-bcm2708.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ static irqreturn_t bcm2708_i2c_interrupt(int irq, void *dev_id)
175175

176176
spin_lock(&bi->lock);
177177

178+
/* we may see camera interrupts on the "other" I2C channel
179+
Just return if we've not sent anything */
180+
if (!bi->nmsgs || !bi->msg )
181+
goto early_exit;
182+
178183
s = bcm2708_rd(bi, BSC_S);
179184

180185
if (s & (BSC_S_CLKT | BSC_S_ERR)) {
@@ -208,6 +213,7 @@ static irqreturn_t bcm2708_i2c_interrupt(int irq, void *dev_id)
208213
handled = false;
209214
}
210215

216+
early_exit:
211217
spin_unlock(&bi->lock);
212218

213219
return handled ? IRQ_HANDLED : IRQ_NONE;

0 commit comments

Comments
 (0)