Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Aug 2018 20:31:08 +0000 (13:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 Aug 2018 20:31:08 +0000 (13:31 -0700)
Pull x86 apic update from Thomas Gleixner:
 "Trivial cleanups of the APIC related code"

* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/apic: Trivial coding style fixes
  x86/vector: Merge allocate_vector() into assign_vector_locked()

1  2 
arch/x86/kernel/apic/apic.c
arch/x86/kernel/apic/vector.c

Simple merge
@@@ -235,32 -236,13 +236,22 @@@ assign_vector_locked(struct irq_data *i
        if (vector && cpu_online(cpu) && cpumask_test_cpu(cpu, dest))
                return 0;
  
 +      /*
 +       * Careful here. @apicd might either have move_in_progress set or
 +       * be enqueued for cleanup. Assigning a new vector would either
 +       * leave a stale vector on some CPU around or in case of a pending
 +       * cleanup corrupt the hlist.
 +       */
 +      if (apicd->move_in_progress || !hlist_unhashed(&apicd->clist))
 +              return -EBUSY;
 +
        vector = irq_matrix_alloc(vector_matrix, dest, resvd, &cpu);
-       if (vector > 0)
-               apic_update_vector(irqd, vector, cpu);
        trace_vector_alloc(irqd->irq, vector, resvd, vector);
-       return vector;
- }
- static int assign_vector_locked(struct irq_data *irqd,
-                               const struct cpumask *dest)
- {
-       struct apic_chip_data *apicd = apic_chip_data(irqd);
-       int vector = allocate_vector(irqd, dest);
        if (vector < 0)
                return vector;
+       apic_update_vector(irqd, vector, cpu);
+       apic_update_irq_cfg(irqd, vector, cpu);
  
-       apic_update_irq_cfg(irqd, apicd->vector, apicd->cpu);
        return 0;
  }