diff options
Diffstat (limited to 'arch/powerpc/platforms/powermac/low_i2c.c')
-rw-r--r-- | arch/powerpc/platforms/powermac/low_i2c.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c index 996c5ff7824b..03685a329d7d 100644 --- a/arch/powerpc/platforms/powermac/low_i2c.c +++ b/arch/powerpc/platforms/powermac/low_i2c.c | |||
@@ -366,11 +366,20 @@ static void kw_i2c_timeout(unsigned long data) | |||
366 | unsigned long flags; | 366 | unsigned long flags; |
367 | 367 | ||
368 | spin_lock_irqsave(&host->lock, flags); | 368 | spin_lock_irqsave(&host->lock, flags); |
369 | |||
370 | /* | ||
371 | * If the timer is pending, that means we raced with the | ||
372 | * irq, in which case we just return | ||
373 | */ | ||
374 | if (timer_pending(&host->timeout_timer)) | ||
375 | goto skip; | ||
376 | |||
369 | kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); | 377 | kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); |
370 | if (host->state != state_idle) { | 378 | if (host->state != state_idle) { |
371 | host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; | 379 | host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; |
372 | add_timer(&host->timeout_timer); | 380 | add_timer(&host->timeout_timer); |
373 | } | 381 | } |
382 | skip: | ||
374 | spin_unlock_irqrestore(&host->lock, flags); | 383 | spin_unlock_irqrestore(&host->lock, flags); |
375 | } | 384 | } |
376 | 385 | ||