fix spinlock recursion in hvc_console

commit 611e097d7707741a336a0677d9d69bec40f29f3d
Author: Christian Borntraeger <borntraeger@de.ibm.com>
hvc_console: rework setup to replace irq functions with callbacks
introduced a spinlock recursion problem.

request_irq tries to call the handler if the IRQ is shared.
The irq handler of hvc_console calls hvc_poll and hvc_kill
which might take the hvc_struct spinlock. Therefore, we have
to call request_irq outside the spinlock.

We can move the notifier_add safely outside the spinlock as ->data must
not be changed by the backend. Otherwise, tty_hangup would fail anyway.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

authored by Christian Borntraeger and committed by Rusty Russell b1b135c8 ed6d6876

+2 -3
+2 -3
drivers/char/hvc_console.c
··· 322 322 323 323 hp->tty = tty; 324 324 325 - if (hp->ops->notifier_add) 326 - rc = hp->ops->notifier_add(hp, hp->data); 327 - 328 325 spin_unlock_irqrestore(&hp->lock, flags); 329 326 327 + if (hp->ops->notifier_add) 328 + rc = hp->ops->notifier_add(hp, hp->data); 330 329 331 330 /* 332 331 * If the notifier fails we return an error. The tty layer