Thread (1 message) 1 message, 1 author, 2011-03-10

Re: [PATCH v4 2/2] powerpc: make MPIC honor the "pic-no-reset" device tree property

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2011-03-10 22:13:48
Also in: linux-devicetree

Possibly related (same subject, not in this thread)

On Thu, 2011-03-10 at 11:23 -0600, Meador Inge wrote:
AFAIK, we can't rely on 'set_affinity' always being called.  I don't 
think it is called at all when !defined(CONFIG_SMP) and if it was,
then that would be an error:

        /* include/linux/irq.h */

        #else /* CONFIG_SMP */

        static inline int irq_set_affinity(unsigned int irq,
                const struct cpumask *m)
        {
                return -EINVAL;
        }
You are right. We do need to set a sane default then.
quoted
partially initialized in set_type, I'd say just modify set_type to
initialize the source as well, and problem solved, no ?
The priority has to be initialized as well.  They could both be done
in 
'mpic_set_irq_type', but that seems like a weird place since it has 
nothing to do with actually setting the type.

Since we already have 'mpic_irq_set_priority' and 'mpic_set_vector', 
perhaps a better option is to add 'mpic_set_destination' and put the 
following in 'mpic_host_map' (using the cpuid helper function
suggested 
above):

        /* Lazy source init when MPIC_NO_RESET */
        if (!mpic_is_ipi(mpic, hw) && (mpic->flags & MPIC_NO_RESET)) {
                mpic_set_vector(virq, hw);
                mpic_set_destination(virq, mpic_cpuid(mpic));
                mpic_irq_set_priority(virq, 8);
        }

It is more overhead, but it reads well.  Thoughts?
No objection.

Cheers,
Ben.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help