From: Jiang Liu <liuj97@gmail.com>
To: Greg KH <greg@kroah.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: Jiang Liu <jiang.liu@huawei.com>, Ingo Molnar <mingo@redhat.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Suresh Siddha <suresh.b.siddha@intel.com>,
Yinghai Lu <yinghai@kernel.org>,
Naga Chumbalkar <nagananda.chumbalkar@hp.com>,
Jacob Pan <jacob.jun.pan@linux.intel.com>,
Cliff Wickman <cpw@sgi.com>,
x86@kernel.org, linux-kernel@vger.kernel.org,
Jiang Liu <liuj97@gmail.com>, Keping Chen <chenkeping@huawei.com>
Subject: [PATCH v2 2/3] IRQ,x86: normalize return value of chip->irq_set_affinity() method
Date: Fri, 30 Mar 2012 00:44:52 +0800 [thread overview]
Message-ID: <1333039493-4090-2-git-send-email-jiang.liu@huawei.com> (raw)
In-Reply-To: <1333039493-4090-1-git-send-email-jiang.liu@huawei.com>
On x86 platforms, interrupt controller chip's irq_set_affinity() method
always copies affinity mask to irq_data->affinity field but still returns
0(IRQ_SET_MASK_OK). That return value causes the interrupt core logic
unnecessarily copies the mask to irq_data->affinity field again.
So return IRQ_SET_MASK_OK_NOCOPY instead of IRQ_SET_MASK_OK to get rid of
the duplicated copy operation.
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
---
arch/x86/kernel/apic/io_apic.c | 11 ++++++-----
arch/x86/platform/uv/uv_irq.c | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 6d10a66..092a715 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2346,6 +2346,7 @@ ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask,
/* Only the high 8 bits are valid. */
dest = SET_APIC_LOGICAL_ID(dest);
__target_IO_APIC_irq(irq, dest, data->chip_data);
+ ret = IRQ_SET_MASK_OK_NOCOPY;
}
raw_spin_unlock_irqrestore(&ioapic_lock, flags);
return ret;
@@ -2404,7 +2405,7 @@ ir_ioapic_set_affinity(struct irq_data *data, const struct cpumask *mask,
send_cleanup_vector(cfg);
cpumask_copy(data->affinity, mask);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
#else
@@ -3209,7 +3210,7 @@ msi_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force)
__write_msi_msg(data->msi_desc, &msg);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
#endif /* CONFIG_SMP */
@@ -3366,7 +3367,7 @@ dmar_msi_set_affinity(struct irq_data *data, const struct cpumask *mask,
dmar_msi_write(irq, &msg);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
#endif /* CONFIG_SMP */
@@ -3419,7 +3420,7 @@ static int hpet_msi_set_affinity(struct irq_data *data,
hpet_msi_write(data->handler_data, &msg);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
#endif /* CONFIG_SMP */
@@ -3499,7 +3500,7 @@ ht_set_affinity(struct irq_data *data, const struct cpumask *mask, bool force)
return -1;
target_ht_irq(data->irq, dest, cfg->vector);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
#endif
diff --git a/arch/x86/platform/uv/uv_irq.c b/arch/x86/platform/uv/uv_irq.c
index f25c276..a22c416 100644
--- a/arch/x86/platform/uv/uv_irq.c
+++ b/arch/x86/platform/uv/uv_irq.c
@@ -222,7 +222,7 @@ uv_set_irq_affinity(struct irq_data *data, const struct cpumask *mask,
if (cfg->move_in_progress)
send_cleanup_vector(cfg);
- return 0;
+ return IRQ_SET_MASK_OK_NOCOPY;
}
/*
--
1.7.5.4
next prev parent reply other threads:[~2012-03-29 16:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-29 16:44 [PATCH v2 1/3] IRQ: introduce irq_do_set_affinity() to reduce duplicated code Jiang Liu
2012-03-29 16:44 ` Jiang Liu [this message]
2012-03-29 16:44 ` [PATCH v2 3/3] IRQ,IA64: normalize return value of chip->irq_set_affinity() method Jiang Liu
2012-03-29 18:55 ` [PATCH v2 1/3] IRQ: introduce irq_do_set_affinity() to reduce duplicated code Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1333039493-4090-2-git-send-email-jiang.liu@huawei.com \
--to=liuj97@gmail.com \
--cc=chenkeping@huawei.com \
--cc=cpw@sgi.com \
--cc=greg@kroah.com \
--cc=hpa@zytor.com \
--cc=jacob.jun.pan@linux.intel.com \
--cc=jiang.liu@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nagananda.chumbalkar@hp.com \
--cc=suresh.b.siddha@intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®