Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen/events: add a evtchn_op for port setup

Add a hook for port-specific setup and call it from
xen_irq_info_common_setup().

The FIFO-based ABIs may need to perform additional setup (expanding
the event array) before a bound event channel can start to receive
events.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

authored by

David Vrabel and committed by
Konrad Rzeszutek Wilk
08385875 96d4c588

+13 -1
+1 -1
drivers/xen/events/events_base.c
··· 117 117 118 118 irq_clear_status_flags(irq, IRQ_NOREQUEST|IRQ_NOAUTOEN); 119 119 120 - return 0; 120 + return xen_evtchn_port_setup(info); 121 121 } 122 122 123 123 static int xen_irq_info_evtchn_setup(unsigned irq,
+12
drivers/xen/events/events_internal.h
··· 55 55 #define PIRQ_SHAREABLE (1 << 1) 56 56 57 57 struct evtchn_ops { 58 + int (*setup)(struct irq_info *info); 58 59 void (*bind_to_cpu)(struct irq_info *info, unsigned cpu); 59 60 60 61 void (*clear_pending)(unsigned port); ··· 75 74 struct irq_info *info_for_irq(unsigned irq); 76 75 unsigned cpu_from_irq(unsigned irq); 77 76 unsigned cpu_from_evtchn(unsigned int evtchn); 77 + 78 + /* 79 + * Do any ABI specific setup for a bound event channel before it can 80 + * be unmasked and used. 81 + */ 82 + static inline int xen_evtchn_port_setup(struct irq_info *info) 83 + { 84 + if (evtchn_ops->setup) 85 + return evtchn_ops->setup(info); 86 + return 0; 87 + } 78 88 79 89 static inline void xen_evtchn_port_bind_to_cpu(struct irq_info *info, 80 90 unsigned cpu)