Skip to content

Commit 470f0a7

Browse files
committed
Avoid responding to unexpected I2C interrupts
1 parent d8d7ceb commit 470f0a7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/i2c/busses/i2c-bcm2708.c

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

175175
spin_lock(&bi->lock);
176176

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

179184
if (s & (BSC_S_CLKT | BSC_S_ERR)) {
@@ -207,6 +212,7 @@ static irqreturn_t bcm2708_i2c_interrupt(int irq, void *dev_id)
207212
handled = false;
208213
}
209214

215+
early_exit:
210216
spin_unlock(&bi->lock);
211217

212218
return handled ? IRQ_HANDLED : IRQ_NONE;

0 commit comments

Comments
 (0)