Commit 44ed3c0c authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller

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: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe41493f
...@@ -33,34 +33,34 @@ ...@@ -33,34 +33,34 @@
/* The largest number of unique interrupt sources we support. /* The largest number of unique interrupt sources we support.
* If this needs to ever be larger than 255, you need to change * If this needs to ever be larger than 255, you need to change
* the type of ino_bucket->virt_irq as appropriate. * the type of ino_bucket->irq as appropriate.
* *
* ino_bucket->virt_irq allocation is made during {sun4v_,}build_irq(). * ino_bucket->irq allocation is made during {sun4v_,}build_irq().
*/ */
#define NR_IRQS 255 #define NR_IRQS 255
extern void irq_install_pre_handler(int virt_irq, extern void irq_install_pre_handler(int irq,
void (*func)(unsigned int, void *, void *), void (*func)(unsigned int, void *, void *),
void *arg1, void *arg2); void *arg1, void *arg2);
#define irq_canonicalize(irq) (irq) #define irq_canonicalize(irq) (irq)
extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap); extern unsigned int build_irq(int inofixup, unsigned long iclr, unsigned long imap);
extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino); extern unsigned int sun4v_build_irq(u32 devhandle, unsigned int devino);
extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino); extern unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino);
extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *virt_irq_p, extern unsigned int sun4v_build_msi(u32 devhandle, unsigned int *irq_p,
unsigned int msi_devino_start, unsigned int msi_devino_start,
unsigned int msi_devino_end); unsigned int msi_devino_end);
extern void sun4v_destroy_msi(unsigned int virt_irq); extern void sun4v_destroy_msi(unsigned int irq);
extern unsigned int sun4u_build_msi(u32 portid, unsigned int *virt_irq_p, extern unsigned int sun4u_build_msi(u32 portid, unsigned int *irq_p,
unsigned int msi_devino_start, unsigned int msi_devino_start,
unsigned int msi_devino_end, unsigned int msi_devino_end,
unsigned long imap_base, unsigned long imap_base,
unsigned long iclr_base); unsigned long iclr_base);
extern void sun4u_destroy_msi(unsigned int virt_irq); extern void sun4u_destroy_msi(unsigned int irq);
extern unsigned char virt_irq_alloc(unsigned int dev_handle, extern unsigned char irq_alloc(unsigned int dev_handle,
unsigned int dev_ino); unsigned int dev_ino);
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
extern void virt_irq_free(unsigned int virt_irq); extern void irq_free(unsigned int irq);
#endif #endif
extern void __init init_IRQ(void); extern void __init init_IRQ(void);
......
...@@ -1001,22 +1001,22 @@ EXPORT_SYMBOL(pci_domain_nr); ...@@ -1001,22 +1001,22 @@ EXPORT_SYMBOL(pci_domain_nr);
int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc) int arch_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *desc)
{ {
struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
unsigned int virt_irq; unsigned int irq;
if (!pbm->setup_msi_irq) if (!pbm->setup_msi_irq)
return -EINVAL; return -EINVAL;
return pbm->setup_msi_irq(&virt_irq, pdev, desc); return pbm->setup_msi_irq(&irq, pdev, desc);
} }
void arch_teardown_msi_irq(unsigned int virt_irq) void arch_teardown_msi_irq(unsigned int irq)
{ {
struct msi_desc *entry = get_irq_msi(virt_irq); struct msi_desc *entry = get_irq_msi(irq);
struct pci_dev *pdev = entry->dev; struct pci_dev *pdev = entry->dev;
struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
if (pbm->teardown_msi_irq) if (pbm->teardown_msi_irq)
pbm->teardown_msi_irq(virt_irq, pdev); pbm->teardown_msi_irq(irq, pdev);
} }
#endif /* !(CONFIG_PCI_MSI) */ #endif /* !(CONFIG_PCI_MSI) */
......
...@@ -277,7 +277,7 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm, ...@@ -277,7 +277,7 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm,
{ {
unsigned long cregs = (unsigned long) pbm->pbm_regs; unsigned long cregs = (unsigned long) pbm->pbm_regs;
unsigned long imap_reg, iclr_reg, int_ctrlr; unsigned long imap_reg, iclr_reg, int_ctrlr;
unsigned int virt_irq; unsigned int irq;
int fixup; int fixup;
u64 val; u64 val;
...@@ -293,14 +293,14 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm, ...@@ -293,14 +293,14 @@ static int pci_fire_msiq_build_irq(struct pci_pbm_info *pbm,
fixup = ((pbm->portid << 6) | devino) - int_ctrlr; fixup = ((pbm->portid << 6) | devino) - int_ctrlr;
virt_irq = build_irq(fixup, iclr_reg, imap_reg); irq = build_irq(fixup, iclr_reg, imap_reg);
if (!virt_irq) if (!irq)
return -ENOMEM; return -ENOMEM;
upa_writeq(EVENT_QUEUE_CONTROL_SET_EN, upa_writeq(EVENT_QUEUE_CONTROL_SET_EN,
pbm->pbm_regs + EVENT_QUEUE_CONTROL_SET(msiqid)); pbm->pbm_regs + EVENT_QUEUE_CONTROL_SET(msiqid));
return virt_irq; return irq;
} }
static const struct sparc64_msiq_ops pci_fire_msiq_ops = { static const struct sparc64_msiq_ops pci_fire_msiq_ops = {
......
...@@ -131,9 +131,9 @@ struct pci_pbm_info { ...@@ -131,9 +131,9 @@ struct pci_pbm_info {
void *msi_queues; void *msi_queues;
unsigned long *msi_bitmap; unsigned long *msi_bitmap;
unsigned int *msi_irq_table; unsigned int *msi_irq_table;
int (*setup_msi_irq)(unsigned int *virt_irq_p, struct pci_dev *pdev, int (*setup_msi_irq)(unsigned int *irq_p, struct pci_dev *pdev,
struct msi_desc *entry); struct msi_desc *entry);
void (*teardown_msi_irq)(unsigned int virt_irq, struct pci_dev *pdev); void (*teardown_msi_irq)(unsigned int irq, struct pci_dev *pdev);
const struct sparc64_msiq_ops *msi_ops; const struct sparc64_msiq_ops *msi_ops;
#endif /* !(CONFIG_PCI_MSI) */ #endif /* !(CONFIG_PCI_MSI) */
......
...@@ -31,12 +31,12 @@ static irqreturn_t sparc64_msiq_interrupt(int irq, void *cookie) ...@@ -31,12 +31,12 @@ static irqreturn_t sparc64_msiq_interrupt(int irq, void *cookie)
err = ops->dequeue_msi(pbm, msiqid, &head, &msi); err = ops->dequeue_msi(pbm, msiqid, &head, &msi);
if (likely(err > 0)) { if (likely(err > 0)) {
struct irq_desc *desc; struct irq_desc *desc;
unsigned int virt_irq; unsigned int irq;
virt_irq = pbm->msi_irq_table[msi - pbm->msi_first]; irq = pbm->msi_irq_table[msi - pbm->msi_first];
desc = irq_desc + virt_irq; desc = irq_desc + irq;
desc->handle_irq(virt_irq, desc); desc->handle_irq(irq, desc);
} }
if (unlikely(err < 0)) if (unlikely(err < 0))
...@@ -121,7 +121,7 @@ static struct irq_chip msi_irq = { ...@@ -121,7 +121,7 @@ static struct irq_chip msi_irq = {
/* XXX affinity XXX */ /* XXX affinity XXX */
}; };
static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, static int sparc64_setup_msi_irq(unsigned int *irq_p,
struct pci_dev *pdev, struct pci_dev *pdev,
struct msi_desc *entry) struct msi_desc *entry)
{ {
...@@ -131,17 +131,17 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, ...@@ -131,17 +131,17 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
int msi, err; int msi, err;
u32 msiqid; u32 msiqid;
*virt_irq_p = virt_irq_alloc(0, 0); *irq_p = irq_alloc(0, 0);
err = -ENOMEM; err = -ENOMEM;
if (!*virt_irq_p) if (!*irq_p)
goto out_err; goto out_err;
set_irq_chip_and_handler_name(*virt_irq_p, &msi_irq, set_irq_chip_and_handler_name(*irq_p, &msi_irq,
handle_simple_irq, "MSI"); handle_simple_irq, "MSI");
err = alloc_msi(pbm); err = alloc_msi(pbm);
if (unlikely(err < 0)) if (unlikely(err < 0))
goto out_virt_irq_free; goto out_irq_free;
msi = err; msi = err;
...@@ -152,7 +152,7 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, ...@@ -152,7 +152,7 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
if (err) if (err)
goto out_msi_free; goto out_msi_free;
pbm->msi_irq_table[msi - pbm->msi_first] = *virt_irq_p; pbm->msi_irq_table[msi - pbm->msi_first] = *irq_p;
if (entry->msi_attrib.is_64) { if (entry->msi_attrib.is_64) {
msg.address_hi = pbm->msi64_start >> 32; msg.address_hi = pbm->msi64_start >> 32;
...@@ -163,24 +163,24 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p, ...@@ -163,24 +163,24 @@ static int sparc64_setup_msi_irq(unsigned int *virt_irq_p,
} }
msg.data = msi; msg.data = msi;
set_irq_msi(*virt_irq_p, entry); set_irq_msi(*irq_p, entry);
write_msi_msg(*virt_irq_p, &msg); write_msi_msg(*irq_p, &msg);
return 0; return 0;
out_msi_free: out_msi_free:
free_msi(pbm, msi); free_msi(pbm, msi);
out_virt_irq_free: out_irq_free:
set_irq_chip(*virt_irq_p, NULL); set_irq_chip(*irq_p, NULL);
virt_irq_free(*virt_irq_p); irq_free(*irq_p);
*virt_irq_p = 0; *irq_p = 0;
out_err: out_err:
return err; return err;
} }
static void sparc64_teardown_msi_irq(unsigned int virt_irq, static void sparc64_teardown_msi_irq(unsigned int irq,
struct pci_dev *pdev) struct pci_dev *pdev)
{ {
struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; 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,12 +189,12 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
int i, err; int i, err;
for (i = 0; i < pbm->msi_num; i++) { for (i = 0; i < pbm->msi_num; i++) {
if (pbm->msi_irq_table[i] == virt_irq) if (pbm->msi_irq_table[i] == irq)
break; break;
} }
if (i >= pbm->msi_num) { if (i >= pbm->msi_num) {
printk(KERN_ERR "%s: teardown: No MSI for irq %u\n", printk(KERN_ERR "%s: teardown: No MSI for irq %u\n",
pbm->name, virt_irq); pbm->name, irq);
return; return;
} }
...@@ -205,14 +205,14 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq, ...@@ -205,14 +205,14 @@ static void sparc64_teardown_msi_irq(unsigned int virt_irq,
if (err) { if (err) {
printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, " printk(KERN_ERR "%s: teardown: ops->teardown() on MSI %u, "
"irq %u, gives error %d\n", "irq %u, gives error %d\n",
pbm->name, msi_num, virt_irq, err); pbm->name, msi_num, irq, err);
return; return;
} }
free_msi(pbm, msi_num); free_msi(pbm, msi_num);
set_irq_chip(virt_irq, NULL); set_irq_chip(irq, NULL);
virt_irq_free(virt_irq); irq_free(irq);
} }
static int msi_bitmap_alloc(struct pci_pbm_info *pbm) static int msi_bitmap_alloc(struct pci_pbm_info *pbm)
......
...@@ -844,9 +844,9 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm, ...@@ -844,9 +844,9 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
unsigned long msiqid, unsigned long msiqid,
unsigned long devino) unsigned long devino)
{ {
unsigned int virt_irq = sun4v_build_irq(pbm->devhandle, devino); unsigned int irq = sun4v_build_irq(pbm->devhandle, devino);
if (!virt_irq) if (!irq)
return -ENOMEM; return -ENOMEM;
if (pci_sun4v_msiq_setstate(pbm->devhandle, msiqid, HV_MSIQSTATE_IDLE)) 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,7 +854,7 @@ static int pci_sun4v_msiq_build_irq(struct pci_pbm_info *pbm,
if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID)) if (pci_sun4v_msiq_setvalid(pbm->devhandle, msiqid, HV_MSIQ_VALID))
return -EINVAL; return -EINVAL;
return virt_irq; return irq;
} }
static const struct sparc64_msiq_ops pci_sun4v_msiq_ops = { static const struct sparc64_msiq_ops pci_sun4v_msiq_ops = {
......
...@@ -227,7 +227,7 @@ static unsigned int sabre_irq_build(struct device_node *dp, ...@@ -227,7 +227,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
unsigned long imap, iclr; unsigned long imap, iclr;
unsigned long imap_off, iclr_off; unsigned long imap_off, iclr_off;
int inofixup = 0; int inofixup = 0;
int virt_irq; int irq;
ino &= 0x3f; ino &= 0x3f;
if (ino < SABRE_ONBOARD_IRQ_BASE) { if (ino < SABRE_ONBOARD_IRQ_BASE) {
...@@ -247,7 +247,7 @@ static unsigned int sabre_irq_build(struct device_node *dp, ...@@ -247,7 +247,7 @@ static unsigned int sabre_irq_build(struct device_node *dp,
if ((ino & 0x20) == 0) if ((ino & 0x20) == 0)
inofixup = ino & 0x03; inofixup = ino & 0x03;
virt_irq = build_irq(inofixup, iclr, imap); irq = build_irq(inofixup, iclr, imap);
/* If the parent device is a PCI<->PCI bridge other than /* If the parent device is a PCI<->PCI bridge other than
* APB, we have to install a pre-handler to ensure that * 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,13 +256,13 @@ static unsigned int sabre_irq_build(struct device_node *dp,
*/ */
regs = of_get_property(dp, "reg", NULL); regs = of_get_property(dp, "reg", NULL);
if (regs && sabre_device_needs_wsync(dp)) { if (regs && sabre_device_needs_wsync(dp)) {
irq_install_pre_handler(virt_irq, irq_install_pre_handler(irq,
sabre_wsync_handler, sabre_wsync_handler,
(void *) (long) regs->phys_hi, (void *) (long) regs->phys_hi,
(void *) irq_data); (void *) irq_data);
} }
return virt_irq; return irq;
} }
static void __init sabre_irq_trans_init(struct device_node *dp) static 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,7 +382,7 @@ static unsigned int schizo_irq_build(struct device_node *dp,
unsigned long pbm_regs = irq_data->pbm_regs; unsigned long pbm_regs = irq_data->pbm_regs;
unsigned long imap, iclr; unsigned long imap, iclr;
int ign_fixup; int ign_fixup;
int virt_irq; int irq;
int is_tomatillo; int is_tomatillo;
ino &= 0x3f; ino &= 0x3f;
...@@ -409,17 +409,17 @@ static unsigned int schizo_irq_build(struct device_node *dp, ...@@ -409,17 +409,17 @@ static unsigned int schizo_irq_build(struct device_node *dp,
ign_fixup = (1 << 6); ign_fixup = (1 << 6);
} }
virt_irq = build_irq(ign_fixup, iclr, imap); irq = build_irq(ign_fixup, iclr, imap);
if (is_tomatillo) { if (is_tomatillo) {
irq_install_pre_handler(virt_irq, irq_install_pre_handler(irq,
tomatillo_wsync_handler, tomatillo_wsync_handler,
((irq_data->chip_version <= 4) ? ((irq_data->chip_version <= 4) ?
(void *) 1 : (void *) 0), (void *) 1 : (void *) 0),
(void *) irq_data->sync_reg); (void *) irq_data->sync_reg);
} }
return virt_irq; return irq;
} }
static void __init __schizo_irq_trans_init(struct device_node *dp, static void __init __schizo_irq_trans_init(struct device_node *dp,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment