xen: do not clear and mask evtchns in __xen_evtchn_do_upcall
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Fri, 6 May 2011 11:27:50 +0000 (12:27 +0100)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 10 May 2011 16:47:40 +0000 (12:47 -0400)
commit7e186bdd0098b34c69fb8067c67340ae610ea499
treedd648a0f57ba6adf798fca78ff08df6be94848f7
parent693d92a1bbc9e42681c42ed190bd42b636ca876f
xen: do not clear and mask evtchns in __xen_evtchn_do_upcall

Change the irq handler of evtchns and pirqs that don't need EOI (pirqs
that correspond to physical edge interrupts) to handle_edge_irq.

Use handle_fasteoi_irq for pirqs that need eoi (they generally
correspond to level triggered irqs), no risk in loosing interrupts
because we have to EOI the irq anyway.

This change has the following benefits:

- it uses the very same handlers that Linux would use on native for the
same irqs (handle_edge_irq for edge irqs and msis, and
handle_fasteoi_irq for everything else);

- it uses these handlers in the same way native code would use them: it
let Linux mask\unmask and ack the irq when Linux want to mask\unmask
and ack the irq;

- it fixes a problem occurring when a driver calls disable_irq() in its
handler: the old code was unconditionally unmasking the evtchn even if
the irq is disabled when irq_eoi was called.

See Documentation/DocBook/genericirq.tmpl for more informations.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[v1: Fixed space/tab issues]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/events.c