diff options
Diffstat (limited to 'arch/x86/pci/xen.c')
-rw-r--r-- | arch/x86/pci/xen.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index e1fb269c87af..292ab0364a89 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -234,23 +234,14 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
234 | return 1; | 234 | return 1; |
235 | 235 | ||
236 | for_each_pci_msi_entry(msidesc, dev) { | 236 | for_each_pci_msi_entry(msidesc, dev) { |
237 | __pci_read_msi_msg(msidesc, &msg); | 237 | pirq = xen_allocate_pirq_msi(dev, msidesc); |
238 | pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | | 238 | if (pirq < 0) { |
239 | ((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff); | 239 | irq = -ENODEV; |
240 | if (msg.data != XEN_PIRQ_MSI_DATA || | 240 | goto error; |
241 | xen_irq_from_pirq(pirq) < 0) { | ||
242 | pirq = xen_allocate_pirq_msi(dev, msidesc); | ||
243 | if (pirq < 0) { | ||
244 | irq = -ENODEV; | ||
245 | goto error; | ||
246 | } | ||
247 | xen_msi_compose_msg(dev, pirq, &msg); | ||
248 | __pci_write_msi_msg(msidesc, &msg); | ||
249 | dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq); | ||
250 | } else { | ||
251 | dev_dbg(&dev->dev, | ||
252 | "xen: msi already bound to pirq=%d\n", pirq); | ||
253 | } | 241 | } |
242 | xen_msi_compose_msg(dev, pirq, &msg); | ||
243 | __pci_write_msi_msg(msidesc, &msg); | ||
244 | dev_dbg(&dev->dev, "xen: msi bound to pirq=%d\n", pirq); | ||
254 | irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq, | 245 | irq = xen_bind_pirq_msi_to_irq(dev, msidesc, pirq, |
255 | (type == PCI_CAP_ID_MSI) ? nvec : 1, | 246 | (type == PCI_CAP_ID_MSI) ? nvec : 1, |
256 | (type == PCI_CAP_ID_MSIX) ? | 247 | (type == PCI_CAP_ID_MSIX) ? |