aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-10-15 08:16:55 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:53:15 -0400
commit2cc21ef843d4fb7da122239b644a1f6f0aca60a6 (patch)
tree5d08e110164176c4011e42d4700ecd0050ad0ce9 /drivers/pci
parentc6b7674f323622d86316bf7951ad9cae1ce24642 (diff)
genirq: remove sparse irq code
This code is not ready, but we need to rip it out instead of rebasing as we would lose the APIC/IO_APIC unification otherwise. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/htirq.c19
-rw-r--r--drivers/pci/intr_remapping.c75
2 files changed, 1 insertions, 93 deletions
diff --git a/drivers/pci/htirq.c b/drivers/pci/htirq.c
index 9e4929a00832..bf7d6ce9bbb3 100644
--- a/drivers/pci/htirq.c
+++ b/drivers/pci/htirq.c
@@ -82,18 +82,6 @@ void unmask_ht_irq(unsigned int irq)
82 write_ht_irq_msg(irq, &msg); 82 write_ht_irq_msg(irq, &msg);
83} 83}
84 84
85static unsigned int build_irq_for_pci_dev(struct pci_dev *dev)
86{
87 unsigned int irq;
88
89 irq = dev->bus->number;
90 irq <<= 8;
91 irq |= dev->devfn;
92 irq <<= 12;
93
94 return irq;
95}
96
97/** 85/**
98 * __ht_create_irq - create an irq and attach it to a device. 86 * __ht_create_irq - create an irq and attach it to a device.
99 * @dev: The hypertransport device to find the irq capability on. 87 * @dev: The hypertransport device to find the irq capability on.
@@ -110,7 +98,6 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update)
110 int max_irq; 98 int max_irq;
111 int pos; 99 int pos;
112 int irq; 100 int irq;
113 unsigned int irq_want;
114 101
115 pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ); 102 pos = pci_find_ht_capability(dev, HT_CAPTYPE_IRQ);
116 if (!pos) 103 if (!pos)
@@ -138,12 +125,8 @@ int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update)
138 cfg->msg.address_lo = 0xffffffff; 125 cfg->msg.address_lo = 0xffffffff;
139 cfg->msg.address_hi = 0xffffffff; 126 cfg->msg.address_hi = 0xffffffff;
140 127
141 irq_want= build_irq_for_pci_dev(dev);
142#ifdef CONFIG_HAVE_SPARSE_IRQ
143 irq = create_irq_nr(irq_want + idx);
144#else
145 irq = create_irq(); 128 irq = create_irq();
146#endif 129
147 if (irq <= 0) { 130 if (irq <= 0) {
148 kfree(cfg); 131 kfree(cfg);
149 return -EBUSY; 132 return -EBUSY;
diff --git a/drivers/pci/intr_remapping.c b/drivers/pci/intr_remapping.c
index 2dcf973890c4..0f43b265eee6 100644
--- a/drivers/pci/intr_remapping.c
+++ b/drivers/pci/intr_remapping.c
@@ -19,78 +19,6 @@ struct irq_2_iommu {
19 u8 irte_mask; 19 u8 irte_mask;
20}; 20};
21 21
22#ifdef CONFIG_HAVE_SPARSE_IRQ
23static struct irq_2_iommu *irq_2_iommuX;
24/* fill one page ? */
25static int nr_irq_2_iommu = 0x100;
26static int irq_2_iommu_index;
27DEFINE_DYN_ARRAY(irq_2_iommuX, sizeof(struct irq_2_iommu), nr_irq_2_iommu, PAGE_SIZE, NULL);
28
29extern void *__alloc_bootmem_nopanic(unsigned long size,
30 unsigned long align,
31 unsigned long goal);
32
33static struct irq_2_iommu *get_one_free_irq_2_iommu(int not_used)
34{
35 struct irq_2_iommu *iommu;
36 unsigned long total_bytes;
37
38 if (irq_2_iommu_index >= nr_irq_2_iommu) {
39 /*
40 * we run out of pre-allocate ones, allocate more
41 */
42 printk(KERN_DEBUG "try to get more irq_2_iommu %d\n", nr_irq_2_iommu);
43
44 total_bytes = sizeof(struct irq_2_iommu)*nr_irq_2_iommu;
45
46 if (after_bootmem)
47 iommu = kzalloc(total_bytes, GFP_ATOMIC);
48 else
49 iommu = __alloc_bootmem_nopanic(total_bytes, PAGE_SIZE, 0);
50
51 if (!iommu)
52 panic("can not get more irq_2_iommu\n");
53
54 irq_2_iommuX = iommu;
55 irq_2_iommu_index = 0;
56 }
57
58 iommu = &irq_2_iommuX[irq_2_iommu_index];
59 irq_2_iommu_index++;
60 return iommu;
61}
62
63static struct irq_2_iommu *irq_2_iommu(unsigned int irq)
64{
65 struct irq_desc *desc;
66
67 desc = irq_to_desc(irq);
68
69 BUG_ON(!desc);
70
71 return desc->irq_2_iommu;
72}
73
74static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
75{
76 struct irq_desc *desc;
77 struct irq_2_iommu *irq_iommu;
78
79 /*
80 * alloc irq desc if not allocated already.
81 */
82 desc = irq_to_desc_alloc(irq);
83
84 irq_iommu = desc->irq_2_iommu;
85
86 if (!irq_iommu)
87 desc->irq_2_iommu = get_one_free_irq_2_iommu(irq);
88
89 return desc->irq_2_iommu;
90}
91
92#else /* !CONFIG_HAVE_SPARSE_IRQ */
93
94#ifdef CONFIG_HAVE_DYN_ARRAY 22#ifdef CONFIG_HAVE_DYN_ARRAY
95static struct irq_2_iommu *irq_2_iommuX; 23static struct irq_2_iommu *irq_2_iommuX;
96DEFINE_DYN_ARRAY(irq_2_iommuX, sizeof(struct irq_2_iommu), nr_irqs, PAGE_SIZE, NULL); 24DEFINE_DYN_ARRAY(irq_2_iommuX, sizeof(struct irq_2_iommu), nr_irqs, PAGE_SIZE, NULL);
@@ -109,7 +37,6 @@ static struct irq_2_iommu *irq_2_iommu_alloc(unsigned int irq)
109{ 37{
110 return irq_2_iommu(irq); 38 return irq_2_iommu(irq);
111} 39}
112#endif
113 40
114static DEFINE_SPINLOCK(irq_2_ir_lock); 41static DEFINE_SPINLOCK(irq_2_ir_lock);
115 42
@@ -166,11 +93,9 @@ int alloc_irte(struct intel_iommu *iommu, int irq, u16 count)
166 if (!count) 93 if (!count)
167 return -1; 94 return -1;
168 95
169#ifndef CONFIG_HAVE_SPARSE_IRQ
170 /* protect irq_2_iommu_alloc later */ 96 /* protect irq_2_iommu_alloc later */
171 if (irq >= nr_irqs) 97 if (irq >= nr_irqs)
172 return -1; 98 return -1;
173#endif
174 99
175 /* 100 /*
176 * start the IRTE search from index 0. 101 * start the IRTE search from index 0.