lkml.org 
[lkml]   [2020]   [Feb]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] irqchip: xilinx: Add support for multiple instances
On 2020-02-06 07:06, Michal Simek wrote:
> On 05. 02. 20 17:53, Marc Zyngier wrote:
>> On 2020-02-05 14:05, Mubin Usman Sayyed wrote:

[...]

>>>  unsigned int xintc_get_irq(void)
>>>  {
>>> -       unsigned int hwirq, irq = -1;
>>> +       int hwirq, irq = -1;
>>>
>>> -       hwirq = xintc_read(IVR);
>>> +       hwirq = xintc_read(primary_intc->base + IVR);
>>>         if (hwirq != -1U)
>>> -               irq = irq_find_mapping(xintc_irqc->root_domain,
>>> hwirq);
>>> +               irq = irq_find_mapping(primary_intc->root_domain,
>>> hwirq);
>>>
>>>         pr_debug("irq-xilinx: hwirq=%d, irq=%d\n", hwirq, irq);
>>
>> I have the ugly feeling I'm reading the same code twice... Surely you
>> can
>> make these two functions common code.
>
> I have some questions regarding this.
> I have updated one patchset which is adding support for Microblaze SMP.
> And when I was looking at current wiring of this driver I have decided
> to change it.
>
> I have enabled GENERIC_IRQ_MULTI_HANDLER and HANDLE_DOMAIN_IRQ.
> This driver calls set_handle_irq(xil_intc_handle_irq)
> and MB do_IRQ() call handle_arch_irq()
> and IRQ routine here is using handle_domain_irq().
>
> I would expect that this chained IRQ handler can also use
> handle_domain_irq().
>
> Is that correct understanding?

handle_domain_irq() implies that you have a set of pt_regs, representing
the context you interrupted. You can't fake that up, so I can't see how
you use it in a chained context.

[...]

>>> +       intc_dev->name = intc->full_name;
>>
>> No. The world doesn't need to see the OF path of your interrupt
>> controller in /proc/cpuinfo.
>> The name that was there before was perfectly descriptive, please stick
>> to it.
>
> It should be showing name like interrupt-controller@41800000.
> Do you think that we really should stick with just fixed name?
> There could be multiple instances in the system and you will have no
> idea how they are connected.

What is that used for? Debugging. We have a whole infrastructure for
that
(GENERIC_IRQ_DEBUGFS), which is the right tool for the job. If it needs
improvement, please let me know what is missing.

Also, anything in /proc is ABI, so we don't change it randomly.

Thanks,

M.
--
Jazz is not dead. It just smells funny...

\
 
 \ /
  Last update: 2020-02-06 10:09    [W:0.077 / U:1.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site