Beispiel #1
0
static ssize_t irq_affinity_proc_write(struct file *file,
                                       const char __user *buffer, size_t count, loff_t *pos)
{
    unsigned int irq = (int)(long)PDE(file->f_path.dentry->d_inode)->data;
    cpumask_t new_value;
    int err;

    if (!irq_to_desc(irq)->chip->set_affinity || no_irq_affinity ||
            irq_balancing_disabled(irq))
        return -EIO;

    err = cpumask_parse_user(buffer, count, new_value);
    if (err)
        return err;

    if (!is_affinity_mask_valid(new_value))
        return -EINVAL;

    /*
     * Do not allow disabling IRQs completely - it's a too easy
     * way to make the system unusable accidentally :-) At least
     * one online CPU still has to be targeted.
     */
    if (!cpus_intersects(new_value, cpu_online_map))
        /* Special case for empty set - allow the architecture
           code to set default SMP affinity. */
        return irq_select_affinity(irq) ? -EINVAL : count;

    irq_set_affinity(irq, new_value);

    return count;
}
Beispiel #2
0
static inline int setup_affinity(unsigned int irq, struct irq_desc *d)
{
	return irq_select_affinity(irq);
}
Beispiel #3
0
/* Wrapper for ALPHA specific affinity selector magic */
static inline int setup_affinity(struct irq_desc *d, struct cpumask *mask)
{
	return irq_select_affinity(irq_desc_get_irq(d));
}