diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-06-09 04:19:48 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 17:05:42 -0400 |
commit | 95d76acc7518d566df18d67c1343bb375b78d1f3 (patch) | |
tree | d0e826c07402d4df28042792951b4b647048c5a1 /arch/x86/pci/xen.c | |
parent | 6532ce994c304835f3bfc8479acce9d102cd8b5b (diff) |
x86, irq: Count legacy IRQs by legacy_pic->nr_legacy_irqs instead of NR_IRQS_LEGACY
Some platforms, such as Intel MID and mshypv, do not support legacy
interrupt controllers. So count legacy IRQs by legacy_pic->nr_legacy_irqs
instead of hard-coded NR_IRQS_LEGACY.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: xen-devel@lists.xenproject.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Link: http://lkml.kernel.org/r/1402302011-23642-20-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/pci/xen.c')
-rw-r--r-- | arch/x86/pci/xen.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 905956f16465..093f5f4272d3 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <xen/features.h> | 23 | #include <xen/features.h> |
24 | #include <xen/events.h> | 24 | #include <xen/events.h> |
25 | #include <asm/xen/pci.h> | 25 | #include <asm/xen/pci.h> |
26 | #include <asm/i8259.h> | ||
26 | 27 | ||
27 | static int xen_pcifront_enable_irq(struct pci_dev *dev) | 28 | static int xen_pcifront_enable_irq(struct pci_dev *dev) |
28 | { | 29 | { |
@@ -40,7 +41,7 @@ static int xen_pcifront_enable_irq(struct pci_dev *dev) | |||
40 | /* In PV DomU the Xen PCI backend puts the PIRQ in the interrupt line.*/ | 41 | /* In PV DomU the Xen PCI backend puts the PIRQ in the interrupt line.*/ |
41 | pirq = gsi; | 42 | pirq = gsi; |
42 | 43 | ||
43 | if (gsi < NR_IRQS_LEGACY) | 44 | if (gsi < nr_legacy_irqs()) |
44 | share = 0; | 45 | share = 0; |
45 | 46 | ||
46 | rc = xen_bind_pirq_gsi_to_irq(gsi, pirq, share, "pcifront"); | 47 | rc = xen_bind_pirq_gsi_to_irq(gsi, pirq, share, "pcifront"); |
@@ -511,7 +512,7 @@ int __init pci_xen_initial_domain(void) | |||
511 | xen_setup_acpi_sci(); | 512 | xen_setup_acpi_sci(); |
512 | __acpi_register_gsi = acpi_register_gsi_xen; | 513 | __acpi_register_gsi = acpi_register_gsi_xen; |
513 | /* Pre-allocate legacy irqs */ | 514 | /* Pre-allocate legacy irqs */ |
514 | for (irq = 0; irq < NR_IRQS_LEGACY; irq++) { | 515 | for (irq = 0; irq < nr_legacy_irqs(); irq++) { |
515 | int trigger, polarity; | 516 | int trigger, polarity; |
516 | 517 | ||
517 | if (acpi_get_override_irq(irq, &trigger, &polarity) == -1) | 518 | if (acpi_get_override_irq(irq, &trigger, &polarity) == -1) |
@@ -522,7 +523,7 @@ int __init pci_xen_initial_domain(void) | |||
522 | true /* Map GSI to PIRQ */); | 523 | true /* Map GSI to PIRQ */); |
523 | } | 524 | } |
524 | if (0 == nr_ioapics) { | 525 | if (0 == nr_ioapics) { |
525 | for (irq = 0; irq < NR_IRQS_LEGACY; irq++) | 526 | for (irq = 0; irq < nr_legacy_irqs(); irq++) |
526 | xen_bind_pirq_gsi_to_irq(irq, irq, 0, "xt-pic"); | 527 | xen_bind_pirq_gsi_to_irq(irq, irq, 0, "xt-pic"); |
527 | } | 528 | } |
528 | return 0; | 529 | return 0; |