Skip to content

Commit

Permalink
ia64/mca: Convert to hotplug state machine
Browse files Browse the repository at this point in the history
Install the callbacks via the state machine and let the core invoke
the callbacks on the already online CPUs.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-ia64@vger.kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: rt@linutronix.de
Link: http://lkml.kernel.org/r/20160906170457.32393-5-bigeasy@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Sebastian Andrzej Siewior authored and Thomas Gleixner committed Sep 19, 2016
1 parent a4fa9cc commit 6b8d642
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions arch/ia64/kernel/mca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,33 +1890,17 @@ ia64_mca_cpu_init(void *cpu_data)
PAGE_KERNEL)));
}

static void ia64_mca_cmc_vector_adjust(void *dummy)
static int ia64_mca_cpu_online(unsigned int cpu)
{
unsigned long flags;

local_irq_save(flags);
if (!cmc_polling_enabled)
ia64_mca_cmc_vector_enable(NULL);
local_irq_restore(flags);
return 0;
}

static int mca_cpu_callback(struct notifier_block *nfb,
unsigned long action,
void *hcpu)
{
switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
ia64_mca_cmc_vector_adjust(NULL);
break;
}
return NOTIFY_OK;
}

static struct notifier_block mca_cpu_notifier = {
.notifier_call = mca_cpu_callback
};

/*
* ia64_mca_init
*
Expand Down Expand Up @@ -2111,15 +2095,13 @@ ia64_mca_late_init(void)
if (!mca_init)
return 0;

register_hotcpu_notifier(&mca_cpu_notifier);

/* Setup the CMCI/P vector and handler */
setup_timer(&cmc_poll_timer, ia64_mca_cmc_poll, 0UL);

/* Unmask/enable the vector */
cmc_polling_enabled = 0;
schedule_work(&cmc_enable_work);

cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "ia64/mca:online",
ia64_mca_cpu_online, NULL);
IA64_MCA_DEBUG("%s: CMCI/P setup and enabled.\n", __func__);

#ifdef CONFIG_ACPI
Expand Down

0 comments on commit 6b8d642

Please sign in to comment.