aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2011-01-22 06:32:20 -0500
committerDavid S. Miller <davem@davemloft.net>2011-03-16 21:19:03 -0400
commit44ed3c0c47906297924c3fde801dc160f6996f7c (patch)
treef11b2de6fd33842c7aadd8cafdfbd136b56bfed6 /arch/sparc
parentfe41493f749797f516deb84ba07747fb7d8c04c1 (diff)
sparc64: rename virt_irq => irq - II
The generic irq support uses the term 'irq' for the allocated irq number. Fix it so sparc64 use the same term for an irq as the generic irq support does. For a naive reader this is less confusing. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/irq_64.h18
-rw-r--r--arch/sparc/kernel/pci.c10
-rw-r--r--arch/sparc/kernel/pci_fire.c8
-rw-r--r--arch/sparc/kernel/pci_impl.h4
-rw-r--r--arch/sparc/kernel/pci_msi.c44
-rw-r--r--arch/sparc/kernel/pci_sun4v.c6
-rw-r--r--arch/sparc/kernel/prom_irqtrans.c16
7 files changed, 53 insertions, 53 deletions
diff --git a/arch/sparc/include/asm/irq_64.h b/arch/sparc/include/asm/irq_64.h
index a0b443cb3c1f..4f09666f0798 100644
--- a/arch/sparc/include/asm/irq_64.h
+++ b/arch/sparc/include/asm/irq_64.h
@@ -33,34 +33,34 @@
33 33
34/* The largest number of unique interrupt sources we support. 34/* The largest number of unique interrupt sources we support.
35 * If this needs to ever be larger than 255, you need to change 35 * If this needs to ever be larger than 255, you need to change
36 * the type of ino_bucket->virt_irq as appropriate. 36 * the type of ino_bucket->irq as appropriate.
37 * 37 *
38 * ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq(). 38 * ino_bucket->irq allocation is made during {sun4v_,}build_irq().
39 */ 39 */
40#define NR_IRQS 255 40#define NR_IRQS 255
41 41
42extern void irq_install_pre_handler(int virt_irq, 42extern void irq_install_pre_handler(int irq,
43 void (*func)(unsigned int, void *, void *), 43 void (*func)(unsigned int, void *, void *),
44 void *arg1, void *arg2); 44 void *arg1, void *arg2);
45#define irq_canonicalize(irq) (irq) 45#define irq_canonicalize(irq) (irq)
46extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); 46extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
47extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); 47extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
48extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); 48extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino);
49extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, 49extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p,
50 unsigned int msi_devino_start, 50 unsigned int msi_devino_start,
51 unsigned int msi_devino_end); 51 unsigned int msi_devino_end);
52extern void sun4v_destroy_msi(unsigned int virt_irq); 52extern void sun4v_destroy_msi(unsigned int irq);
53extern unsigned int sun4u_build_msi(u32 portid, unsigned int *virt_irq_p, 53extern unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p,
54 unsigned int msi_devino_start, 54 unsigned int msi_devino_start,
55 unsigned int msi_devino_end, 55 unsigned int msi_devino_end,
56 unsigned long imap_base, 56 unsigned long imap_base,
57 unsigned long iclr_base); 57 unsigned long iclr_base);
58extern void sun4u_destroy_msi(unsigned int virt_irq); 58extern void sun4u_destroy_msi(unsigned int irq);
59 59
60extern unsigned char virt_irq_alloc(unsigned int dev_handle, 60extern unsigned char irq_alloc(unsigned int dev_handle,
61 unsigned int dev_ino); 61 unsigned int dev_ino);
62#ifdef CONFIG_PCI_MSI 62#ifdef CONFIG_PCI_MSI
63extern void virt_irq_free(unsigned int virt_irq); 63extern void irq_free(unsigned int irq);
64#endif 64#endif
65 65
66extern void __init init_IRQ(void); 66extern void __init init_IRQ(void);
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index 4137579d9adc..bfede51c3afc 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -1001,22 +1001,22 @@ EXPORT_SYMBOL(pci_domain_nr);
1001int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) 1001int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
1002{ 1002{
1003 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; 1003 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
1004 unsigned int virt_irq; 1004 unsigned int irq;
1005 1005
1006 if (!pbm->setup_msi_irq) 1006 if (!pbm->setup_msi_irq)
1007 return -EINVAL; 1007 return -EINVAL;
1008 1008
1009 return pbm->setup_msi_irq(&virt_irq, pdev, desc); 1009 return pbm->setup_msi_irq(&irq, pdev, desc);
1010} 1010}
1011 1011
1012void arch_teardown_msi_irq(unsigned int virt_irq) 1012void arch_teardown_msi_irq(unsigned int irq)
1013{ 1013{
1014 struct msi_desc *entry = get_irq_msi(virt_irq); 1014 struct msi_desc *entry = get_irq_msi(irq);
1015 struct pci_dev *pdev = entry->dev; 1015 struct pci_dev *pdev = entry->dev;
1016 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; 1016 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
1017 1017
1018 if (pbm->teardown_msi_irq) 1018 if (pbm->teardown_msi_irq)
1019 pbm->teardown_msi_irq(virt_irq, pdev); 1019 pbm->teardown_msi_irq(irq, pdev);
1020} 1020}
1021#endif /* !(CONFIG_PCI_MSI) */ 1021#endif /* !(CONFIG_PCI_MSI) */
1022 1022
diff --git a/arch/sparc/kernel/pci_fire.c b/arch/sparc/kernel/pci_fire.c
index be5e2441c6d7..43d691b67d52 100644
--- a/arch/sparc/kernel/pci_fire.c
+++ b/arch/sparc/kernel/pci_fire.c
@@ -277,7 +277,7 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm,
277{ 277{
278 unsigned long cregs = (unsigned long) pbm->pbm_regs; 278 unsigned long cregs = (unsigned long) pbm->pbm_regs;
279 unsigned long imap_reg, iclr_reg, int_ctrlr; 279 unsigned long imap_reg, iclr_reg, int_ctrlr;
280 unsigned int virt_irq; 280 unsigned int irq;
281 int fixup; 281 int fixup;
282 u64 val; 282 u64 val;
283 283
@@ -293,14 +293,14 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm,
293 293
294 fixup = ((pbm->portid << 6) | devino) - int_ctrlr; 294 fixup = ((pbm->portid << 6) | devino) - int_ctrlr;
295 295
296 virt_irq = build_irq(fixup, iclr_reg, imap_reg); 296 irq = build_irq(fixup, iclr_reg, imap_reg);
297 if (!virt_irq) 297 if (!irq)
298 return -ENOMEM; 298 return -ENOMEM;
299 299
300 upa_writeq(EVENT_QUEUE_CONTROL_SET_EN, 300 upa_writeq(EVENT_QUEUE_CONTROL_SET_EN,
301 pbm->pbm_regs + EVENT_QUEUE_CONTROL_SET(msiqid)); 301 pbm->pbm_regs + EVENT_QUEUE_CONTROL_SET(msiqid));
302 302
303 return virt_irq; 303 return irq;
304} 304}
305 305
306static const struct sparc64_msiq_ops pci_fire_msiq_ops = { 306static const struct sparc64_msiq_ops pci_fire_msiq_ops = {
diff --git a/arch/sparc/kernel/pci_impl.h b/arch/sparc/kernel/pci_impl.h
index e20ed5f06e9c..6beb60df31d0 100644
--- a/arch/sparc/kernel/pci_impl.h
+++ b/arch/sparc/kernel/pci_impl.h
@@ -131,9 +131,9 @@ struct pci_pbm_info {
131 void *msi_queues; 131 void *msi_queues;
132 unsigned long *msi_bitmap; 132 unsigned long *msi_bitmap;
133 unsigned int *msi_irq_table; 133 unsigned int *msi_irq_table;
134 int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, 134 int (*setup_msi_irq)(unsigned int *irq_p, struct pci_dev *pdev,
135 struct msi_desc *entry); 135 struct msi_desc *entry);
136 void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); 136 void (*teardown_msi_irq)(unsigned int irq, struct pci_dev *pdev);
137 const struct sparc64_msiq_ops *msi_ops; 137 const struct sparc64_msiq_ops *msi_ops;
138#endif /* !(CONFIG_PCI_MSI) */ 138#endif /* !(CONFIG_PCI_MSI) */
139 139
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
index b210416ace7b..550e937720e7 100644
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -31,12 +31,12 @@ static irqreturn_t sparc64_msiq_interrupt(int irq, void *cookie)
31 err = ops->dequeue_msi(pbm, msiqid, &head, &msi); 31 err = ops->dequeue_msi(pbm, msiqid, &head, &msi);
32 if (likely(err > 0)) { 32 if (likely(err > 0)) {
33 struct irq_desc *desc; 33 struct irq_desc *desc;
34 unsigned int virt_irq; 34 unsigned int irq;
35 35
36 virt_irq = pbm->msi_irq_table[msi - pbm->msi_first]; 36 irq = pbm->msi_irq_table[msi - pbm->msi_first];
37 desc = irq_desc + virt_irq; 37 desc = irq_desc + irq;
38 38
39 desc->handle_irq(virt_irq, desc); 39 desc->handle_irq(irq, desc);
40 } 40 }
41 41
42 if (unlikely(err < 0)) 42 if (unlikely(err < 0))
@@ -121,7 +121,7 @@ static struct irq_chip msi_irq = {
121 /* XXX affinity XXX */ 121 /* XXX affinity XXX */
122}; 122};
123 123
124static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, 124static int sparc64_setup_msi_irq(unsigned int *irq_p,
125 struct pci_dev *pdev, 125 struct pci_dev *pdev,
126 struct msi_desc *entry) 126 struct msi_desc *entry)
127{ 127{
@@ -131,17 +131,17 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
131 int msi, err; 131 int msi, err;
132 u32 msiqid; 132 u32 msiqid;
133 133
134 *virt_irq_p = virt_irq_alloc(0, 0); 134 *irq_p = irq_alloc(0, 0);
135 err = -ENOMEM; 135 err = -ENOMEM;
136 if (!*virt_irq_p) 136 if (!*irq_p)
137 goto out_err; 137 goto out_err;
138 138
139 set_irq_chip_and_handler_name(*virt_irq_p, &msi_irq, 139 set_irq_chip_and_handler_name(*irq_p, &msi_irq,
140 handle_simple_irq, "MSI"); 140 handle_simple_irq, "MSI");
141 141
142 err = alloc_msi(pbm); 142 err = alloc_msi(pbm);
143 if (unlikely(err < 0)) 143 if (unlikely(err < 0))
144 goto out_virt_irq_free; 144 goto out_irq_free;
145 145
146 msi = err; 146 msi = err;
147 147
@@ -152,7 +152,7 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
152 if (err) 152 if (err)
153 goto out_msi_free; 153 goto out_msi_free;
154 154
155 pbm->msi_irq_table[msi - pbm->msi_first] = *virt_irq_p; 155 pbm->msi_irq_table[msi - pbm->msi_first] = *irq_p;
156 156
157 if (entry->msi_attrib.is_64) { 157 if (entry->msi_attrib.is_64) {
158 msg.address_hi = pbm->msi64_start >> 32; 158 msg.address_hi = pbm->msi64_start >> 32;
@@ -163,24 +163,24 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
163 } 163 }
164 msg.data = msi; 164 msg.data = msi;
165 165
166 set_irq_msi(*virt_irq_p, entry); 166 set_irq_msi(*irq_p, entry);
167 write_msi_msg(*virt_irq_p, &msg); 167 write_msi_msg(*irq_p, &msg);
168 168
169 return 0; 169 return 0;
170 170
171out_msi_free: 171out_msi_free:
172 free_msi(pbm, msi); 172 free_msi(pbm, msi);
173 173
174out_virt_irq_free: 174out_irq_free:
175 set_irq_chip(*virt_irq_p, NULL); 175 set_irq_chip(*irq_p, NULL);
176 virt_irq_free(*virt_irq_p); 176 irq_free(*irq_p);
177 *virt_irq_p = 0; 177 *irq_p = 0;
178 178
179out_err: 179out_err:
180 return err; 180 return err;
181} 181}
182 182
183static void sparc64_teardown_msi_irq(unsigned int virt_irq, 183static void sparc64_teardown_msi_irq(unsigned int irq,
184 struct pci_dev *pdev) 184 struct pci_dev *pdev)
185{ 185{
186 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; 186 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
@@ -189,12 +189,12 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
189 int i, err; 189 int i, err;
190 190
191 for (i = 0; i < pbm->msi_num; i++) { 191 for (i = 0; i < pbm->msi_num; i++) {
192 if (pbm->msi_irq_table[i] == virt_irq) 192 if (pbm->msi_irq_table[i] == irq)
193 break; 193 break;
194 } 194 }
195 if (i >= pbm->msi_num) { 195 if (i >= pbm->msi_num) {
196 printk(KERN_ERR "%s: teardown: No MSI for irq %u\n", 196 printk(KERN_ERR "%s: teardown: No MSI for irq %u\n",
197 pbm->name, virt_irq); 197 pbm->name, irq);
198 return; 198 return;
199 } 199 }
200 200
@@ -205,14 +205,14 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
205 if (err) { 205 if (err) {
206 printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, " 206 printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, "
207 "irq %u, gives error %d\n", 207 "irq %u, gives error %d\n",
208 pbm->name, msi_num, virt_irq, err); 208 pbm->name, msi_num, irq, err);
209 return; 209 return;
210 } 210 }
211 211
212 free_msi(pbm, msi_num); 212 free_msi(pbm, msi_num);
213 213
214 set_irq_chip(virt_irq, NULL); 214 set_irq_chip(irq, NULL);
215 virt_irq_free(virt_irq); 215 irq_free(irq);
216} 216}
217 217
218static int msi_bitmap_alloc(struct pci_pbm_info *pbm) 218static int msi_bitmap_alloc(struct pci_pbm_info *pbm)
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 158cd739b263..629160772a9d 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -844,9 +844,9 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
844 unsigned long msiqid, 844 unsigned long msiqid,
845 unsigned long devino) 845 unsigned long devino)
846{ 846{
847 unsigned int virt_irq = sun4v_build_irq(pbm->devhandle, devino); 847 unsigned int irq = sun4v_build_irq(pbm->devhandle, devino);
848 848
849 if (!virt_irq) 849 if (!irq)
850 return -ENOMEM; 850 return -ENOMEM;
851 851
852 if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE)) 852 if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE))
@@ -854,7 +854,7 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
854 if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID)) 854 if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
855 return -EINVAL; 855 return -EINVAL;
856 856
857 return virt_irq; 857 return irq;
858} 858}
859 859
860static const struct sparc64_msiq_ops pci_sun4v_msiq_ops = { 860static const struct sparc64_msiq_ops pci_sun4v_msiq_ops = {
diff --git a/arch/sparc/kernel/prom_irqtrans.c b/arch/sparc/kernel/prom_irqtrans.c
index ce651147fabc..570b98f6e897 100644
--- a/arch/sparc/kernel/prom_irqtrans.c
+++ b/arch/sparc/kernel/prom_irqtrans.c
@@ -227,7 +227,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
227 unsigned long imap, iclr; 227 unsigned long imap, iclr;
228 unsigned long imap_off, iclr_off; 228 unsigned long imap_off, iclr_off;
229 int inofixup = 0; 229 int inofixup = 0;
230 int virt_irq; 230 int irq;
231 231
232 ino &= 0x3f; 232 ino &= 0x3f;
233 if (ino < SABRE_ONBOARD_IRQ_BASE) { 233 if (ino < SABRE_ONBOARD_IRQ_BASE) {
@@ -247,7 +247,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
247 if ((ino & 0x20) == 0) 247 if ((ino & 0x20) == 0)
248 inofixup = ino & 0x03; 248 inofixup = ino & 0x03;
249 249
250 virt_irq = build_irq(inofixup, iclr, imap); 250 irq = build_irq(inofixup, iclr, imap);
251 251
252 /* If the parent device is a PCI<->PCI bridge other than 252 /* If the parent device is a PCI<->PCI bridge other than
253 * APB, we have to install a pre-handler to ensure that 253 * APB, we have to install a pre-handler to ensure that
@@ -256,13 +256,13 @@ static unsigned int sabre_irq_build(struct device_node *dp,
256 */ 256 */
257 regs = of_get_property(dp, "reg", NULL); 257 regs = of_get_property(dp, "reg", NULL);
258 if (regs && sabre_device_needs_wsync(dp)) { 258 if (regs && sabre_device_needs_wsync(dp)) {
259 irq_install_pre_handler(virt_irq, 259 irq_install_pre_handler(irq,
260 sabre_wsync_handler, 260 sabre_wsync_handler,
261 (void *) (long) regs->phys_hi, 261 (void *) (long) regs->phys_hi,
262 (void *) irq_data); 262 (void *) irq_data);
263 } 263 }
264 264
265 return virt_irq; 265 return irq;
266} 266}
267 267
268static void __init sabre_irq_trans_init(struct device_node *dp) 268static void __init sabre_irq_trans_init(struct device_node *dp)
@@ -382,7 +382,7 @@ static unsigned int schizo_irq_build(struct device_node *dp,
382 unsigned long pbm_regs = irq_data->pbm_regs; 382 unsigned long pbm_regs = irq_data->pbm_regs;
383 unsigned long imap, iclr; 383 unsigned long imap, iclr;
384 int ign_fixup; 384 int ign_fixup;
385 int virt_irq; 385 int irq;
386 int is_tomatillo; 386 int is_tomatillo;
387 387
388 ino &= 0x3f; 388 ino &= 0x3f;
@@ -409,17 +409,17 @@ static unsigned int schizo_irq_build(struct device_node *dp,
409 ign_fixup = (1 << 6); 409 ign_fixup = (1 << 6);
410 } 410 }
411 411
412 virt_irq = build_irq(ign_fixup, iclr, imap); 412 irq = build_irq(ign_fixup, iclr, imap);
413 413
414 if (is_tomatillo) { 414 if (is_tomatillo) {
415 irq_install_pre_handler(virt_irq, 415 irq_install_pre_handler(irq,
416 tomatillo_wsync_handler, 416 tomatillo_wsync_handler,
417 ((irq_data->chip_version <= 4) ? 417 ((irq_data->chip_version <= 4) ?
418 (void *) 1 : (void *) 0), 418 (void *) 1 : (void *) 0),
419 (void *) irq_data->sync_reg); 419 (void *) irq_data->sync_reg);
420 } 420 }
421 421
422 return virt_irq; 422 return irq;
423} 423}
424 424
425static void __init __schizo_irq_trans_init(struct device_node *dp, 425static void __init __schizo_irq_trans_init(struct device_node *dp,