Commit b53bcb67 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Add ->set_affinity IRQ handlers.

dr-cpu unconfigure requests will walk throught he enabled
IRQs and trigger ->set_affinity so that the going-down
cpu no longer has INOs targetted to it.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bd0e11ff
...@@ -293,6 +293,11 @@ static void sun4u_irq_enable(unsigned int virt_irq) ...@@ -293,6 +293,11 @@ static void sun4u_irq_enable(unsigned int virt_irq)
} }
} }
static void sun4u_set_affinity(unsigned int virt_irq, cpumask_t mask)
{
sun4u_irq_enable(virt_irq);
}
static void sun4u_irq_disable(unsigned int virt_irq) static void sun4u_irq_disable(unsigned int virt_irq)
{ {
struct irq_handler_data *data = get_irq_chip_data(virt_irq); struct irq_handler_data *data = get_irq_chip_data(virt_irq);
...@@ -344,6 +349,24 @@ static void sun4v_irq_enable(unsigned int virt_irq) ...@@ -344,6 +349,24 @@ static void sun4v_irq_enable(unsigned int virt_irq)
} }
} }
static void sun4v_set_affinity(unsigned int virt_irq, cpumask_t mask)
{
struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq);
unsigned int ino = bucket - &ivector_table[0];
if (likely(bucket)) {
unsigned long cpuid;
int err;
cpuid = irq_choose_cpu(virt_irq);
err = sun4v_intr_settarget(ino, cpuid);
if (err != HV_EOK)
printk("sun4v_intr_settarget(%x,%lu): err(%d)\n",
ino, cpuid, err);
}
}
static void sun4v_irq_disable(unsigned int virt_irq) static void sun4v_irq_disable(unsigned int virt_irq)
{ {
struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq);
...@@ -426,6 +449,28 @@ static void sun4v_virq_enable(unsigned int virt_irq) ...@@ -426,6 +449,28 @@ static void sun4v_virq_enable(unsigned int virt_irq)
} }
} }
static void sun4v_virt_set_affinity(unsigned int virt_irq, cpumask_t mask)
{
struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq);
unsigned int ino = bucket - &ivector_table[0];
if (likely(bucket)) {
unsigned long cpuid, dev_handle, dev_ino;
int err;
cpuid = irq_choose_cpu(virt_irq);
dev_handle = ino & IMAP_IGN;
dev_ino = ino & IMAP_INO;
err = sun4v_vintr_set_target(dev_handle, dev_ino, cpuid);
if (err != HV_EOK)
printk("sun4v_vintr_set_target(%lx,%lx,%lu): "
"err(%d)\n",
dev_handle, dev_ino, cpuid, err);
}
}
static void sun4v_virq_disable(unsigned int virt_irq) static void sun4v_virq_disable(unsigned int virt_irq)
{ {
struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq); struct ino_bucket *bucket = virt_irq_to_bucket(virt_irq);
...@@ -489,6 +534,7 @@ static struct irq_chip sun4u_irq = { ...@@ -489,6 +534,7 @@ static struct irq_chip sun4u_irq = {
.enable = sun4u_irq_enable, .enable = sun4u_irq_enable,
.disable = sun4u_irq_disable, .disable = sun4u_irq_disable,
.end = sun4u_irq_end, .end = sun4u_irq_end,
.set_affinity = sun4u_set_affinity,
}; };
static struct irq_chip sun4u_irq_ack = { static struct irq_chip sun4u_irq_ack = {
...@@ -497,6 +543,7 @@ static struct irq_chip sun4u_irq_ack = { ...@@ -497,6 +543,7 @@ static struct irq_chip sun4u_irq_ack = {
.disable = sun4u_irq_disable, .disable = sun4u_irq_disable,
.ack = run_pre_handler, .ack = run_pre_handler,
.end = sun4u_irq_end, .end = sun4u_irq_end,
.set_affinity = sun4u_set_affinity,
}; };
static struct irq_chip sun4v_irq = { static struct irq_chip sun4v_irq = {
...@@ -504,6 +551,7 @@ static struct irq_chip sun4v_irq = { ...@@ -504,6 +551,7 @@ static struct irq_chip sun4v_irq = {
.enable = sun4v_irq_enable, .enable = sun4v_irq_enable,
.disable = sun4v_irq_disable, .disable = sun4v_irq_disable,
.end = sun4v_irq_end, .end = sun4v_irq_end,
.set_affinity = sun4v_set_affinity,
}; };
static struct irq_chip sun4v_irq_ack = { static struct irq_chip sun4v_irq_ack = {
...@@ -512,6 +560,7 @@ static struct irq_chip sun4v_irq_ack = { ...@@ -512,6 +560,7 @@ static struct irq_chip sun4v_irq_ack = {
.disable = sun4v_irq_disable, .disable = sun4v_irq_disable,
.ack = run_pre_handler, .ack = run_pre_handler,
.end = sun4v_irq_end, .end = sun4v_irq_end,
.set_affinity = sun4v_set_affinity,
}; };
#ifdef CONFIG_PCI_MSI #ifdef CONFIG_PCI_MSI
...@@ -523,6 +572,7 @@ static struct irq_chip sun4v_msi = { ...@@ -523,6 +572,7 @@ static struct irq_chip sun4v_msi = {
.disable = sun4v_msi_disable, .disable = sun4v_msi_disable,
.ack = run_pre_handler, .ack = run_pre_handler,
.end = sun4v_irq_end, .end = sun4v_irq_end,
.set_affinity = sun4v_set_affinity,
}; };
#endif #endif
...@@ -531,6 +581,7 @@ static struct irq_chip sun4v_virq = { ...@@ -531,6 +581,7 @@ static struct irq_chip sun4v_virq = {
.enable = sun4v_virq_enable, .enable = sun4v_virq_enable,
.disable = sun4v_virq_disable, .disable = sun4v_virq_disable,
.end = sun4v_virq_end, .end = sun4v_virq_end,
.set_affinity = sun4v_virt_set_affinity,
}; };
static struct irq_chip sun4v_virq_ack = { static struct irq_chip sun4v_virq_ack = {
...@@ -539,6 +590,7 @@ static struct irq_chip sun4v_virq_ack = { ...@@ -539,6 +590,7 @@ static struct irq_chip sun4v_virq_ack = {
.disable = sun4v_virq_disable, .disable = sun4v_virq_disable,
.ack = run_pre_handler, .ack = run_pre_handler,
.end = sun4v_virq_end, .end = sun4v_virq_end,
.set_affinity = sun4v_virt_set_affinity,
}; };
void irq_install_pre_handler(int virt_irq, void irq_install_pre_handler(int virt_irq,
......
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