Skip to content

Commit

Permalink
sparc64: use up-to-data genirq functions
Browse files Browse the repository at this point in the history
Drop all uses of deprecated genirq features.

The irq_set_affinity() call got a third paramter 'force'
which is unused.
For now genirq does not use this paramter and it is
ignored by sparc.

Signed-off-by: Sam Ravnborg <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Josip Rodin <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
sravnborg authored and davem330 committed Mar 17, 2011
1 parent e6ebd52 commit 4832b99
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 59 deletions.
1 change: 1 addition & 0 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ config SPARC64
select HAVE_PERF_EVENTS
select PERF_USE_VMALLOC
select HAVE_GENERIC_HARDIRQS
select GENERIC_HARDIRQS_NO_DEPRECATED

config ARCH_DEFCONFIG
string
Expand Down
119 changes: 60 additions & 59 deletions arch/sparc/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,16 +275,15 @@ static int irq_choose_cpu(unsigned int virt_irq, const struct cpumask *affinity)
real_hard_smp_processor_id()
#endif

static void sun4u_irq_enable(unsigned int virt_irq)
static void sun4u_irq_enable(struct irq_data *data)
{
struct irq_handler_data *handler_data = get_irq_data(virt_irq);
struct irq_handler_data *handler_data = data->handler_data;

if (likely(handler_data)) {
unsigned long cpuid, imap, val;
unsigned int tid;

cpuid = irq_choose_cpu(virt_irq,
irq_desc[virt_irq].irq_data.affinity);
cpuid = irq_choose_cpu(data->irq, data->affinity);
imap = handler_data->imap;

tid = sun4u_compute_tid(imap, cpuid);
Expand All @@ -298,16 +297,16 @@ static void sun4u_irq_enable(unsigned int virt_irq)
}
}

static int sun4u_set_affinity(unsigned int virt_irq,
const struct cpumask *mask)
static int sun4u_set_affinity(struct irq_data *data,
const struct cpumask *mask, bool force)
{
struct irq_handler_data *handler_data = get_irq_data(virt_irq);
struct irq_handler_data *handler_data = data->handler_data;

if (likely(handler_data)) {
unsigned long cpuid, imap, val;
unsigned int tid;

cpuid = irq_choose_cpu(virt_irq, mask);
cpuid = irq_choose_cpu(data->irq, mask);
imap = handler_data->imap;

tid = sun4u_compute_tid(imap, cpuid);
Expand Down Expand Up @@ -340,14 +339,14 @@ static int sun4u_set_affinity(unsigned int virt_irq,
* sees that, it also hooks up a default ->shutdown method which
* invokes ->mask() which we do not want. See irq_chip_set_defaults().
*/
static void sun4u_irq_disable(unsigned int virt_irq)
static void sun4u_irq_disable(struct irq_data *data)
{
}

static void sun4u_irq_eoi(unsigned int virt_irq)
static void sun4u_irq_eoi(struct irq_data *data)
{
struct irq_handler_data *handler_data = get_irq_data(virt_irq);
struct irq_desc *desc = irq_desc + virt_irq;
struct irq_handler_data *handler_data = data->handler_data;
struct irq_desc *desc = irq_desc + data->irq;

if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
return;
Expand All @@ -356,11 +355,10 @@ static void sun4u_irq_eoi(unsigned int virt_irq)
upa_writeq(ICLR_IDLE, handler_data->iclr);
}

static void sun4v_irq_enable(unsigned int virt_irq)
static void sun4v_irq_enable(struct irq_data *data)
{
unsigned int ino = virt_irq_table[virt_irq].dev_ino;
unsigned long cpuid = irq_choose_cpu(virt_irq,
irq_desc[virt_irq].irq_data.affinity);
unsigned int ino = virt_irq_table[data->irq].dev_ino;
unsigned long cpuid = irq_choose_cpu(data->irq, data->affinity);
int err;

err = sun4v_intr_settarget(ino, cpuid);
Expand All @@ -377,11 +375,11 @@ static void sun4v_irq_enable(unsigned int virt_irq)
ino, err);
}

static int sun4v_set_affinity(unsigned int virt_irq,
const struct cpumask *mask)
static int sun4v_set_affinity(struct irq_data *data,
const struct cpumask *mask, bool force)
{
unsigned int ino = virt_irq_table[virt_irq].dev_ino;
unsigned long cpuid = irq_choose_cpu(virt_irq, mask);
unsigned int ino = virt_irq_table[data->irq].dev_ino;
unsigned long cpuid = irq_choose_cpu(data->irq, mask);
int err;

err = sun4v_intr_settarget(ino, cpuid);
Expand All @@ -392,9 +390,9 @@ static int sun4v_set_affinity(unsigned int virt_irq,
return 0;
}

static void sun4v_irq_disable(unsigned int virt_irq)
static void sun4v_irq_disable(struct irq_data *data)
{
unsigned int ino = virt_irq_table[virt_irq].dev_ino;
unsigned int ino = virt_irq_table[data->irq].dev_ino;
int err;

err = sun4v_intr_setenabled(ino, HV_INTR_DISABLED);
Expand All @@ -403,10 +401,10 @@ static void sun4v_irq_disable(unsigned int virt_irq)
"err(%d)\n", ino, err);
}

static void sun4v_irq_eoi(unsigned int virt_irq)
static void sun4v_irq_eoi(struct irq_data *data)
{
unsigned int ino = virt_irq_table[virt_irq].dev_ino;
struct irq_desc *desc = irq_desc + virt_irq;
unsigned int ino = virt_irq_table[data->irq].dev_ino;
struct irq_desc *desc = irq_desc + data->irq;
int err;

if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
Expand All @@ -418,15 +416,15 @@ static void sun4v_irq_eoi(unsigned int virt_irq)
"err(%d)\n", ino, err);
}

static void sun4v_virq_enable(unsigned int virt_irq)
static void sun4v_virq_enable(struct irq_data *data)
{
unsigned long cpuid, dev_handle, dev_ino;
int err;

cpuid = irq_choose_cpu(virt_irq, irq_desc[virt_irq].irq_data.affinity);
cpuid = irq_choose_cpu(data->irq, data->affinity);

dev_handle = virt_irq_table[virt_irq].dev_handle;
dev_ino = virt_irq_table[virt_irq].dev_ino;
dev_handle = virt_irq_table[data->irq].dev_handle;
dev_ino = virt_irq_table[data->irq].dev_ino;

err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid);
if (err != HV_EOK)
Expand All @@ -447,16 +445,16 @@ static void sun4v_virq_enable(unsigned int virt_irq)
dev_handle, dev_ino, err);
}

static int sun4v_virt_set_affinity(unsigned int virt_irq,
const struct cpumask *mask)
static int sun4v_virt_set_affinity(struct irq_data *data,
const struct cpumask *mask, bool force)
{
unsigned long cpuid, dev_handle, dev_ino;
int err;

cpuid = irq_choose_cpu(virt_irq, mask);
cpuid = irq_choose_cpu(data->irq, mask);

dev_handle = virt_irq_table[virt_irq].dev_handle;
dev_ino = virt_irq_table[virt_irq].dev_ino;
dev_handle = virt_irq_table[data->irq].dev_handle;
dev_ino = virt_irq_table[data->irq].dev_ino;

err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid);
if (err != HV_EOK)
Expand All @@ -467,13 +465,13 @@ static int sun4v_virt_set_affinity(unsigned int virt_irq,
return 0;
}

static void sun4v_virq_disable(unsigned int virt_irq)
static void sun4v_virq_disable(struct irq_data *data)
{
unsigned long dev_handle, dev_ino;
int err;

dev_handle = virt_irq_table[virt_irq].dev_handle;
dev_ino = virt_irq_table[virt_irq].dev_ino;
dev_handle = virt_irq_table[data->irq].dev_handle;
dev_ino = virt_irq_table[data->irq].dev_ino;

err = sun4v_vintr_set_valid(dev_handle, dev_ino,
HV_INTR_DISABLED);
Expand All @@ -483,17 +481,17 @@ static void sun4v_virq_disable(unsigned int virt_irq)
dev_handle, dev_ino, err);
}

static void sun4v_virq_eoi(unsigned int virt_irq)
static void sun4v_virq_eoi(struct irq_data *data)
{
struct irq_desc *desc = irq_desc + virt_irq;
struct irq_desc *desc = irq_desc + data->irq;
unsigned long dev_handle, dev_ino;
int err;

if (unlikely(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS)))
return;

dev_handle = virt_irq_table[virt_irq].dev_handle;
dev_ino = virt_irq_table[virt_irq].dev_ino;
dev_handle = virt_irq_table[data->irq].dev_handle;
dev_ino = virt_irq_table[data->irq].dev_ino;

err = sun4v_vintr_set_state(dev_handle, dev_ino,
HV_INTR_STATE_IDLE);
Expand All @@ -504,27 +502,27 @@ static void sun4v_virq_eoi(unsigned int virt_irq)
}

static struct irq_chip sun4u_irq = {
.name = "sun4u",
.enable = sun4u_irq_enable,
.disable = sun4u_irq_disable,
.eoi = sun4u_irq_eoi,
.set_affinity = sun4u_set_affinity,
.name = "sun4u",
.irq_enable = sun4u_irq_enable,
.irq_disable = sun4u_irq_disable,
.irq_eoi = sun4u_irq_eoi,
.irq_set_affinity = sun4u_set_affinity,
};

static struct irq_chip sun4v_irq = {
.name = "sun4v",
.enable = sun4v_irq_enable,
.disable = sun4v_irq_disable,
.eoi = sun4v_irq_eoi,
.set_affinity = sun4v_set_affinity,
.name = "sun4v",
.irq_enable = sun4v_irq_enable,
.irq_disable = sun4v_irq_disable,
.irq_eoi = sun4v_irq_eoi,
.irq_set_affinity = sun4v_set_affinity,
};

static struct irq_chip sun4v_virq = {
.name = "vsun4v",
.enable = sun4v_virq_enable,
.disable = sun4v_virq_disable,
.eoi = sun4v_virq_eoi,
.set_affinity = sun4v_virt_set_affinity,
.name = "vsun4v",
.irq_enable = sun4v_virq_enable,
.irq_disable = sun4v_virq_disable,
.irq_eoi = sun4v_virq_eoi,
.irq_set_affinity = sun4v_virt_set_affinity,
};

static void pre_flow_handler(unsigned int virt_irq,
Expand Down Expand Up @@ -798,9 +796,12 @@ void fixup_irqs(void)
raw_spin_lock_irqsave(&irq_desc[irq].lock, flags);
if (irq_desc[irq].action &&
!(irq_desc[irq].status & IRQ_PER_CPU)) {
if (irq_desc[irq].irq_data.chip->set_affinity)
irq_desc[irq].irq_data.chip->set_affinity(irq,
irq_desc[irq].irq_data.affinity);
struct irq_data *data = irq_get_irq_data(irq);

if (data->chip->irq_set_affinity)
data->chip->irq_set_affinity(data,
data->affinity,
false);
}
raw_spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
}
Expand Down

0 comments on commit 4832b99

Please sign in to comment.