diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-10-15 08:16:55 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-16 10:53:15 -0400 |
commit | 2cc21ef843d4fb7da122239b644a1f6f0aca60a6 (patch) | |
tree | 5d08e110164176c4011e42d4700ecd0050ad0ce9 /drivers | |
parent | c6b7674f323622d86316bf7951ad9cae1ce24642 (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')
-rw-r--r-- | drivers/char/random.c | 31 | ||||
-rw-r--r-- | drivers/pci/htirq.c | 19 | ||||
-rw-r--r-- | drivers/pci/intr_remapping.c | 75 |
3 files changed, 1 insertions, 124 deletions
diff --git a/drivers/char/random.c b/drivers/char/random.c index 60c9c7ee6b2c..9ce80213007b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -558,8 +558,6 @@ struct timer_rand_state { | |||
558 | unsigned dont_count_entropy:1; | 558 | unsigned dont_count_entropy:1; |
559 | }; | 559 | }; |
560 | 560 | ||
561 | #ifndef CONFIG_HAVE_SPARSE_IRQ | ||
562 | |||
563 | #ifdef CONFIG_HAVE_DYN_ARRAY | 561 | #ifdef CONFIG_HAVE_DYN_ARRAY |
564 | static struct timer_rand_state **irq_timer_state; | 562 | static struct timer_rand_state **irq_timer_state; |
565 | DEFINE_DYN_ARRAY(irq_timer_state, sizeof(struct timer_rand_state *), nr_irqs, PAGE_SIZE, NULL); | 563 | DEFINE_DYN_ARRAY(irq_timer_state, sizeof(struct timer_rand_state *), nr_irqs, PAGE_SIZE, NULL); |
@@ -583,33 +581,6 @@ static void set_timer_rand_state(unsigned int irq, struct timer_rand_state *stat | |||
583 | irq_timer_state[irq] = state; | 581 | irq_timer_state[irq] = state; |
584 | } | 582 | } |
585 | 583 | ||
586 | #else | ||
587 | |||
588 | static struct timer_rand_state *get_timer_rand_state(unsigned int irq) | ||
589 | { | ||
590 | struct irq_desc *desc; | ||
591 | |||
592 | desc = irq_to_desc(irq); | ||
593 | |||
594 | if (!desc) | ||
595 | return NULL; | ||
596 | |||
597 | return desc->timer_rand_state; | ||
598 | } | ||
599 | |||
600 | static void set_timer_rand_state(unsigned int irq, struct timer_rand_state *state) | ||
601 | { | ||
602 | struct irq_desc *desc; | ||
603 | |||
604 | desc = irq_to_desc(irq); | ||
605 | |||
606 | if (!desc) | ||
607 | return; | ||
608 | |||
609 | desc->timer_rand_state = state; | ||
610 | } | ||
611 | #endif | ||
612 | |||
613 | static struct timer_rand_state input_timer_state; | 584 | static struct timer_rand_state input_timer_state; |
614 | 585 | ||
615 | /* | 586 | /* |
@@ -967,10 +938,8 @@ void rand_initialize_irq(int irq) | |||
967 | { | 938 | { |
968 | struct timer_rand_state *state; | 939 | struct timer_rand_state *state; |
969 | 940 | ||
970 | #ifndef CONFIG_HAVE_SPARSE_IRQ | ||
971 | if (irq >= nr_irqs) | 941 | if (irq >= nr_irqs) |
972 | return; | 942 | return; |
973 | #endif | ||
974 | 943 | ||
975 | state = get_timer_rand_state(irq); | 944 | state = get_timer_rand_state(irq); |
976 | 945 | ||
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 | ||
85 | static 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 | ||
23 | static struct irq_2_iommu *irq_2_iommuX; | ||
24 | /* fill one page ? */ | ||
25 | static int nr_irq_2_iommu = 0x100; | ||
26 | static int irq_2_iommu_index; | ||
27 | DEFINE_DYN_ARRAY(irq_2_iommuX, sizeof(struct irq_2_iommu), nr_irq_2_iommu, PAGE_SIZE, NULL); | ||
28 | |||
29 | extern void *__alloc_bootmem_nopanic(unsigned long size, | ||
30 | unsigned long align, | ||
31 | unsigned long goal); | ||
32 | |||
33 | static 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 | |||
63 | static 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 | |||
74 | static 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 |
95 | static struct irq_2_iommu *irq_2_iommuX; | 23 | static struct irq_2_iommu *irq_2_iommuX; |
96 | DEFINE_DYN_ARRAY(irq_2_iommuX, sizeof(struct irq_2_iommu), nr_irqs, PAGE_SIZE, NULL); | 24 | DEFINE_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 | ||
114 | static DEFINE_SPINLOCK(irq_2_ir_lock); | 41 | static 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. |