Skip to content

Commit

Permalink
[PATCH] Fix ppc64 smu driver locking
Browse files Browse the repository at this point in the history
The SMU driver has a small mistake in the locking of the interrupt code,
if polled access and interrupt access race, interrupt may take a lock
and return without releasing it. This fixes it. With that patch, the
driver is rock solid with my experimental thermal control (which bangs
it pretty hard) racing with real time clock and cpufreq handling.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Benjamin Herrenschmidt authored and Linus Torvalds committed Sep 29, 2005
1 parent 7644143 commit a44fe13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/macintosh/smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ static irqreturn_t smu_db_intr(int irq, void *arg, struct pt_regs *regs)
spin_lock_irqsave(&smu->lock, flags);

gpio = pmac_do_feature_call(PMAC_FTR_READ_GPIO, NULL, smu->doorbell);
if ((gpio & 7) != 7)
if ((gpio & 7) != 7) {
spin_unlock_irqrestore(&smu->lock, flags);
return IRQ_HANDLED;
}

cmd = smu->cmd_cur;
smu->cmd_cur = NULL;
Expand Down

0 comments on commit a44fe13

Please sign in to comment.