* [PATCH] tty/hvc: Use IRQF_SHARED for hvc consoles
@ 2016-03-18 0:54 Samuel Mendoza-Jonas
2016-03-23 5:17 ` Stewart Smith
0 siblings, 1 reply; 2+ messages in thread
From: Samuel Mendoza-Jonas @ 2016-03-18 0:54 UTC (permalink / raw)
Cc: Greg Kroah-Hartman, Jiri Slaby, Samuel Mendoza-Jonas,
linuxppc-dev, linux-kernel
Commit 2def86a7200c
("hvc: Convert to using interrupts instead of opal events")
enabled the use of interrupts in the hvc_driver for OPAL platforms.
However on machines with more than one hvc console, any console after
the first will fail to register an interrupt handler in
notifier_add_irq() since all consoles share the same IRQ number but do
not set the IRQF_SHARED flag:
[ 51.179907] genirq: Flags mismatch irq 31. 00000000 (hvc_console) vs.
00000000 (hvc_console)
[ 51.180010] hvc_open: request_irq failed with rc -16.
This error propagates up to hvc_open() and the console is closed, but
OPAL will still generate interrupts that are not handled, leading to
rcu_sched stall warnings.
Set IRQF_SHARED when calling request_irq, allowing additional consoles
to start properly.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <stable@vger.kernel.org> # 4.1.x-
---
drivers/tty/hvc/hvc_irq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/hvc/hvc_irq.c b/drivers/tty/hvc/hvc_irq.c
index c9adb05..621263a 100644
--- a/drivers/tty/hvc/hvc_irq.c
+++ b/drivers/tty/hvc/hvc_irq.c
@@ -14,6 +14,9 @@ static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
/* if hvc_poll request a repoll, then kick the hvcd thread */
if (hvc_poll(dev_instance))
hvc_kick();
+ /* We're safe to always return IRQ_HANDLED as the hvcd thread will
+ * iterate through each hvc_struct
+ */
return IRQ_HANDLED;
}
@@ -28,7 +31,7 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)
hp->irq_requested = 0;
return 0;
}
- rc = request_irq(irq, hvc_handle_interrupt, 0,
+ rc = request_irq(irq, hvc_handle_interrupt, IRQF_SHARED,
"hvc_console", hp);
if (!rc)
hp->irq_requested = 1;
--
2.7.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] tty/hvc: Use IRQF_SHARED for hvc consoles
2016-03-18 0:54 [PATCH] tty/hvc: Use IRQF_SHARED for hvc consoles Samuel Mendoza-Jonas
@ 2016-03-23 5:17 ` Stewart Smith
0 siblings, 0 replies; 2+ messages in thread
From: Stewart Smith @ 2016-03-23 5:17 UTC (permalink / raw)
To: Samuel Mendoza-Jonas
Cc: Greg Kroah-Hartman, Samuel Mendoza-Jonas, linuxppc-dev,
linux-kernel, Jiri Slaby
Samuel Mendoza-Jonas <sam@mendozajonas.com> writes:
> Commit 2def86a7200c
> ("hvc: Convert to using interrupts instead of opal events")
> enabled the use of interrupts in the hvc_driver for OPAL platforms.
> However on machines with more than one hvc console, any console after
> the first will fail to register an interrupt handler in
> notifier_add_irq() since all consoles share the same IRQ number but do
> not set the IRQF_SHARED flag:
>
> [ 51.179907] genirq: Flags mismatch irq 31. 00000000 (hvc_console) vs.
> 00000000 (hvc_console)
> [ 51.180010] hvc_open: request_irq failed with rc -16.
>
> This error propagates up to hvc_open() and the console is closed, but
> OPAL will still generate interrupts that are not handled, leading to
> rcu_sched stall warnings.
>
> Set IRQF_SHARED when calling request_irq, allowing additional consoles
> to start properly.
>
> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
> Cc: <stable@vger.kernel.org> # 4.1.x-
Tested on 4.4.6 - seemed to stop (some of) the problems I was having
when using it as a kernel for the bootloader on a FSP based POWER8
system.
Tested-by: Stewart Smith <stewart@linux.vnet.ibm.com>
--
Stewart Smith
OPAL Architect, IBM.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-03-23 5:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-18 0:54 [PATCH] tty/hvc: Use IRQF_SHARED for hvc consoles Samuel Mendoza-Jonas
2016-03-23 5:17 ` Stewart Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®