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>,
Joerg Roedel <joro@8bytes.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>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
x86@kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org,
iommu@lists.linux-foundation.org
Subject: [Patch Part3 v3 20/38] iommu/amd: Clean up unsued code
Date: Sun, 9 Nov 2014 02:13:20 +0800 [thread overview]
Message-ID: <1415470418-10874-21-git-send-email-jiang.liu@linux.intel.com> (raw)
In-Reply-To: <1415470418-10874-1-git-send-email-jiang.liu@linux.intel.com>
Now we have converted to hierarchy irqdomain, so clean up unused code.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
---
drivers/iommu/amd_iommu.c | 144 ---------------------------------------------
1 file changed, 144 deletions(-)
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 336d310b5b7b..704c18e3eb63 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -3996,22 +3996,6 @@ out:
return index;
}
-static int get_irte(u16 devid, int index, union irte *irte)
-{
- struct irq_remap_table *table;
- unsigned long flags;
-
- table = get_irq_table(devid, false);
- if (!table)
- return -ENOMEM;
-
- spin_lock_irqsave(&table->lock, flags);
- irte->val = table->table[index];
- spin_unlock_irqrestore(&table->lock, flags);
-
- return 0;
-}
-
static int modify_irte(u16 devid, int index, union irte irte)
{
struct irq_remap_table *table;
@@ -4058,131 +4042,6 @@ static void free_irte(u16 devid, int index)
iommu_completion_wait(iommu);
}
-static int setup_ioapic_entry(int irq, struct IO_APIC_route_entry *entry,
- unsigned int destination, int vector,
- struct io_apic_irq_attr *attr)
-{
- struct irq_remap_table *table;
- struct irq_2_irte *irte_info;
- struct irq_cfg *cfg;
- union irte irte;
- int ioapic_id;
- int index;
- int devid;
- int ret;
-
- cfg = irq_cfg(irq);
- if (!cfg)
- return -EINVAL;
-
- irte_info = &cfg->irq_2_irte;
- ioapic_id = mpc_ioapic_id(attr->ioapic);
- devid = get_ioapic_devid(ioapic_id);
-
- if (devid < 0)
- return devid;
-
- table = get_irq_table(devid, true);
- if (table == NULL)
- return -ENOMEM;
-
- index = attr->ioapic_pin;
-
- /* Setup IRQ remapping info */
- cfg->remapped = 1;
- irte_info->devid = devid;
- irte_info->index = index;
-
- /* Setup IRTE for IOMMU */
- irte.val = 0;
- irte.fields.vector = vector;
- irte.fields.int_type = apic->irq_delivery_mode;
- irte.fields.destination = destination;
- irte.fields.dm = apic->irq_dest_mode;
- irte.fields.valid = 1;
-
- ret = modify_irte(devid, index, irte);
- if (ret)
- return ret;
-
- /* Setup IOAPIC entry */
- memset(entry, 0, sizeof(*entry));
-
- entry->vector = index;
- entry->mask = 0;
- entry->trigger = attr->trigger;
- entry->polarity = attr->polarity;
-
- /*
- * Mask level triggered irqs.
- */
- if (attr->trigger)
- entry->mask = 1;
-
- return 0;
-}
-
-static int set_affinity(struct irq_data *data, const struct cpumask *mask,
- bool force)
-{
- struct irq_2_irte *irte_info;
- unsigned int dest, irq;
- struct irq_cfg *cfg;
- union irte irte;
- int err;
-
- if (!config_enabled(CONFIG_SMP))
- return -1;
-
- cfg = irqd_cfg(data);
- irq = data->irq;
- irte_info = &cfg->irq_2_irte;
-
- if (!cpumask_intersects(mask, cpu_online_mask))
- return -EINVAL;
-
- if (get_irte(irte_info->devid, irte_info->index, &irte))
- return -EBUSY;
-
- if (assign_irq_vector(irq, cfg, mask))
- return -EBUSY;
-
- err = apic->cpu_mask_to_apicid_and(cfg->domain, mask, &dest);
- if (err) {
- if (assign_irq_vector(irq, cfg, data->affinity))
- pr_err("AMD-Vi: Failed to recover vector for irq %d\n", irq);
- return err;
- }
-
- irte.fields.vector = cfg->vector;
- irte.fields.destination = dest;
-
- modify_irte(irte_info->devid, irte_info->index, irte);
-
- if (cfg->move_in_progress)
- send_cleanup_vector(cfg);
-
- cpumask_copy(data->affinity, mask);
-
- return 0;
-}
-
-static int free_irq(int irq)
-{
- struct irq_2_irte *irte_info;
- struct irq_cfg *cfg;
-
- cfg = irq_cfg(irq);
- if (!cfg)
- return -EINVAL;
-
- irte_info = &cfg->irq_2_irte;
-
- free_irte(irte_info->devid, irte_info->index);
-
- return 0;
-}
-
static int get_devid(struct irq_alloc_info *info)
{
int devid = -1;
@@ -4256,9 +4115,6 @@ struct irq_remap_ops amd_iommu_irq_ops = {
.disable = amd_iommu_disable,
.reenable = amd_iommu_reenable,
.enable_faulting = amd_iommu_enable_faulting,
- .setup_ioapic_entry = setup_ioapic_entry,
- .set_affinity = set_affinity,
- .free_irq = free_irq,
.get_ir_irq_domain = get_ir_irq_domain,
.get_irq_domain = get_irq_domain,
};
--
1.7.10.4
next prev parent reply other threads:[~2014-11-08 18:15 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-08 18:13 [Patch Part3 v3 00/38] Enable hierarchy irqdomian on x86 platforms Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 01/38] x86, intel-mid: Delay initialization of APB timer Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 02/38] x86, intel-mid, trivial: Refine code syntax for sfi_parse_mtmr() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 03/38] x86, irq: Kill unused pre_init_apic_IRQ0() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 04/38] x86, irq: Prepare IOAPIC interfaces to support hierarchy irqdomain Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 05/38] x86, irq: Implement callbacks to enable hierarchy irqdomain on IOAPICs Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 06/38] x86, irq: Refine the way to allocate irq_cfg for legacy IRQs Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 07/38] x86, irq: Simplify the way to print IOAPIC entry Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 08/38] x86, irq: Introduce helper functions to support hierarchy irqdomain for IOAPIC Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 09/38] x86, irq: Convert IOAPIC to use hierarchy irqdomain interfaces Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 10/38] x86, irq: Kill unused old IOAPIC " Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 11/38] x86, irq: Kill unused struct mp_pin_info Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 12/38] x86, irq: Kill x86_io_apic_ops.print_entries and related interfaces Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 13/38] x86, irq: Kill x86_io_apic_ops.setup_entry " Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 14/38] x86, irq: Kill x86_io_apic_ops.set_affinity " Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 15/38] x86, irq: Kill x86_io_apic_ops.eoi_ioapic_pin " Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 16/38] x86, irq: Kill GENERIC_IRQ_LEGACY_ALLOC_HWIRQ Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 17/38] x86: Clean up unused forward declarations in x86_init.h Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 18/38] x86: irq_remapping: Clean up unsued code Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 19/38] iommu/vt-d: " Jiang Liu
2014-11-08 18:13 ` Jiang Liu [this message]
2014-11-08 18:13 ` [Patch Part3 v3 21/38] x86: irq_remapping: Clean up unused interfaces Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 22/38] x86, irq: Kill irq_cfg.irq_remapped Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 23/38] iommu/vt-d: Move struct irq_2_iommu into intel_irq_remapping.c Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 24/38] iommu/amd: Move struct irq_2_irte into amd_iommu.c Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 25/38] x86, irq: Move irq_cfg.irq_2_pin into io_apic.c Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 26/38] x86, irq: Kill struct io_apic_irq_attr Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 27/38] x86, irq: Kill x86_io_apic_ops.write and x86_io_apic_ops.modify Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 28/38] x86, irq: Clean up io_apic.h Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 29/38] x86, irq: Use cached IOAPIC entry instead of reading from hardware Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 30/38] x86, irq: Kill unused alloc_irq_and_cfg_at() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 31/38] x86, irq: Change functions only used in vector.c as static Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 32/38] x86, irq: Kill function apic_set_affinity() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 33/38] x86, irq: Move check of cfg->move_in_progress into send_cleanup_vector() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 34/38] x86, irq: Move private data in struct irq_cfg into dedicated data structure Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 35/38] x86, irq: Refine the way to calculate NR_IRQS Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 36/38] ACPI, irq, x86: Kill private function mp_register_gsi()/ mp_unregister_gsi() Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 37/38] x86, irq: Introduce mechanism to support different vector allocation policies Jiang Liu
2014-11-08 18:13 ` [Patch Part3 v3 38/38] x86, irq: Add kernel parameter vector_alloc to set CPU vector allocation policy Jiang Liu
2014-11-18 10:51 ` [Patch Part3 v3 00/38] Enable hierarchy irqdomian on x86 platforms Joerg Roedel
2014-11-18 12:58 ` 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=1415470418-10874-21-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=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux-foundation.org \
--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).