diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-01-11 12:20:13 -0500 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-03-03 11:56:57 -0500 |
commit | 3f2a230caf21a1f7ac75f9e4892d0e5af9ccee88 (patch) | |
tree | 465cfdf4781f37851e22b99aef7221234c3f9d24 /arch/x86/pci | |
parent | 100b33c8bd8a3235fd0b7948338d6cbb3db3c63d (diff) |
xen: handled remapped IRQs when enabling a pcifront PCI device.
This happens to not be an issue currently because we take pains to try
to ensure that the GSI-IRQ mapping is 1-1 in a PV guest and that
regular event channels do not clash. However a subsequent patch is
going to break this 1-1 mapping.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/xen.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 25cd4a07d09f..2a12f3dbdd02 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -226,21 +226,27 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev) | |||
226 | { | 226 | { |
227 | int rc; | 227 | int rc; |
228 | int share = 1; | 228 | int share = 1; |
229 | u8 gsi; | ||
229 | 230 | ||
230 | dev_info(&dev->dev, "Xen PCI enabling IRQ: %d\n", dev->irq); | 231 | rc = pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &gsi); |
231 | 232 | if (rc < 0) { | |
232 | if (dev->irq < 0) | 233 | dev_warn(&dev->dev, "Xen PCI: failed to read interrupt line: %d\n", |
233 | return -EINVAL; | 234 | rc); |
235 | return rc; | ||
236 | } | ||
234 | 237 | ||
235 | if (dev->irq < NR_IRQS_LEGACY) | 238 | if (gsi < NR_IRQS_LEGACY) |
236 | share = 0; | 239 | share = 0; |
237 | 240 | ||
238 | rc = xen_allocate_pirq(dev->irq, share, "pcifront"); | 241 | rc = xen_allocate_pirq(gsi, share, "pcifront"); |
239 | if (rc < 0) { | 242 | if (rc < 0) { |
240 | dev_warn(&dev->dev, "Xen PCI IRQ: %d, failed to register:%d\n", | 243 | dev_warn(&dev->dev, "Xen PCI: failed to register GSI%d: %d\n", |
241 | dev->irq, rc); | 244 | gsi, rc); |
242 | return rc; | 245 | return rc; |
243 | } | 246 | } |
247 | |||
248 | dev->irq = rc; | ||
249 | dev_info(&dev->dev, "Xen PCI mapped GSI%d to IRQ%d\n", gsi, dev->irq); | ||
244 | return 0; | 250 | return 0; |
245 | } | 251 | } |
246 | 252 | ||