From: Jiang Liu <jiang.liu@linux.intel.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Bjorn Helgaas <bhelgaas@google.com>,
Randy Dunlap <rdunlap@infradead.org>,
Yinghai Lu <yinghai@kernel.org>, Borislav Petkov <bp@alien8.de>,
Grant Likely <grant.likely@linaro.org>
Cc: Jiang Liu <jiang.liu@linux.intel.com>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Andrew Morton <akpm@linux-foundation.org>,
Tony Luck <tony.luck@intel.com>, Joerg Roedel <joro@8bytes.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: [RFC v1 06/28] x86, irq: Kill unused old IOAPIC irqdomain interfaces
Date: Fri, 26 Sep 2014 22:57:36 +0800 [thread overview]
Message-ID: <1411743478-31435-7-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <1411743478-31435-1-git-send-email-jiang.liu@linux.intel.com>
Now we have converted to hierarchy irqdomain, so kill unused old IOAPIC
irqdomain interfaces and code.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
arch/x86/include/asm/io_apic.h | 4 -
arch/x86/kernel/apic/io_apic.c | 199 ----------------------------------------
2 files changed, 203 deletions(-)
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h
index bc3bef8f1a4b..051011adff9b 100644
--- a/arch/x86/include/asm/io_apic.h
+++ b/arch/x86/include/asm/io_apic.h
@@ -204,9 +204,6 @@ extern int mp_register_ioapic(int id, u32 address, u32 gsi_base,
struct ioapic_domain_cfg *cfg);
extern int mp_unregister_ioapic(u32 gsi_base);
extern int mp_ioapic_registered(u32 gsi_base);
-extern int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq,
- irq_hw_number_t hwirq);
-extern void mp_irqdomain_unmap(struct irq_domain *domain, unsigned int virq);
extern int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
unsigned int nr_irqs, void *arg);
extern void mp_irqdomain_free(struct irq_domain *domain, unsigned int virq,
@@ -218,7 +215,6 @@ extern int mp_irqdomain_deactivate(struct irq_domain *domain,
extern int mp_irqdomain_ioapic_idx(struct irq_domain *domain);
extern void ioapic_set_alloc_attr(struct irq_alloc_info *info,
int node, int trigger, int polarity);
-extern int mp_set_gsi_attr(u32 gsi, int trigger, int polarity, int node);
extern void mp_save_irq(struct mpc_intsrc *m);
extern bool mp_should_keep_irq(struct device *dev);
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b87b69e3f3e2..b0121560f05d 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1288,30 +1288,6 @@ static inline int IO_APIC_irq_trigger(int irq)
}
#endif
-static void ioapic_register_intr(unsigned int irq, struct irq_cfg *cfg,
- unsigned long trigger)
-{
- struct irq_chip *chip = &ioapic_chip;
- irq_flow_handler_t hdl;
- bool fasteoi;
-
- if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
- trigger == IOAPIC_LEVEL) {
- irq_set_status_flags(irq, IRQ_LEVEL);
- fasteoi = true;
- } else {
- irq_clear_status_flags(irq, IRQ_LEVEL);
- fasteoi = false;
- }
-
- if (setup_remapped_irq(irq, cfg, chip))
- fasteoi = trigger != 0;
-
- hdl = fasteoi ? handle_fasteoi_irq : handle_edge_irq;
- irq_set_chip_and_handler_name(irq, chip, hdl,
- fasteoi ? "fasteoi" : "edge");
-}
-
int native_setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry,
unsigned int destination, int vector,
struct io_apic_irq_attr *attr)
@@ -1336,48 +1312,6 @@ int native_setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry,
return 0;
}
-static void setup_ioapic_irq(unsigned int irq, struct irq_cfg *cfg,
- struct io_apic_irq_attr *attr)
-{
- struct IO_APIC_route_entry entry;
- unsigned int dest;
-
- if (!IO_APIC_IRQ(irq))
- return;
-
- if (assign_irq_vector(irq, cfg, apic->target_cpus()))
- return;
-
- if (apic->cpu_mask_to_apicid_and(cfg->domain, apic->target_cpus(),
- &dest)) {
- pr_warn("Failed to obtain apicid for ioapic %d, pin %d\n",
- mpc_ioapic_id(attr->ioapic), attr->ioapic_pin);
- clear_irq_vector(irq, cfg);
-
- return;
- }
-
- apic_printk(APIC_VERBOSE,KERN_DEBUG
- "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
- "IRQ %d Mode:%i Active:%i Dest:%d)\n",
- attr->ioapic, mpc_ioapic_id(attr->ioapic), attr->ioapic_pin,
- cfg->vector, irq, attr->trigger, attr->polarity, dest);
-
- if (x86_io_apic_ops.setup_entry(irq, &entry, dest, cfg->vector, attr)) {
- pr_warn("Failed to setup ioapic entry for ioapic %d, pin %d\n",
- mpc_ioapic_id(attr->ioapic), attr->ioapic_pin);
- clear_irq_vector(irq, cfg);
-
- return;
- }
-
- ioapic_register_intr(irq, cfg, attr->trigger);
- if (irq < nr_legacy_irqs())
- legacy_pic->mask(irq);
-
- ioapic_write_entry(attr->ioapic, attr->ioapic_pin, entry);
-}
-
static void __init setup_IO_APIC_irqs(void)
{
unsigned int ioapic, pin;
@@ -1397,46 +1331,6 @@ static void __init setup_IO_APIC_irqs(void)
}
}
-/*
- * Set up the timer pin, possibly with the 8259A-master behind.
- */
-static void __init setup_timer_IRQ0_pin(unsigned int ioapic_idx,
- unsigned int pin, int vector)
-{
- struct IO_APIC_route_entry entry;
- unsigned int dest;
-
- memset(&entry, 0, sizeof(entry));
-
- /*
- * We use logical delivery to get the timer IRQ
- * to the first CPU.
- */
- if (unlikely(apic->cpu_mask_to_apicid_and(apic->target_cpus(),
- apic->target_cpus(), &dest)))
- dest = BAD_APICID;
-
- entry.dest_mode = apic->irq_dest_mode;
- entry.mask = 0; /* don't mask IRQ for edge */
- entry.dest = dest;
- entry.delivery_mode = apic->irq_delivery_mode;
- entry.polarity = 0;
- entry.trigger = 0;
- entry.vector = vector;
-
- /*
- * The timer IRQ doesn't have to know that behind the
- * scene we may have a 8259A-master in AEOI mode ...
- */
- irq_set_chip_and_handler_name(0, &ioapic_chip, handle_edge_irq,
- "edge");
-
- /*
- * Add it to the IO-APIC irq-routing table:
- */
- ioapic_write_entry(ioapic_idx, pin, entry);
-}
-
void native_io_apic_print_entries(unsigned int apic, unsigned int nr_entries)
{
int i;
@@ -2621,20 +2515,6 @@ static int __init ioapic_init_ops(void)
device_initcall(ioapic_init_ops);
-static int
-io_apic_setup_irq_pin(unsigned int irq, int node, struct io_apic_irq_attr *attr)
-{
- struct irq_cfg *cfg = alloc_irq_and_cfg_at(irq, node);
- int ret;
-
- if (!cfg)
- return -EINVAL;
- ret = __add_pin_to_irq_node(cfg, node, attr->ioapic, attr->ioapic_pin);
- if (!ret)
- setup_ioapic_irq(irq, cfg, attr);
- return ret;
-}
-
static int io_apic_get_redir_entries(int ioapic)
{
union IO_APIC_reg_01 reg_01;
@@ -3178,56 +3058,6 @@ static inline void set_io_apic_irq_attr(struct io_apic_irq_attr *irq_attr,
irq_attr->polarity = polarity;
}
-int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq,
- irq_hw_number_t hwirq)
-{
- int ioapic = mp_irqdomain_ioapic_idx(domain);
- struct mp_pin_info *info = mp_pin_info(ioapic, hwirq);
- struct io_apic_irq_attr attr;
-
- /* Get default attribute if not set by caller yet */
- if (!info->set) {
- u32 gsi = mp_pin_to_gsi(ioapic, hwirq);
-
- if (acpi_get_override_irq(gsi, &info->trigger,
- &info->polarity) < 0) {
- /*
- * PCI interrupts are always polarity one level
- * triggered.
- */
- info->trigger = 1;
- info->polarity = 1;
- }
- info->node = NUMA_NO_NODE;
-
- /*
- * setup_IO_APIC_irqs() programs all legacy IRQs with default
- * trigger and polarity attributes. Don't set the flag for that
- * case so the first legacy IRQ user could reprogram the pin
- * with real trigger and polarity attributes.
- */
- if (virq >= nr_legacy_irqs() || info->count)
- info->set = 1;
- }
- set_io_apic_irq_attr(&attr, ioapic, hwirq, info->trigger,
- info->polarity);
-
- return io_apic_setup_irq_pin(virq, info->node, &attr);
-}
-
-void mp_irqdomain_unmap(struct irq_domain *domain, unsigned int virq)
-{
- struct irq_data *data = irq_get_irq_data(virq);
- struct irq_cfg *cfg = irq_cfg(virq);
- int ioapic = mp_irqdomain_ioapic_idx(domain);
- int pin = (int)data->hwirq;
-
- ioapic_mask_entry(ioapic, pin);
- __remove_pin_from_irq(cfg, ioapic, pin);
- WARN_ON(!list_empty(&cfg->irq_2_pin));
- arch_teardown_hwirq(virq);
-}
-
static int mp_irqdomain_get_attr(int irq, u32 gsi, struct mp_pin_info *pinfo,
struct irq_alloc_info *info)
{
@@ -3418,35 +3248,6 @@ int mp_irqdomain_deactivate(struct irq_domain *domain,
return 0;
}
-int mp_set_gsi_attr(u32 gsi, int trigger, int polarity, int node)
-{
- int ret = 0;
- int ioapic, pin;
- struct mp_pin_info *info;
-
- ioapic = mp_find_ioapic(gsi);
- if (ioapic < 0)
- return -ENODEV;
-
- pin = mp_find_ioapic_pin(ioapic, gsi);
- info = mp_pin_info(ioapic, pin);
- trigger = trigger ? 1 : 0;
- polarity = polarity ? 1 : 0;
-
- mutex_lock(&ioapic_mutex);
- if (!info->set) {
- info->trigger = trigger;
- info->polarity = polarity;
- info->node = node;
- info->set = 1;
- } else if (info->trigger != trigger || info->polarity != polarity) {
- ret = -EBUSY;
- }
- mutex_unlock(&ioapic_mutex);
-
- return ret;
-}
-
bool mp_should_keep_irq(struct device *dev)
{
if (dev->power.is_prepared)
--
1.7.10.4
next prev parent reply other threads:[~2014-09-26 14:56 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 14:57 [RFC Part3 v1 00/28] Enable hierarchy irqdomian on x86 platforms Jiang Liu
2014-09-26 14:57 ` [RFC v1 01/28] x86, irq: Kill unused setup_timer_IRQ0_pin() Jiang Liu
2014-10-09 2:16 ` Jiang Liu
2014-09-26 14:57 ` [RFC v1 02/28] x86, irq: Prepare IOAPIC interfaces to support hierarchy irqdomain Jiang Liu
2014-09-26 14:57 ` [RFC v1 03/28] x86, irq: Implement callbacks to enable hierarchy irqdomain on IOAPICs Jiang Liu
2014-09-26 14:57 ` [RFC v1 04/28] x86, irq: Refine the way to allocate irq_cfg for legacy IRQs Jiang Liu
2014-09-26 14:57 ` [RFC v1 05/28] x86, irq: Convert IOAPIC to use hierarchy irqdomain interfaces Jiang Liu
2014-09-26 14:57 ` Jiang Liu [this message]
2014-09-26 14:57 ` [RFC v1 07/28] x86, irq: Kill x86_io_apic_ops.print_entries and related interfaces Jiang Liu
2014-09-26 14:57 ` [RFC v1 08/28] x86, irq: Kill x86_io_apic_ops.setup_entry " Jiang Liu
2014-09-26 14:57 ` [RFC v1 09/28] x86, irq: Kill x86_io_apic_ops.set_affinity " Jiang Liu
2014-09-26 14:57 ` [RFC v1 10/28] x86, irq: Kill x86_io_apic_ops.eoi_ioapic_pin " Jiang Liu
2014-09-26 14:57 ` [RFC v1 11/28] x86, irq: Kill GENERIC_IRQ_LEGACY_ALLOC_HWIRQ Jiang Liu
2014-09-26 14:57 ` [RFC v1 12/28] x86: Clean up unused forward declarations in x86_init.h Jiang Liu
2014-09-26 14:57 ` [RFC v1 13/28] x86: irq_remapping: Clean up unsued code Jiang Liu
2014-09-26 14:57 ` [RFC v1 14/28] iommu/vt-d: " Jiang Liu
2014-09-26 14:57 ` [RFC v1 15/28] iommu/amd: " Jiang Liu
2014-09-26 14:57 ` [RFC v1 16/28] x86: irq_remapping: Clean up unused interfaces Jiang Liu
2014-09-26 14:57 ` [RFC v1 17/28] x86, irq: Kill irq_cfg.irq_remapped Jiang Liu
2014-09-26 14:57 ` [RFC v1 18/28] iommu/vt-d: Move struct irq_2_iommu into intel_irq_remapping.c Jiang Liu
2014-09-26 14:57 ` [RFC v1 19/28] iommu/amd: Move struct irq_2_irte into amd_iommu.c Jiang Liu
2014-09-26 14:57 ` [RFC v1 20/28] x86, irq: Move irq_cfg.irq_2_pin into io_apic.c Jiang Liu
2014-09-26 14:57 ` [RFC v1 21/28] x86, irq: Kill struct io_apic_irq_attr Jiang Liu
2014-09-26 14:57 ` [RFC v1 22/28] x86, irq: Kill x86_io_apic_ops.write and x86_io_apic_ops.modify Jiang Liu
2014-09-26 14:57 ` [RFC v1 23/28] x86, irq: Clean up io_apic.h Jiang Liu
2014-09-26 14:57 ` [RFC v1 24/28] x86, irq: Kill unused alloc_irq_and_cfg_at() Jiang Liu
2014-09-26 14:57 ` [RFC v1 25/28] x86, irq: Change functions only used in vector.c as static Jiang Liu
2014-09-26 14:57 ` [RFC v1 26/28] x86, irq: Kill function apic_set_affinity() Jiang Liu
2014-09-26 14:57 ` [RFC v1 27/28] x86, irq: Introduce mechanism to support different vector allocation policies Jiang Liu
2014-09-26 14:57 ` [RFC v1 28/28] x86, irq: Add kernel parameter vector_alloc to set CPU vector allocation policy Jiang Liu
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=1411743478-31435-7-git-send-email-jiang.liu@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=joro@8bytes.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rdunlap@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).