Skip to contentSkip to conversation

xen/events: Fix interrupt lost during irq_disable and irq_enable

PATCH Applied Liu Shuo 3 participants 5 messages Jul 29, 2017 – Aug 11, 2017 Xen hypervisor interface

lore
Share & tools
lore

Liu Shuo

author
#0 lore raw

PATCH 1/1 xen/events: Fix interrupt lost during irq_disable and irq_enable

Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario,
1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
2. dev interrupt raised by HW and Xen mark its evtchn as pending
3. irq_enable -> startup_pirq -> eoi_pirq ->

    clear_evtchn(channel of irq) -> clear pending status

4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once
5. No HW interrupt raising anymore.

Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable.

---
 drivers/xen/events/events_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/xen/events/events_base.c +1 -1
index bae1f5d3..2d43118 100644
@@ -574,7 +574,7 @@ static void shutdown_pirq(struct irq_data *data)
 
 static void enable_pirq(struct irq_data *data)
 {
-	startup_pirq(data);
+	enable_dynirq(data);
 }
 
 static void disable_pirq(struct irq_data *data)
Signature · 1 line
1.9.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Liu Shuo

Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario,
1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
2. dev interrupt raised by HW and Xen mark its evtchn as pending
3. irq_enable -> startup_pirq -> eoi_pirq ->

    clear_evtchn(channel of irq) -> clear pending status
Quoted 8 lines

4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once
5. No HW interrupt raising anymore.

Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v1 1/1
#2 lore raw
In reply to Liu Shuo
Quoted 6 lines · Liu Shuo

Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario,
1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
2. dev interrupt raised by HW and Xen mark its evtchn as pending
3. irq_enable -> startup_pirq -> eoi_pirq ->

    clear_evtchn(channel of irq) -> clear pending status
Quoted 8 lines

4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once
5. No HW interrupt raising anymore.

Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable.

maintainer Applied
#3 lore raw
In reply to Liu Shuo
Quoted 6 lines · Liu Shuo

Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario,
1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
2. dev interrupt raised by HW and Xen mark its evtchn as pending
3. irq_enable -> startup_pirq -> eoi_pirq ->

    clear_evtchn(channel of irq) -> clear pending status
Quoted 8 lines

4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once
5. No HW interrupt raising anymore.

Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable.

Pushed to xen/tip.git for-linus-4.13b

Thanks,

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

maintainer Applied
#4 lore raw
In reply to Liu Shuo
Quoted 6 lines · Liu Shuo

Here is a device has xen-pirq-MSI interrupt. Dom0 might lost interrupt during driver irq_disable/irq_enable. Here is the scenario,
1. irq_disable -> disable_dynirq -> mask_evtchn(irq channel)
2. dev interrupt raised by HW and Xen mark its evtchn as pending
3. irq_enable -> startup_pirq -> eoi_pirq ->

    clear_evtchn(channel of irq) -> clear pending status
Quoted 8 lines

4. consume_one_event process the irq event without pending bit assert which result in interrupt lost once
5. No HW interrupt raising anymore.

Now use enable_dynirq for enable_pirq of xen_pirq_chip to remove eoi_pirq when irq_enable.

Pushed to xen/tip.git for-linus-4.13b

Thanks,

Juergen