From: Samuel Mendoza-Jonas <sam@mendozajonas.com> Date: 2016-07-11 03:40:16
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. This is only set for consoles handled by
hvc_opal_probe(), leaving other types unaffected.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
drivers/tty/hvc/hvc_console.h | 1 +
drivers/tty/hvc/hvc_irq.c | 7 +++++--
drivers/tty/hvc/hvc_opal.c | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
@@ -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+*iteratethrougheachhvc_struct+*/returnIRQ_HANDLED;}
@@ -28,8 +31,8 @@ int notifier_add_irq(struct hvc_struct *hp, int irq)hp->irq_requested=0;return0;}-rc=request_irq(irq,hvc_handle_interrupt,0,-"hvc_console",hp);+rc=request_irq(irq,hvc_handle_interrupt,hp->flags,+"hvc_console",hp);if(!rc)hp->irq_requested=1;returnrc;
@@ -224,6 +224,9 @@ static int hvc_opal_probe(struct platform_device *dev)hp=hvc_alloc(termno,irq,ops,MAX_VIO_PUT_CHARS);if(IS_ERR(hp))returnPTR_ERR(hp);++/* hvc consoles on powernv may need to share a single irq */+hp->flags=IRQF_SHARED;dev_set_drvdata(&dev->dev,hp);return0;
From: Samuel Mendoza-Jonas <sam@mendozajonas.com> Date: 2016-07-11 03:40:15
Update the hvc driver to use the OPAL irqchip if made available by the
running firmware. If it is not present, the driver falls back to the
existing OPAL event number.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
v2: Always try irq_of_parse_and_map before falling back
drivers/tty/hvc/hvc_opal.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
@@ -214,7 +214,13 @@ static int hvc_opal_probe(struct platform_device *dev)dev->dev.of_node->full_name,boot?" (boot console)":"");-irq=opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));+irq=irq_of_parse_and_map(dev->dev.of_node,0);+if(!irq){+pr_info("hvc%d: No interrupts property, using OPAL event\n",+termno);+irq=opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));+}+if(!irq){pr_err("hvc_opal: Unable to map interrupt for device %s\n",dev->dev.of_node->full_name);
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-07-11 06:28:49
Samuel Mendoza-Jonas [off-list ref] writes:
Update the hvc driver to use the OPAL irqchip if made available by the
running firmware. If it is not present, the driver falls back to the
existing OPAL event number.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
v2: Always try irq_of_parse_and_map before falling back
LGTM.
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
@@ -214,7 +214,13 @@ static int hvc_opal_probe(struct platform_device *dev)dev->dev.of_node->full_name,boot?" (boot console)":"");-irq=opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));+irq=irq_of_parse_and_map(dev->dev.of_node,0);+if(!irq){+pr_info("hvc%d: No interrupts property, using OPAL event\n",+termno);+irq=opal_event_request(ilog2(OPAL_EVENT_CONSOLE_INPUT));+}+if(!irq){pr_err("hvc_opal: Unable to map interrupt for device %s\n",dev->dev.of_node->full_name);
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-07-11 06:29:20
Samuel Mendoza-Jonas [off-list ref] 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. This is only set for consoles handled by
hvc_opal_probe(), leaving other types unaffected.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
drivers/tty/hvc/hvc_console.h | 1 +
drivers/tty/hvc/hvc_irq.c | 7 +++++--
drivers/tty/hvc/hvc_opal.c | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Greg are you happy to take these two?
cheers
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-07-26 04:11:15
Quoting Michael Ellerman (2016-07-11 16:29:20)
Samuel Mendoza-Jonas [off-list ref] writes:
=
quoted
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. This is only set for consoles handled by
hvc_opal_probe(), leaving other types unaffected.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
drivers/tty/hvc/hvc_console.h | 1 +
drivers/tty/hvc/hvc_irq.c | 7 +++++--
drivers/tty/hvc/hvc_opal.c | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
=
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
=
Greg are you happy to take these two?
Hi Greg,
I don't see this series anywhere, do you mind if I take them via the
powerpc tree for 4.8 ? Or do you want to pick them up.
cheers
On Tue, Jul 26, 2016 at 02:11:11PM +1000, Michael Ellerman wrote:
Quoting Michael Ellerman (2016-07-11 16:29:20)
quoted
Samuel Mendoza-Jonas [off-list ref] writes:
quoted
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. This is only set for consoles handled by
hvc_opal_probe(), leaving other types unaffected.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Cc: <redacted> # 4.1.x-
---
drivers/tty/hvc/hvc_console.h | 1 +
drivers/tty/hvc/hvc_irq.c | 7 +++++--
drivers/tty/hvc/hvc_opal.c | 3 +++
3 files changed, 9 insertions(+), 2 deletions(-)
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Greg are you happy to take these two?
Hi Greg,
I don't see this series anywhere, do you mind if I take them via the
powerpc tree for 4.8 ? Or do you want to pick them up.
You can take them, I'm not touching patches now until 4.8-rc1 is out,
sorry.
thanks,
greg k-h
From: Michael Ellerman <hidden> Date: 2016-07-27 14:32:47
On Mon, 2016-11-07 at 03:38:57 UTC, Sam Mendoza-Jonas wrote:
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. This is only set for consoles handled by
hvc_opal_probe(), leaving other types unaffected.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
From: Michael Ellerman <hidden> Date: 2016-07-27 14:32:49
On Mon, 2016-11-07 at 03:38:58 UTC, Sam Mendoza-Jonas wrote:
Update the hvc driver to use the OPAL irqchip if made available by the
running firmware. If it is not present, the driver falls back to the
existing OPAL event number.
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>