aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2008-10-12 17:51:31 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-14 19:13:28 -0400
commiteef2622a9fcfa964073333ea72c7c9cd20ad45e6 (patch)
tree39d698245b018baf78cb03a369bcde2051b68ff9
parentf5ea64dcbad89875d130596df14c9b25d994a737 (diff)
hvc_console: Fix free_irq in spinlocked section
commit 611e097d7707741a336a0677d9d69bec40f29f3d Author: Christian Borntraeger <borntraeger@de.ibm.com> hvc_console: rework setup to replace irq functions with callbacks introduced a spinlock recursion problem. The notifier_del is called with a lock held, and in turns calls free_irq which then complains when manipulating procfs. This fixes it by moving the call to the notifier to outside of the locked section. Signed-off-by: Christian Borntraeger<borntraeger@de.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--drivers/char/hvc_console.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c
index fd64137b1ab9..f2e4caf70599 100644
--- a/drivers/char/hvc_console.c
+++ b/drivers/char/hvc_console.c
@@ -367,13 +367,13 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
367 spin_lock_irqsave(&hp->lock, flags); 367 spin_lock_irqsave(&hp->lock, flags);
368 368
369 if (--hp->count == 0) { 369 if (--hp->count == 0) {
370 if (hp->ops->notifier_del)
371 hp->ops->notifier_del(hp, hp->data);
372
373 /* We are done with the tty pointer now. */ 370 /* We are done with the tty pointer now. */
374 hp->tty = NULL; 371 hp->tty = NULL;
375 spin_unlock_irqrestore(&hp->lock, flags); 372 spin_unlock_irqrestore(&hp->lock, flags);
376 373
374 if (hp->ops->notifier_del)
375 hp->ops->notifier_del(hp, hp->data);
376
377 /* 377 /*
378 * Chain calls chars_in_buffer() and returns immediately if 378 * Chain calls chars_in_buffer() and returns immediately if
379 * there is no buffered data otherwise sleeps on a wait queue 379 * there is no buffered data otherwise sleeps on a wait queue
@@ -416,11 +416,11 @@ static void hvc_hangup(struct tty_struct *tty)
416 hp->n_outbuf = 0; 416 hp->n_outbuf = 0;
417 hp->tty = NULL; 417 hp->tty = NULL;
418 418
419 spin_unlock_irqrestore(&hp->lock, flags);
420
419 if (hp->ops->notifier_del) 421 if (hp->ops->notifier_del)
420 hp->ops->notifier_del(hp, hp->data); 422 hp->ops->notifier_del(hp, hp->data);
421 423
422 spin_unlock_irqrestore(&hp->lock, flags);
423
424 while(temp_open_count) { 424 while(temp_open_count) {
425 --temp_open_count; 425 --temp_open_count;
426 kref_put(&hp->kref, destroy_hvc_struct); 426 kref_put(&hp->kref, destroy_hvc_struct);