Commit 608d51d8 authored by Philippe Gerum's avatar Philippe Gerum
Browse files

arm64/ipipe: assorted merge fixups

parent 1166fac1
......@@ -25,7 +25,7 @@
#ifndef __ARM_IPIPE_H
#define __ARM_IPIPE_H
struct irq_domain;
#include <linux/irqdomain.h>
#ifdef CONFIG_IPIPE
......@@ -214,10 +214,15 @@ void __ipipe_grab_irq(int irq, struct pt_regs *regs);
void __ipipe_exit_irq(struct pt_regs *regs);
static inline int ipipe_handle_multi_irq(struct irq_domain *domain,
unsigned int irq, struct pt_regs *regs)
static inline
int ipipe_handle_domain_irq(struct irq_domain *domain,
unsigned int hwirq, struct pt_regs *regs)
{
unsigned int irq;
irq = irq_find_mapping(domain, hwirq);
__ipipe_grab_irq(irq, regs);
return 0;
}
......@@ -259,18 +264,20 @@ struct task_struct *ipipe_switch_to(struct task_struct *prev,
(void) (flags); \
} while(0)
static inline int ipipe_handle_multi_irq(struct irq_domain *domain,
unsigned int irq, struct pt_regs *regs)
{
return handle_domain_irq(domain, irq, regs);
}
#ifdef CONFIG_SMP
static inline void ipipe_handle_multi_ipi(int irq, struct pt_regs *regs)
{
handle_IPI(irq, regs);
}
#endif /* CONFIG_SMP */
static inline
int ipipe_handle_domain_irq(struct irq_domain *domain,
unsigned int hwirq, struct pt_regs *regs)
{
return handle_domain_irq(domain, hwirq, regs);
}
#endif /* CONFIG_IPIPE */
#endif /* !__ARM_IPIPE_H */
......@@ -59,7 +59,7 @@
#ifdef CONFIG_IPIPE
#define PREEMPT_SCHEDULE_IRQ __ipipe_preempt_schedule_irq
#else /* !CONFIG_IPIPE */
#ifdef ret_from_exception ret_to_user
#define ret_from_exception ret_to_user
#define PREEMPT_SCHEDULE_IRQ preempt_schedule_irq
#endif /* CONFIG_IPIPE */
......
......@@ -128,7 +128,7 @@ void __ipipe_do_vnmi(unsigned int irq, void *cookie)
data = __ipipe_vnmi.data;
if (likely(data && cpumask_test_cpu(cpu, &data->cpumask))) {
data->fn(data->arg);
cpu_clear(cpu, data->cpumask);
cpumask_clear_cpu(cpu, &data->cpumask);
}
read_unlock(&__ipipe_vnmi.data_lock);
......@@ -157,8 +157,8 @@ void ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask)
if (WARN_ON_ONCE(irq_get_chip(irq)->irq_set_affinity == NULL))
return;
cpus_and(cpumask, cpumask, *cpu_online_mask);
if (WARN_ON_ONCE(cpus_empty(cpumask)))
cpumask_and(&cpumask, &cpumask, cpu_online_mask);
if (WARN_ON_ONCE(cpumask_empty(&cpumask)))
return;
irq_get_chip(irq)->irq_set_affinity(irq_get_irq_data(irq), &cpumask, true);
......@@ -182,8 +182,8 @@ void __ipipe_send_vnmi(void (*fn)(void *), cpumask_t cpumask, void *arg)
}
cpu = ipipe_processor_id();
cpu_clear(cpu, data.cpumask);
if (cpus_empty(data.cpumask)) {
cpumask_clear_cpu(cpu, &data.cpumask);
if (cpumask_empty(&data.cpumask)) {
spin_unlock_irqrestore(&__ipipe_vnmi.lock, flags);
return;
}
......@@ -193,7 +193,7 @@ void __ipipe_send_vnmi(void (*fn)(void *), cpumask_t cpumask, void *arg)
write_unlock(&__ipipe_vnmi.data_lock);
ipipe_send_ipi(IPIPE_SERVICE_VNMI, data.cpumask);
while (!cpus_empty(data.cpumask))
while (!cpumask_empty(&data.cpumask))
cpu_relax();
write_lock(&__ipipe_vnmi.data_lock);
......
......@@ -39,6 +39,15 @@
static const char *fault_name(unsigned int esr);
#define cpu_get_pgd() \
({ \
unsigned long pg; \
asm("mrs %0, ttbr0_el1\n" \
: "=r" (pg)); \
pg &= ~0xffff000000003ffful; \
(pgd_t *)phys_to_virt(pg); \
})
/*
* Dump out the page tables associated with 'addr' in mm 'mm'.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment