mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
Merge "arm: highmem: Fix CPU_DYING callback for kmap"
This commit is contained in:
commit
575f478b8c
@ -150,7 +150,7 @@ void *kmap_atomic_pfn(unsigned long pfn)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ARCH_WANT_KMAP_ATOMIC_FLUSH
|
||||
static void kmap_remove_unused_cpu(int cpu)
|
||||
int kmap_remove_unused_cpu(unsigned int cpu)
|
||||
{
|
||||
int start_idx, idx, type;
|
||||
|
||||
@ -167,6 +167,7 @@ static void kmap_remove_unused_cpu(int cpu)
|
||||
set_top_pte(vaddr, __pte(0));
|
||||
}
|
||||
pagefault_enable();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void kmap_remove_unused(void *unused)
|
||||
@ -179,27 +180,4 @@ void kmap_atomic_flush_unused(void)
|
||||
on_each_cpu(kmap_remove_unused, NULL, 1);
|
||||
}
|
||||
|
||||
static int hotplug_kmap_atomic_callback(struct notifier_block *nfb,
|
||||
unsigned long action, void *hcpu)
|
||||
{
|
||||
switch (action & (~CPU_TASKS_FROZEN)) {
|
||||
case CPU_DYING:
|
||||
kmap_remove_unused_cpu((int)hcpu);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return NOTIFY_OK;
|
||||
}
|
||||
|
||||
static struct notifier_block hotplug_kmap_atomic_notifier = {
|
||||
.notifier_call = hotplug_kmap_atomic_callback,
|
||||
};
|
||||
|
||||
static int __init init_kmap_atomic(void)
|
||||
{
|
||||
return register_hotcpu_notifier(&hotplug_kmap_atomic_notifier);
|
||||
}
|
||||
early_initcall(init_kmap_atomic);
|
||||
#endif
|
||||
|
@ -97,6 +97,7 @@ enum cpuhp_state {
|
||||
CPUHP_AP_OFFLINE,
|
||||
CPUHP_AP_SCHED_STARTING,
|
||||
CPUHP_AP_RCUTREE_DYING,
|
||||
CPUHP_AP_KMAP_DYING,
|
||||
CPUHP_AP_IRQ_GIC_STARTING,
|
||||
CPUHP_AP_IRQ_HIP04_STARTING,
|
||||
CPUHP_AP_IRQ_ARMADA_XP_STARTING,
|
||||
|
@ -42,6 +42,7 @@ void kmap_flush_unused(void);
|
||||
|
||||
#ifdef CONFIG_ARCH_WANT_KMAP_ATOMIC_FLUSH
|
||||
void kmap_atomic_flush_unused(void);
|
||||
int kmap_remove_unused_cpu(unsigned int cpu);
|
||||
#else
|
||||
static inline void kmap_atomic_flush_unused(void) { }
|
||||
#endif
|
||||
@ -92,6 +93,10 @@ static inline void __kunmap_atomic(void *addr)
|
||||
|
||||
#endif /* CONFIG_HIGHMEM */
|
||||
|
||||
#if !defined(CONFIG_HIGHMEM) || !defined(CONFIG_ARCH_WANT_KMAP_ATOMIC_FLUSH)
|
||||
static inline int kmap_remove_unused_cpu(unsigned int cpu) { return 0; }
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
|
||||
|
||||
DECLARE_PER_CPU(int, __kmap_atomic_idx);
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/percpu-rwsem.h>
|
||||
#include <uapi/linux/sched/types.h>
|
||||
#include <linux/highmem.h>
|
||||
|
||||
#include <trace/events/power.h>
|
||||
#define CREATE_TRACE_POINTS
|
||||
@ -1392,6 +1393,11 @@ static struct cpuhp_step cpuhp_ap_states[] = {
|
||||
.startup.single = NULL,
|
||||
.teardown.single = rcutree_dying_cpu,
|
||||
},
|
||||
[CPUHP_AP_KMAP_DYING] = {
|
||||
.name = "KMAP:dying",
|
||||
.startup.single = NULL,
|
||||
.teardown.single = kmap_remove_unused_cpu,
|
||||
},
|
||||
[CPUHP_AP_SMPCFD_DYING] = {
|
||||
.name = "smpcfd:dying",
|
||||
.startup.single = NULL,
|
||||
|
Loading…
x
Reference in New Issue
Block a user