|
@@ -3172,14 +3172,13 @@ static int nr_irqs_gsi = NR_IRQS_LEGACY;
|
|
/*
|
|
/*
|
|
* Dynamic irq allocate and deallocation
|
|
* Dynamic irq allocate and deallocation
|
|
*/
|
|
*/
|
|
-unsigned int create_irq_nr(unsigned int irq_want)
|
|
|
|
|
|
+unsigned int create_irq_nr(unsigned int irq_want, int node)
|
|
{
|
|
{
|
|
/* Allocate an unused irq */
|
|
/* Allocate an unused irq */
|
|
unsigned int irq;
|
|
unsigned int irq;
|
|
unsigned int new;
|
|
unsigned int new;
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
struct irq_cfg *cfg_new = NULL;
|
|
struct irq_cfg *cfg_new = NULL;
|
|
- int node = cpu_to_node(boot_cpu_id);
|
|
|
|
struct irq_desc *desc_new = NULL;
|
|
struct irq_desc *desc_new = NULL;
|
|
|
|
|
|
irq = 0;
|
|
irq = 0;
|
|
@@ -3197,6 +3196,13 @@ unsigned int create_irq_nr(unsigned int irq_want)
|
|
|
|
|
|
if (cfg_new->vector != 0)
|
|
if (cfg_new->vector != 0)
|
|
continue;
|
|
continue;
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_NUMA_IRQ_DESC
|
|
|
|
+ /* different node ?*/
|
|
|
|
+ if (desc_new->node != node)
|
|
|
|
+ desc = move_irq_desc(desc, node);
|
|
|
|
+#endif
|
|
|
|
+
|
|
if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
|
|
if (__assign_irq_vector(new, cfg_new, apic->target_cpus()) == 0)
|
|
irq = new;
|
|
irq = new;
|
|
break;
|
|
break;
|
|
@@ -3214,11 +3220,12 @@ unsigned int create_irq_nr(unsigned int irq_want)
|
|
|
|
|
|
int create_irq(void)
|
|
int create_irq(void)
|
|
{
|
|
{
|
|
|
|
+ int node = cpu_to_node(boot_cpu_id);
|
|
unsigned int irq_want;
|
|
unsigned int irq_want;
|
|
int irq;
|
|
int irq;
|
|
|
|
|
|
irq_want = nr_irqs_gsi;
|
|
irq_want = nr_irqs_gsi;
|
|
- irq = create_irq_nr(irq_want);
|
|
|
|
|
|
+ irq = create_irq_nr(irq_want, node);
|
|
|
|
|
|
if (irq == 0)
|
|
if (irq == 0)
|
|
irq = -1;
|
|
irq = -1;
|
|
@@ -3476,15 +3483,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
|
|
unsigned int irq_want;
|
|
unsigned int irq_want;
|
|
struct intel_iommu *iommu = NULL;
|
|
struct intel_iommu *iommu = NULL;
|
|
int index = 0;
|
|
int index = 0;
|
|
|
|
+ int node;
|
|
|
|
|
|
/* x86 doesn't support multiple MSI yet */
|
|
/* x86 doesn't support multiple MSI yet */
|
|
if (type == PCI_CAP_ID_MSI && nvec > 1)
|
|
if (type == PCI_CAP_ID_MSI && nvec > 1)
|
|
return 1;
|
|
return 1;
|
|
|
|
|
|
|
|
+ node = dev_to_node(&dev->dev);
|
|
irq_want = nr_irqs_gsi;
|
|
irq_want = nr_irqs_gsi;
|
|
sub_handle = 0;
|
|
sub_handle = 0;
|
|
list_for_each_entry(msidesc, &dev->msi_list, list) {
|
|
list_for_each_entry(msidesc, &dev->msi_list, list) {
|
|
- irq = create_irq_nr(irq_want);
|
|
|
|
|
|
+ irq = create_irq_nr(irq_want, node);
|
|
if (irq == 0)
|
|
if (irq == 0)
|
|
return -1;
|
|
return -1;
|
|
irq_want = irq + 1;
|
|
irq_want = irq + 1;
|