diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-10-23 12:18:31 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-10-25 14:32:41 -0700 |
commit | 220d13c9015f53509245807f4e4d86e8d062a26d (patch) | |
tree | 16e9910687f0dc71b5f5c5300b4120e13df6b7ad /drivers | |
parent | 07a96d7019701ce9e6be9bd975e4f9d021649a8f (diff) | |
download | lwn-220d13c9015f53509245807f4e4d86e8d062a26d.tar.gz lwn-220d13c9015f53509245807f4e4d86e8d062a26d.zip |
hvc_console: Fix free_irq in spinlocked section
commit eef2622a9fcfa964073333ea72c7c9cd20ad45e6 upstream
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/hvc_console.c | 10 |
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) spin_lock_irqsave(&hp->lock, flags); if (--hp->count == 0) { - if (hp->ops->notifier_del) - hp->ops->notifier_del(hp, hp->data); - /* We are done with the tty pointer now. */ hp->tty = NULL; spin_unlock_irqrestore(&hp->lock, flags); + if (hp->ops->notifier_del) + hp->ops->notifier_del(hp, hp->data); + /* * Chain calls chars_in_buffer() and returns immediately if * there is no buffered data otherwise sleeps on a wait queue @@ -416,11 +416,11 @@ static void hvc_hangup(struct tty_struct *tty) hp->n_outbuf = 0; hp->tty = NULL; + spin_unlock_irqrestore(&hp->lock, flags); + if (hp->ops->notifier_del) hp->ops->notifier_del(hp, hp->data); - spin_unlock_irqrestore(&hp->lock, flags); - while(temp_open_count) { --temp_open_count; kref_put(&hp->kref, destroy_hvc_struct); |