aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIan Campbell <ian.campbell@citrix.com>2011-02-18 11:43:31 -0500
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2011-03-10 14:44:39 -0500
commit5cad61a6ba6f4956a218ffbb64cafcc1daefaca0 (patch)
tree96b25ef58b3bba37808fe3cd7bbb37a444187260 /drivers
parent9a626612c2010699d9909a4c3141d3a38660f3b3 (diff)
xen: events: assume PHYSDEVOP_get_free_pirq exists
The find_unbound_pirq is called only from xen_allocate_pirq_msi and only if alloc_pirq is true. The only caller which does this is xen_hvm_setup_msi_irqs. The use of this function is gated, in pci_xen_hvm_init, on XENFEAT_hvm_pirqs. The PHYSDEVOP_get_free_pirq interfaces was added to the hypervisor in 22410:be96f6058c05 while XENFEAT_hvm_pirqs was added a couple of minutes prior in 22409:6663214f06ac. Therefore we do not need to concern ourselves with hypervisors which support XENFEAT_hvm_pirqs but not PHYSDEVOP_get_free_pirq. This eliminates the fallback path in find_unbound_pirq which walks to pirq_to_irq array looking for a free pirq. Unlike the PHYSDEVOP_get_free_pirq interface this fallback only looks up a free pirq but does not reserve it. Removing this fallback will simplify locking in the future. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/xen/events.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index ed3420df0937..c21066fc30be 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -649,19 +649,16 @@ out:
649 649
650static int find_unbound_pirq(int type) 650static int find_unbound_pirq(int type)
651{ 651{
652 int rc, i; 652 int rc;
653 struct physdev_get_free_pirq op_get_free_pirq; 653 struct physdev_get_free_pirq op_get_free_pirq;
654 op_get_free_pirq.type = type;
655 654
655 op_get_free_pirq.type = type;
656 rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq); 656 rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq);
657 if (!rc)
658 return op_get_free_pirq.pirq;
659 657
660 for (i = 0; i < nr_irqs; i++) { 658 WARN_ONCE(rc == -ENOSYS,
661 if (pirq_to_irq[i] < 0) 659 "hypervisor does not support the PHYSDEVOP_get_free_pirq interface\n");
662 return i; 660
663 } 661 return rc ? -1 : op_get_free_pirq.pirq;
664 return -1;
665} 662}
666 663
667int xen_allocate_pirq_msi(char *name, int *pirq, int alloc_pirq) 664int xen_allocate_pirq_msi(char *name, int *pirq, int alloc_pirq)