...
 
Commits (7)
......@@ -115,17 +115,17 @@ void __ipipe_hook_critical_ipi(struct ipipe_domain *ipd)
hook_internal_ipi(ipd, IPIPE_SERVICE_VNMI, __ipipe_do_vnmi);
}
void ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask)
int ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask)
{
if (ipipe_virtual_irq_p(irq) ||
irq_get_chip(irq)->irq_set_affinity == NULL)
return;
return 0;
cpumask_and(&cpumask, &cpumask, cpu_online_mask);
if (WARN_ON_ONCE(cpumask_empty(&cpumask)))
return;
return 0;
irq_get_chip(irq)->irq_set_affinity(irq_get_irq_data(irq), &cpumask, true);
return irq_get_chip(irq)->irq_set_affinity(irq_get_irq_data(irq), &cpumask, true);
}
EXPORT_SYMBOL_GPL(ipipe_set_irq_affinity);
......
......@@ -433,12 +433,12 @@ void ipipe_prepare_panic(void);
#ifndef ipipe_smp_p
#define ipipe_smp_p (1)
#endif
void ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask);
int ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask);
void ipipe_send_ipi(unsigned int ipi, cpumask_t cpumask);
#else /* !CONFIG_SMP */
#define ipipe_smp_p (0)
static inline
void ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask) { }
int ipipe_set_irq_affinity(unsigned int irq, cpumask_t cpumask) { return 0; }
static inline void ipipe_send_ipi(unsigned int ipi, cpumask_t cpumask) { }
static inline void ipipe_disable_smp(void) { }
#endif /* CONFIG_SMP */
......@@ -475,7 +475,7 @@ static inline struct ipipe_threadinfo *ipipe_current_threadinfo(void)
#define ipipe_task_threadinfo(p) (&task_thread_info(p)->ipipe_data)
void ipipe_enable_irq(unsigned int irq);
int ipipe_enable_irq(unsigned int irq);
static inline void ipipe_disable_irq(unsigned int irq)
{
......
......@@ -14,6 +14,7 @@
#include <linux/printk.h>
#include <linux/build_bug.h>
#include <asm/byteorder.h>
#include <asm-generic/ipipe.h>
#include <uapi/linux/kernel.h>
#define USHRT_MAX ((u16)(~0U))
......
......@@ -1082,15 +1082,16 @@ __fixup_irq_handler(struct irq_desc *desc, irq_flow_handler_t handle, int is_cha
return handle;
}
void ipipe_enable_irq(unsigned int irq)
int ipipe_enable_irq(unsigned int irq)
{
struct irq_desc *desc;
struct irq_chip *chip;
unsigned long flags;
int err;
desc = irq_to_desc(irq);
if (desc == NULL)
return;
return -EINVAL;
chip = irq_desc_get_chip(desc);
......@@ -1098,6 +1099,10 @@ void ipipe_enable_irq(unsigned int irq)
ipipe_root_only();
err = irq_activate(desc);
if (err)
return err;
raw_spin_lock_irqsave(&desc->lock, flags);
if (desc->istate & IPIPE_IRQS_NEEDS_STARTUP) {
desc->istate &= ~IPIPE_IRQS_NEEDS_STARTUP;
......@@ -1105,16 +1110,18 @@ void ipipe_enable_irq(unsigned int irq)
}
raw_spin_unlock_irqrestore(&desc->lock, flags);
return;
return 0;
}
if (WARN_ON_ONCE(chip->irq_enable == NULL && chip->irq_unmask == NULL))
return;
if (chip->irq_enable == NULL && chip->irq_unmask == NULL)
return -ENOSYS;
if (chip->irq_enable)
chip->irq_enable(&desc->irq_data);
else
chip->irq_unmask(&desc->irq_data);
return 0;
}
EXPORT_SYMBOL_GPL(ipipe_enable_irq);
......
......@@ -2841,9 +2841,6 @@ static void __trace_hardirqs_on_caller(unsigned long ip)
void lockdep_hardirqs_on(unsigned long ip)
{
if (!ipipe_root_p)
return;
if (unlikely(!debug_locks || current->lockdep_recursion))
return;
......@@ -2890,9 +2887,6 @@ void lockdep_hardirqs_off(unsigned long ip)
{
struct task_struct *curr;
if (!ipipe_root_p)
return;
curr = current;
if (unlikely(!debug_locks || current->lockdep_recursion))
......
......@@ -66,6 +66,17 @@ __visible void trace_hardirqs_on_caller(unsigned long caller_addr)
}
EXPORT_SYMBOL(trace_hardirqs_on_caller);
__visible void trace_hardirqs_on_virt_caller(unsigned long ip)
{
/*
* The IRQ tracing logic only applies to the root domain, and
* must consider the virtual disable flag exclusively when
* leaving an interrupt/fault context.
*/
if (ipipe_root_p && !irqs_disabled())
trace_hardirqs_on_caller(ip);
}
__visible void trace_hardirqs_on_virt(void)
{
/*
......