lkml.org 
[lkml]   [2012]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 14/27] ia64: Move holding of vector_lock to __setup_vector_irq()
    Date
    __setup_vector_irq() expects that its caller holds the vector_lock.
    As of now there is only one caller - smp_callin(); and acquiring the lock
    in smp_callin() around the call to __setup_vector_irq() obstructs the
    conversion of ia64 to generic smp booting code. So move the lock acquisition
    to __setup_vector_irq() itself (mimicking what x86 does).

    Cc: Tony Luck <tony.luck@intel.com>
    Cc: Fenghua Yu <fenghua.yu@intel.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Mike Frysinger <vapier@gentoo.org>
    Cc: linux-ia64@vger.kernel.org
    Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
    ---

    arch/ia64/kernel/irq_ia64.c | 5 +++--
    arch/ia64/kernel/smpboot.c | 2 +-
    2 files changed, 4 insertions(+), 3 deletions(-)

    diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
    index 5c3e088..6ac99c8 100644
    --- a/arch/ia64/kernel/irq_ia64.c
    +++ b/arch/ia64/kernel/irq_ia64.c
    @@ -241,13 +241,13 @@ reserve_irq_vector (int vector)
    }

    /*
    - * Initialize vector_irq on a new cpu. This function must be called
    - * with vector_lock held.
    + * Initialize vector_irq on a new cpu.
    */
    void __setup_vector_irq(int cpu)
    {
    int irq, vector;

    + spin_lock(&vector_lock);
    /* Clear vector_irq */
    for (vector = 0; vector < IA64_NUM_VECTORS; ++vector)
    per_cpu(vector_irq, cpu)[vector] = -1;
    @@ -258,6 +258,7 @@ void __setup_vector_irq(int cpu)
    vector = irq_to_vector(irq);
    per_cpu(vector_irq, cpu)[vector] = irq;
    }
    + spin_unlock(&vector_lock);
    }

    #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG))
    diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
    index df00a3c..709ce07 100644
    --- a/arch/ia64/kernel/smpboot.c
    +++ b/arch/ia64/kernel/smpboot.c
    @@ -378,10 +378,10 @@ smp_callin (void)
    set_numa_node(cpu_to_node_map[cpuid]);
    set_numa_mem(local_memory_node(cpu_to_node_map[cpuid]));

    - spin_lock(&vector_lock);
    /* Setup the per cpu irq handling data structures */
    __setup_vector_irq(cpuid);
    notify_cpu_starting(cpuid);
    + spin_lock(&vector_lock);
    set_cpu_online(cpuid, true);
    per_cpu(cpu_state, cpuid) = CPU_ONLINE;
    spin_unlock(&vector_lock);


    \
     
     \ /
      Last update: 2012-06-01 12:41    [W:4.139 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site