Skip to content

Commit 5fdce56

Browse files
jeanleflambeurpopcornmix
jeanleflambeur
authored andcommitted
Update i2c-bcm2708.c
1 parent cb393fa commit 5fdce56

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/i2c/busses/i2c-bcm2708.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ static int bcm2708_i2c_master_xfer(struct i2c_adapter *adap,
266266
bi->nmsgs = num;
267267
bi->error = false;
268268

269-
spin_unlock_irqrestore(&bi->lock, flags);
270-
271269
bcm2708_bsc_setup(bi);
272270

271+
/* unlockig _after_ the setup to avoid races with the interrupt routine */
272+
spin_unlock_irqrestore(&bi->lock, flags);
273+
273274
ret = wait_for_completion_timeout(&bi->done,
274275
msecs_to_jiffies(I2C_TIMEOUT_MS));
275276
if (ret == 0) {

0 commit comments

Comments
 (0)