aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:50:22 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:52 -0400
commit6d50bc26836e16a9589e0b128d527c29e30d722a (patch)
tree8fd02d634b4cdf618e0328813b33c3a357015547 /arch
parente420dfb40c453a9760b86c7f338052bdb4dfa755 (diff)
x86: use 28 bits irq NR for pci msi/msix and ht
also print out irq no in /proc/interrups and /proc/stat in hex, so could tell bus/dev/func. Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/io_apic_64.c64
-rw-r--r--arch/x86/kernel/irq_64.c2
2 files changed, 51 insertions, 15 deletions
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c
index 8ab7ae01773f..b0d4abc55a11 100644
--- a/arch/x86/kernel/io_apic_64.c
+++ b/arch/x86/kernel/io_apic_64.c
@@ -2520,17 +2520,21 @@ device_initcall(ioapic_init_sysfs);
2520/* 2520/*
2521 * Dynamic irq allocate and deallocation 2521 * Dynamic irq allocate and deallocation
2522 */ 2522 */
2523int create_irq(void) 2523unsigned int create_irq_nr(unsigned int irq_want)
2524{ 2524{
2525 /* Allocate an unused irq */ 2525 /* Allocate an unused irq */
2526 int irq; 2526 unsigned int irq;
2527 int new; 2527 unsigned int new;
2528 unsigned long flags; 2528 unsigned long flags;
2529 struct irq_cfg *cfg_new; 2529 struct irq_cfg *cfg_new;
2530 2530
2531 irq = -ENOSPC; 2531#ifndef CONFIG_HAVE_SPARSE_IRQ
2532 irq_want = nr_irqs - 1;
2533#endif
2534
2535 irq = 0;
2532 spin_lock_irqsave(&vector_lock, flags); 2536 spin_lock_irqsave(&vector_lock, flags);
2533 for (new = (nr_irqs - 1); new >= 0; new--) { 2537 for (new = irq_want; new > 0; new--) {
2534 if (platform_legacy_irq(new)) 2538 if (platform_legacy_irq(new))
2535 continue; 2539 continue;
2536 cfg_new = irq_cfg(new); 2540 cfg_new = irq_cfg(new);
@@ -2545,12 +2549,24 @@ int create_irq(void)
2545 } 2549 }
2546 spin_unlock_irqrestore(&vector_lock, flags); 2550 spin_unlock_irqrestore(&vector_lock, flags);
2547 2551
2548 if (irq >= 0) { 2552 if (irq > 0) {
2549 dynamic_irq_init(irq); 2553 dynamic_irq_init(irq);
2550 } 2554 }
2551 return irq; 2555 return irq;
2552} 2556}
2553 2557
2558int create_irq(void)
2559{
2560 int irq;
2561
2562 irq = create_irq_nr(nr_irqs - 1);
2563
2564 if (irq == 0)
2565 irq = -1;
2566
2567 return irq;
2568}
2569
2554void destroy_irq(unsigned int irq) 2570void destroy_irq(unsigned int irq)
2555{ 2571{
2556 unsigned long flags; 2572 unsigned long flags;
@@ -2803,13 +2819,29 @@ static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc, int irq)
2803 return 0; 2819 return 0;
2804} 2820}
2805 2821
2822static unsigned int build_irq_for_pci_dev(struct pci_dev *dev)
2823{
2824 unsigned int irq;
2825
2826 irq = dev->bus->number;
2827 irq <<= 8;
2828 irq |= dev->devfn;
2829 irq <<= 12;
2830
2831 return irq;
2832}
2833
2806int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) 2834int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
2807{ 2835{
2808 int irq, ret; 2836 unsigned int irq;
2837 int ret;
2838 unsigned int irq_want;
2809 2839
2810 irq = create_irq(); 2840 irq_want = build_irq_for_pci_dev(dev) + 0x100;
2811 if (irq < 0) 2841
2812 return irq; 2842 irq = create_irq_nr(irq_want);
2843 if (irq == 0)
2844 return -1;
2813 2845
2814#ifdef CONFIG_INTR_REMAP 2846#ifdef CONFIG_INTR_REMAP
2815 if (!intr_remapping_enabled) 2847 if (!intr_remapping_enabled)
@@ -2836,18 +2868,22 @@ error:
2836 2868
2837int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) 2869int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
2838{ 2870{
2839 int irq, ret, sub_handle; 2871 unsigned int irq;
2872 int ret, sub_handle;
2840 struct msi_desc *desc; 2873 struct msi_desc *desc;
2874 unsigned int irq_want;
2875
2841#ifdef CONFIG_INTR_REMAP 2876#ifdef CONFIG_INTR_REMAP
2842 struct intel_iommu *iommu = 0; 2877 struct intel_iommu *iommu = 0;
2843 int index = 0; 2878 int index = 0;
2844#endif 2879#endif
2845 2880
2881 irq_want = build_irq_for_pci_dev(dev) + 0x100;
2846 sub_handle = 0; 2882 sub_handle = 0;
2847 list_for_each_entry(desc, &dev->msi_list, list) { 2883 list_for_each_entry(desc, &dev->msi_list, list) {
2848 irq = create_irq(); 2884 irq = create_irq_nr(irq_want--);
2849 if (irq < 0) 2885 if (irq == 0)
2850 return irq; 2886 return -1;
2851#ifdef CONFIG_INTR_REMAP 2887#ifdef CONFIG_INTR_REMAP
2852 if (!intr_remapping_enabled) 2888 if (!intr_remapping_enabled)
2853 goto no_ir; 2889 goto no_ir;
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index 7bd841a9c640..348a11168c2b 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -112,7 +112,7 @@ int show_interrupts(struct seq_file *p, void *v)
112 action = desc->action; 112 action = desc->action;
113 if (!action && !any_count) 113 if (!action && !any_count)
114 goto skip; 114 goto skip;
115 seq_printf(p, "%3d: ",i); 115 seq_printf(p, "%#x: ",i);
116#ifndef CONFIG_SMP 116#ifndef CONFIG_SMP
117 seq_printf(p, "%10u ", kstat_irqs(i)); 117 seq_printf(p, "%10u ", kstat_irqs(i));
118#else 118#else