All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Michal Simek <michal.simek@xilinx.com>
Cc: jason@lakedaemon.net,
	Mubin Usman Sayyed <mubin.usman.sayyed@xilinx.com>,
	anirudha.sarangi@xilinx.com, linux-kernel@vger.kernel.org,
	tglx@linutronix.de, siva.durga.paladugu@xilinx.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] irqchip: xilinx: Add support for multiple instances
Date: Thu, 06 Feb 2020 09:15:54 +0000	[thread overview]
Message-ID: <a3008824af22411034a6172cf09b450f@kernel.org> (raw)
In-Reply-To: <575c6350-139b-65b9-f9e2-2633656baa85@xilinx.com>

On 2020-02-06 09:11, Michal Simek wrote:
> On 06. 02. 20 10:09, Marc Zyngier wrote:
>> 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.
> 
> ok. What's your recommendation for chained controller? Just go with
> irq_find_mapping?

For now, yes. I have (distant) plans to improve this.

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Marc Zyngier <maz@kernel.org>
To: Michal Simek <michal.simek@xilinx.com>
Cc: Mubin Usman Sayyed <mubin.usman.sayyed@xilinx.com>,
	tglx@linutronix.de, jason@lakedaemon.net,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, siva.durga.paladugu@xilinx.com,
	anirudha.sarangi@xilinx.com
Subject: Re: [PATCH v2] irqchip: xilinx: Add support for multiple instances
Date: Thu, 06 Feb 2020 09:15:54 +0000	[thread overview]
Message-ID: <a3008824af22411034a6172cf09b450f@kernel.org> (raw)
In-Reply-To: <575c6350-139b-65b9-f9e2-2633656baa85@xilinx.com>

On 2020-02-06 09:11, Michal Simek wrote:
> On 06. 02. 20 10:09, Marc Zyngier wrote:
>> 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.
> 
> ok. What's your recommendation for chained controller? Just go with
> irq_find_mapping?

For now, yes. I have (distant) plans to improve this.

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

  reply	other threads:[~2020-02-06  9:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 14:05 [PATCH v2] irqchip: xilinx: Add support for multiple instances Mubin Usman Sayyed
2020-02-05 14:05 ` Mubin Usman Sayyed
2020-02-05 14:15 ` David Laight
2020-02-05 14:15   ` David Laight
2020-02-05 14:54   ` Michal Simek
2020-02-05 14:54     ` Michal Simek
2020-02-06  8:07     ` Mubin Usman Sayyed
2020-02-06  8:07       ` Mubin Usman Sayyed
2020-02-05 14:53 ` Michal Simek
2020-02-05 14:53   ` Michal Simek
2020-02-06  8:02   ` Mubin Usman Sayyed
2020-02-06  8:02     ` Mubin Usman Sayyed
2020-02-05 16:53 ` Marc Zyngier
2020-02-05 16:53   ` Marc Zyngier
2020-02-06  7:06   ` Michal Simek
2020-02-06  7:06     ` Michal Simek
2020-02-06  9:09     ` Marc Zyngier
2020-02-06  9:09       ` Marc Zyngier
2020-02-06  9:11       ` Michal Simek
2020-02-06  9:11         ` Michal Simek
2020-02-06  9:15         ` Marc Zyngier [this message]
2020-02-06  9:15           ` Marc Zyngier
2020-02-06  9:17           ` Michal Simek
2020-02-06  9:17             ` Michal Simek
2020-02-11 19:38   ` Mubin Usman Sayyed
2020-02-11 19:38     ` Mubin Usman Sayyed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a3008824af22411034a6172cf09b450f@kernel.org \
    --to=maz@kernel.org \
    --cc=anirudha.sarangi@xilinx.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mubin.usman.sayyed@xilinx.com \
    --cc=siva.durga.paladugu@xilinx.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.