Re: [PATCH 10/14] irqchip/mips-gic: Add a IPI hierarchy domain

Qais Yousef
2015-11-12T15:12:42Z

Hi Thomas,

On 11/07/2015 02:51 PM, Thomas Gleixner wrote:
> On Tue, 3 Nov 2015, Qais Yousef wrote:
>
>> Add a new ipi domain on top of the normal domain.
>>
>> MIPS GIC now supports dynamic allocation of an IPI.
> I don't think you make use of the power of hierarchical irq
> domains. You just whacked the current code into submission.
>

This time I'm having problems digesting your suggestion. I can't see how
it would make things simpler to be honest.

Issues I'm seeing:

- Device domain would be identical to GIC domain and it would defer
everything to the parent domain except for the extra level of
indirection. No?

- The race condition I mentioned in my earlier email where we must
be told what hwirqs are available because we can't guarantee there's no
real device connected to it which could interfere with the operation. We
have always to work on a pre reserved set defined by the system.
Currently GIC hard codes this set, but I'll be making it a DT property
in the future.

- If we remove the mapping, how can a coprocessor drivers find out
the reverse mapping to pass the hwirq to the firmware so that it can
send and listen on the correct hwirqs? I have to say my current patches
missed dealing with this problem. Now I have something to test my rproc
driver on I came to realise I haven't added the function to do the
reverse mapping.

In summary. I can't see how adding the device domain would help in
making things simpler and without having generic explicit cpu mapping I
don't know how I can implement a generic reverse mapping function to get
the hwirq to pass to the coprocessor firmware.

If I misunderstood your suggestion, mind rephrasing it please?

I can see though if I use irq_*_alloc_parent() I can probably get rid
off the below since I'd be able to use gic_irq_domain all the time to do
the revmap.

+ if (test_bit(intr, ipi_intrs)) {
+ virq = irq_linear_revmap(gic_ipi_domain,
+ GIC_SHARED_TO_HWIRQ(intr));
+ } else {
+ virq = irq_linear_revmap(gic_irq_domain,
+ GIC_SHARED_TO_HWIRQ(intr));
+ }
+

Thanks,
Qais