linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook
@ 2017-01-17 14:13 Ruslan Ruslichenko
  2017-01-18 10:46 ` Thomas Gleixner
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ruslan Ruslichenko @ 2017-01-17 14:13 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-kernel
  Cc: xe-linux-external, Ruslan Ruslichenko

After commit d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical
irqdomain interfaces") IO-APIC is switched to hierarchical irqdomain
implementation. Also this patch removed irq_retrigger hook for IO-APIC
chip which seem to be wrong. Without this hook some edge-triggered irq's
might be lost, since kernel uses it to retrigger edge irq's triggered
while they are being handled or disabled by driver
(see "Delayed_interrupt_disable" section at "Generic-IRQ-Guide"
of kernel docbook).

Thus adding this hook same way as it was done for MSI domain.

Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
---
 arch/x86/kernel/apic/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 945e512..1e35dd0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1875,6 +1875,7 @@ static int ioapic_set_affinity(struct irq_data *irq_data,
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
@@ -1886,6 +1887,7 @@ static int ioapic_set_affinity(struct irq_data *irq_data,
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook
  2017-01-17 14:13 [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook Ruslan Ruslichenko
@ 2017-01-18 10:46 ` Thomas Gleixner
  2017-01-18 14:26   ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  2017-01-18 10:55 ` [tip:x86/apic] x86/ioapic: Restore IO-APIC irq_chip retrigger callback tip-bot for Ruslan Ruslichenko
  2017-01-18 14:42 ` [tip:x86/urgent] " tip-bot for Ruslan Ruslichenko
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Gleixner @ 2017-01-18 10:46 UTC (permalink / raw)
  To: Ruslan Ruslichenko
  Cc: Ingo Molnar, H. Peter Anvin, x86, linux-kernel, xe-linux-external

On Tue, 17 Jan 2017, Ruslan Ruslichenko wrote:

> After commit d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical
> irqdomain interfaces") IO-APIC is switched to hierarchical irqdomain
> implementation. Also this patch removed irq_retrigger hook for IO-APIC
> chip which seem to be wrong. Without this hook some edge-triggered irq's
> might be lost, since kernel uses it to retrigger edge irq's triggered
> while they are being handled or disabled by driver

Restoring the callbacks is the right thing to do, but there is no problem
because if the retrigger callback is empty then pending edge interrupts are
resent by software. It's just less efficient, but not a issue.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:x86/apic] x86/ioapic: Restore IO-APIC irq_chip retrigger callback
  2017-01-17 14:13 [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook Ruslan Ruslichenko
  2017-01-18 10:46 ` Thomas Gleixner
@ 2017-01-18 10:55 ` tip-bot for Ruslan Ruslichenko
  2017-01-18 14:42 ` [tip:x86/urgent] " tip-bot for Ruslan Ruslichenko
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Ruslan Ruslichenko @ 2017-01-18 10:55 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: mingo, linux-kernel, rruslich, hpa, tglx

Commit-ID:  a9b4f08770b415f30f2fb0f8329a370c8f554aa3
Gitweb:     http://git.kernel.org/tip/a9b4f08770b415f30f2fb0f8329a370c8f554aa3
Author:     Ruslan Ruslichenko <rruslich@cisco.com>
AuthorDate: Tue, 17 Jan 2017 16:13:52 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 18 Jan 2017 11:51:02 +0100

x86/ioapic: Restore IO-APIC irq_chip retrigger callback

commit d32932d02e18 removed the irq_retrigger callback from the IO-APIC
chip and did not add it to the new IO-APIC-IR irq chip.

There is no harm because the interrupts are resent in software when the
retrigger callback is NULL, but it's less efficient. So restore them.

[ tglx: Massaged changelog ]

Fixes: d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Cc: xe-linux-external@cisco.com
Link: http://lkml.kernel.org/r/1484662432-13580-1-git-send-email-rruslich@cisco.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/apic/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 945e512..1e35dd0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1875,6 +1875,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
@@ -1886,6 +1887,7 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook
  2017-01-18 10:46 ` Thomas Gleixner
@ 2017-01-18 14:26   ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  2017-01-18 14:36     ` Thomas Gleixner
  0 siblings, 1 reply; 6+ messages in thread
From: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) @ 2017-01-18 14:26 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, H. Peter Anvin, x86, linux-kernel, xe-linux-external

On 01/18/2017 12:46 PM, Thomas Gleixner wrote:
> On Tue, 17 Jan 2017, Ruslan Ruslichenko wrote:
>
>> After commit d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical
>> irqdomain interfaces") IO-APIC is switched to hierarchical irqdomain
>> implementation. Also this patch removed irq_retrigger hook for IO-APIC
>> chip which seem to be wrong. Without this hook some edge-triggered irq's
>> might be lost, since kernel uses it to retrigger edge irq's triggered
>> while they are being handled or disabled by driver
> Restoring the callbacks is the right thing to do, but there is no problem
> because if the retrigger callback is empty then pending edge interrupts are
> resent by software. It's just less efficient, but not a issue.

Software resend will only work if CONFIG_HARDIRQS_SW_RESEND is enabled,
which is not selected for x86 architectures.

So it's good that patch now picked up.
> Thanks,
>
> 	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook
  2017-01-18 14:26   ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
@ 2017-01-18 14:36     ` Thomas Gleixner
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Gleixner @ 2017-01-18 14:36 UTC (permalink / raw)
  To: Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
  Cc: Ingo Molnar, H. Peter Anvin, x86, linux-kernel, xe-linux-external

On Wed, 18 Jan 2017, Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco) wrote:
> On 01/18/2017 12:46 PM, Thomas Gleixner wrote:
> > On Tue, 17 Jan 2017, Ruslan Ruslichenko wrote:
> > 
> > > After commit d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical
> > > irqdomain interfaces") IO-APIC is switched to hierarchical irqdomain
> > > implementation. Also this patch removed irq_retrigger hook for IO-APIC
> > > chip which seem to be wrong. Without this hook some edge-triggered irq's
> > > might be lost, since kernel uses it to retrigger edge irq's triggered
> > > while they are being handled or disabled by driver
> > Restoring the callbacks is the right thing to do, but there is no problem
> > because if the retrigger callback is empty then pending edge interrupts are
> > resent by software. It's just less efficient, but not a issue.
> 
> Software resend will only work if CONFIG_HARDIRQS_SW_RESEND is enabled,
> which is not selected for x86 architectures.

Dammit, right you are. Good question why nobody noticed so far.

Lemme amend that commit, so it gets back into stable then.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [tip:x86/urgent] x86/ioapic: Restore IO-APIC irq_chip retrigger callback
  2017-01-17 14:13 [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook Ruslan Ruslichenko
  2017-01-18 10:46 ` Thomas Gleixner
  2017-01-18 10:55 ` [tip:x86/apic] x86/ioapic: Restore IO-APIC irq_chip retrigger callback tip-bot for Ruslan Ruslichenko
@ 2017-01-18 14:42 ` tip-bot for Ruslan Ruslichenko
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for Ruslan Ruslichenko @ 2017-01-18 14:42 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, mingo, rruslich, hpa, tglx

Commit-ID:  020eb3daaba2857b32c4cf4c82f503d6a00a67de
Gitweb:     http://git.kernel.org/tip/020eb3daaba2857b32c4cf4c82f503d6a00a67de
Author:     Ruslan Ruslichenko <rruslich@cisco.com>
AuthorDate: Tue, 17 Jan 2017 16:13:52 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 18 Jan 2017 15:37:28 +0100

x86/ioapic: Restore IO-APIC irq_chip retrigger callback

commit d32932d02e18 removed the irq_retrigger callback from the IO-APIC
chip and did not add it to the new IO-APIC-IR irq chip.

Unfortunately the software resend fallback is not enabled on X86, so edge
interrupts which are received during the lazy disabled state of the
interrupt line are not retriggered and therefor lost.

Restore the callbacks.

[ tglx: Massaged changelog ]

Fixes: d32932d02e18  ("x86/irq: Convert IOAPIC to use hierarchical irqdomain interfaces")
Signed-off-by: Ruslan Ruslichenko <rruslich@cisco.com>
Cc: xe-linux-external@cisco.com
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/1484662432-13580-1-git-send-email-rruslich@cisco.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/kernel/apic/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 945e512..1e35dd0 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1875,6 +1875,7 @@ static struct irq_chip ioapic_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 
@@ -1886,6 +1887,7 @@ static struct irq_chip ioapic_ir_chip __read_mostly = {
 	.irq_ack		= irq_chip_ack_parent,
 	.irq_eoi		= ioapic_ir_ack_level,
 	.irq_set_affinity	= ioapic_set_affinity,
+	.irq_retrigger		= irq_chip_retrigger_hierarchy,
 	.flags			= IRQCHIP_SKIP_SET_WAKE,
 };
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-01-18 15:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-17 14:13 [PATCH] x86/ioapic: add IO-APIC irq_chip retrigger hook Ruslan Ruslichenko
2017-01-18 10:46 ` Thomas Gleixner
2017-01-18 14:26   ` Ruslan Ruslichenko -X (rruslich - GLOBALLOGIC INC at Cisco)
2017-01-18 14:36     ` Thomas Gleixner
2017-01-18 10:55 ` [tip:x86/apic] x86/ioapic: Restore IO-APIC irq_chip retrigger callback tip-bot for Ruslan Ruslichenko
2017-01-18 14:42 ` [tip:x86/urgent] " tip-bot for Ruslan Ruslichenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).