Skip to content

Commit

Permalink
Merge branches 'stable/irq.fairness' and 'stable/irq.ween_of_nr_irqs'…
Browse files Browse the repository at this point in the history
… of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

* 'stable/irq.fairness' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: events: Remove redundant clear of l2i at end of round-robin loop
  xen: events: Make round-robin scan fairer by snapshotting each l2 word once only
  xen: events: Clean up round-robin evtchn scan.
  xen: events: Make last processed event channel a per-cpu variable.
  xen: events: Process event channels notifications in round-robin order.

* 'stable/irq.ween_of_nr_irqs' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: events: Fix compile error if CONFIG_SMP is not defined.
  xen: events: correct locking in xen_irq_from_pirq
  xen: events: propagate irq allocation failure instead of panicking
  xen: events: do not workaround too-small nr_irqs
  xen: events: remove use of nr_irqs as upper bound on number of pirqs
  xen: events: dynamically allocate irq info structures
  xen: events: maintain a list of Xen interrupts
  xen: events: push setup of irq<->{evtchn,ipi,virq,pirq} maps into irq_info init functions
  xen: events: turn irq_info constructors into initialiser functions
  xen: events: use per-cpu variable for cpu_evtchn_mask
  xen: events: refactor GSI pirq bindings functions
  xen: events: rename restore_cpu_pirqs -> restore_pirqs
  xen: events: remove unused public functions
  xen: events: fix xen_map_pirq_gsi error return
  xen: events: simplify comment
  xen: events: separate two unrelated halves of if condition

Fix up trivial conflicts in drivers/xen/events.c
  • Loading branch information
torvalds committed Mar 18, 2011
3 parents 514af9f + 3b7bcdf + 44626e4 commit 5a39837
Show file tree
Hide file tree
Showing 3 changed files with 300 additions and 204 deletions.
41 changes: 29 additions & 12 deletions arch/x86/pci/xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int acpi_register_gsi_xen_hvm(struct device *dev, u32 gsi,
name = "ioapic-level";
}

irq = xen_map_pirq_gsi(map_irq.pirq, gsi, shareable, name);
irq = xen_bind_pirq_gsi_to_irq(gsi, map_irq.pirq, shareable, name);

printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq);

Expand Down Expand Up @@ -237,6 +237,7 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
{
int rc;
int share = 1;
int pirq;
u8 gsi;

rc = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi);
Expand All @@ -246,13 +247,21 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev)
return rc;
}

rc = xen_allocate_pirq_gsi(gsi);
if (rc < 0) {
dev_warn(&dev->dev, "Xen PCI: failed to allocate a PIRQ for GSI%d: %d\n",
gsi, rc);
return rc;
}
pirq = rc;

if (gsi < NR_IRQS_LEGACY)
share = 0;

rc = xen_allocate_pirq(gsi, share, "pcifront");
rc = xen_bind_pirq_gsi_to_irq(gsi, pirq, share, "pcifront");
if (rc < 0) {
dev_warn(&dev->dev, "Xen PCI: failed to register GSI%d: %d\n",
gsi, rc);
dev_warn(&dev->dev, "Xen PCI: failed to bind GSI%d (PIRQ%d) to IRQ: %d\n",
gsi, pirq, rc);
return rc;
}

Expand Down Expand Up @@ -309,7 +318,7 @@ int __init pci_xen_hvm_init(void)
#ifdef CONFIG_XEN_DOM0
static int xen_register_pirq(u32 gsi, int triggering)
{
int rc, irq;
int rc, pirq, irq = -1;
struct physdev_map_pirq map_irq;
int shareable = 0;
char *name;
Expand All @@ -325,17 +334,20 @@ static int xen_register_pirq(u32 gsi, int triggering)
name = "ioapic-level";
}

irq = xen_allocate_pirq(gsi, shareable, name);

printk(KERN_DEBUG "xen: --> irq=%d\n", irq);
pirq = xen_allocate_pirq_gsi(gsi);
if (pirq < 0)
goto out;

irq = xen_bind_pirq_gsi_to_irq(gsi, pirq, shareable, name);
if (irq < 0)
goto out;

printk(KERN_DEBUG "xen: --> pirq=%d -> irq=%d\n", pirq, irq);

map_irq.domid = DOMID_SELF;
map_irq.type = MAP_PIRQ_TYPE_GSI;
map_irq.index = gsi;
map_irq.pirq = irq;
map_irq.pirq = pirq;

rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq);
if (rc) {
Expand Down Expand Up @@ -422,13 +434,18 @@ static int __init pci_xen_initial_domain(void)

void __init xen_setup_pirqs(void)
{
int irq;
int pirq, irq;

pci_xen_initial_domain();

if (0 == nr_ioapics) {
for (irq = 0; irq < NR_IRQS_LEGACY; irq++)
xen_allocate_pirq(irq, 0, "xt-pic");
for (irq = 0; irq < NR_IRQS_LEGACY; irq++) {
pirq = xen_allocate_pirq_gsi(irq);
if (WARN(pirq < 0,
"Could not allocate PIRQ for legacy interrupt\n"))
break;
irq = xen_bind_pirq_gsi_to_irq(irq, pirq, 0, "xt-pic");
}
return;
}

Expand Down
Loading

0 comments on commit 5a39837

Please sign in to comment.