Commit e5ac0bda authored by Stefano Stabellini's avatar Stefano Stabellini Committed by Konrad Rzeszutek Wilk

xen: use the trigger info we already have to choose the irq handler

Do not use pirq_needs_eoi to decide which irq handler to use because Xen
always returns true if the guest does not support pirq_eoi_map.
Use the trigger information we already have from MP-tables and ACPI.
Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Reported-by: default avatarThomas Goetz <tom.goetz@virtualcomputer.com>
Tested-by: default avatarThomas Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent 55922c9d
...@@ -626,6 +626,9 @@ int xen_allocate_pirq_gsi(unsigned gsi) ...@@ -626,6 +626,9 @@ int xen_allocate_pirq_gsi(unsigned gsi)
* *
* Note: We don't assign an event channel until the irq actually started * Note: We don't assign an event channel until the irq actually started
* up. Return an existing irq if we've already got one for the gsi. * up. Return an existing irq if we've already got one for the gsi.
*
* Shareable implies level triggered, not shareable implies edge
* triggered here.
*/ */
int xen_bind_pirq_gsi_to_irq(unsigned gsi, int xen_bind_pirq_gsi_to_irq(unsigned gsi,
unsigned pirq, int shareable, char *name) unsigned pirq, int shareable, char *name)
...@@ -664,16 +667,13 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi, ...@@ -664,16 +667,13 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi,
pirq_query_unmask(irq); pirq_query_unmask(irq);
/* We try to use the handler with the appropriate semantic for the /* We try to use the handler with the appropriate semantic for the
* type of interrupt: if the interrupt doesn't need an eoi * type of interrupt: if the interrupt is an edge triggered
* (pirq_needs_eoi returns false), we treat it like an edge * interrupt we use handle_edge_irq.
* triggered interrupt so we use handle_edge_irq.
* As a matter of fact this only happens when the corresponding
* physical interrupt is edge triggered or an msi.
* *
* On the other hand if the interrupt needs an eoi (pirq_needs_eoi * On the other hand if the interrupt is level triggered we use
* returns true) we treat it like a level triggered interrupt so we * handle_fasteoi_irq like the native code does for this kind of
* use handle_fasteoi_irq like the native code does for this kind of
* interrupts. * interrupts.
*
* Depending on the Xen version, pirq_needs_eoi might return true * Depending on the Xen version, pirq_needs_eoi might return true
* not only for level triggered interrupts but for edge triggered * not only for level triggered interrupts but for edge triggered
* interrupts too. In any case Xen always honors the eoi mechanism, * interrupts too. In any case Xen always honors the eoi mechanism,
...@@ -681,7 +681,7 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi, ...@@ -681,7 +681,7 @@ int xen_bind_pirq_gsi_to_irq(unsigned gsi,
* hasn't received an eoi yet. Therefore using the fasteoi handler * hasn't received an eoi yet. Therefore using the fasteoi handler
* is the right choice either way. * is the right choice either way.
*/ */
if (pirq_needs_eoi(irq)) if (shareable)
irq_set_chip_and_handler_name(irq, &xen_pirq_chip, irq_set_chip_and_handler_name(irq, &xen_pirq_chip,
handle_fasteoi_irq, name); handle_fasteoi_irq, name);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment