Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/MSI: Clean up unused MSI related code and interfaces

Now MSI interrupt has been converted to new hierarchical irqdomain
interfaces, so remove legacy MSI related code and interfaces.

Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Cohen <david.a.cohen@linux.intel.com>
Cc: Sander Eikelenboom <linux@eikelenboom.it>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Link: http://lkml.kernel.org/r/1428905519-23704-19-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by

Jiang Liu and committed by
Thomas Gleixner
b1855c75 7a53a121

+4 -64
-9
arch/x86/include/asm/hpet.h
··· 85 85 extern int hpet_assign_irq(struct irq_domain *domain, 86 86 struct hpet_dev *dev, int dev_num); 87 87 88 - #ifdef CONFIG_PCI_MSI 89 - extern int default_setup_hpet_msi(unsigned int irq, unsigned int id); 90 - #else 91 - static inline int default_setup_hpet_msi(unsigned int irq, unsigned int id) 92 - { 93 - return -EINVAL; 94 - } 95 - #endif 96 - 97 88 #ifdef CONFIG_HPET_EMULATE_RTC 98 89 99 90 #include <linux/interrupt.h>
-4
arch/x86/include/asm/x86_init.h
··· 175 175 176 176 struct x86_msi_ops { 177 177 int (*setup_msi_irqs)(struct pci_dev *dev, int nvec, int type); 178 - void (*compose_msi_msg)(struct pci_dev *dev, unsigned int irq, 179 - unsigned int dest, struct msi_msg *msg, 180 - u8 hpet_id); 181 178 void (*teardown_msi_irq)(unsigned int irq); 182 179 void (*teardown_msi_irqs)(struct pci_dev *dev); 183 180 void (*restore_msi_irqs)(struct pci_dev *dev); 184 - int (*setup_hpet_msi)(unsigned int irq, unsigned int id); 185 181 }; 186 182 187 183 struct IO_APIC_route_entry;
+4 -51
arch/x86/kernel/apic/msi.c
··· 25 25 26 26 static struct irq_domain *msi_default_domain; 27 27 28 - void native_compose_msi_msg(struct pci_dev *pdev, 29 - unsigned int irq, unsigned int dest, 30 - struct msi_msg *msg, u8 hpet_id) 28 + static void native_compose_msi_msg(struct irq_cfg *cfg, struct msi_msg *msg) 31 29 { 32 - struct irq_cfg *cfg = irq_cfg(irq); 33 - 34 30 msg->address_hi = MSI_ADDR_BASE_HI; 35 31 36 32 if (x2apic_enabled()) 37 - msg->address_hi |= MSI_ADDR_EXT_DEST_ID(dest); 33 + msg->address_hi |= MSI_ADDR_EXT_DEST_ID(cfg->dest_apicid); 38 34 39 35 msg->address_lo = 40 36 MSI_ADDR_BASE_LO | ··· 40 44 ((apic->irq_delivery_mode != dest_LowestPrio) ? 41 45 MSI_ADDR_REDIRECTION_CPU : 42 46 MSI_ADDR_REDIRECTION_LOWPRI) | 43 - MSI_ADDR_DEST_ID(dest); 47 + MSI_ADDR_DEST_ID(cfg->dest_apicid); 44 48 45 49 msg->data = 46 50 MSI_DATA_TRIGGER_EDGE | ··· 87 91 msg->data |= MSI_DATA_VECTOR(cfg->vector); 88 92 msg->address_lo &= ~MSI_ADDR_DEST_ID_MASK; 89 93 msg->address_lo |= MSI_ADDR_DEST_ID(cfg->dest_apicid); 90 - } 91 - 92 - static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, 93 - struct msi_msg *msg, u8 hpet_id) 94 - { 95 - struct irq_cfg *cfg; 96 - int err; 97 - unsigned dest; 98 - 99 - if (disable_apic) 100 - return -ENXIO; 101 - 102 - cfg = irq_cfg(irq); 103 - err = assign_irq_vector(irq, cfg, apic->target_cpus()); 104 - if (err) 105 - return err; 106 - 107 - err = apic->cpu_mask_to_apicid_and(cfg->domain, 108 - apic->target_cpus(), &dest); 109 - if (err) 110 - return err; 111 - 112 - x86_msi.compose_msi_msg(pdev, irq, dest, msg, hpet_id); 113 - 114 - return 0; 115 94 } 116 95 117 96 /* ··· 233 262 struct msi_msg msg; 234 263 struct irq_cfg *cfg = irq_cfg(irq); 235 264 236 - native_compose_msi_msg(NULL, irq, cfg->dest_apicid, &msg, -1); 265 + native_compose_msi_msg(cfg, &msg); 237 266 dmar_msi_write(irq, &msg); 238 267 irq_set_chip_and_handler_name(irq, &dmar_msi_type, handle_edge_irq, 239 268 "edge"); ··· 288 317 .irq_compose_msi_msg = irq_msi_compose_msg, 289 318 .flags = IRQCHIP_SKIP_SET_WAKE, 290 319 }; 291 - 292 - int default_setup_hpet_msi(unsigned int irq, unsigned int id) 293 - { 294 - struct irq_chip *chip = &hpet_msi_controller; 295 - struct msi_msg msg; 296 - int ret; 297 - 298 - ret = msi_compose_msg(NULL, irq, &msg, id); 299 - if (ret < 0) 300 - return ret; 301 - 302 - hpet_msi_write(irq_get_handler_data(irq), &msg); 303 - irq_set_status_flags(irq, IRQ_MOVE_PCNTXT); 304 - setup_remapped_irq(irq, irq_cfg(irq), chip); 305 - 306 - irq_set_chip_and_handler_name(irq, chip, handle_edge_irq, "edge"); 307 - return 0; 308 - } 309 320 310 321 static int hpet_domain_alloc(struct irq_domain *domain, unsigned int virq, 311 322 unsigned int nr_irqs, void *arg)