devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Jassi Brar <jaswinder.singh@linaro.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	devicetree@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Rob Herring <robh+dt@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2] irqchip: uniphier-aidet: add UniPhier AIDET irqchip driver
Date: Wed, 23 Aug 2017 10:30:07 +0900	[thread overview]
Message-ID: <CAK7LNATfeDk0rFjspEM08Y4R_3TKffE2dcBNCLnNn+t1G5YXew@mail.gmail.com> (raw)
In-Reply-To: <046d0078-bb9d-f043-b5b4-481c695e2bea@arm.com>

Hi Marc,

2017-08-22 17:20 GMT+09:00 Marc Zyngier <marc.zyngier@arm.com>:
> On 22/08/17 03:03, Masahiro Yamada wrote:
>> Hi Mark,
>>
>>
>> 2017-08-21 19:25 GMT+09:00 Marc Zyngier <marc.zyngier@arm.com>:
>>
>>>> +static struct irq_chip uniphier_aidet_irq_chip = {
>>>> +     .name = "AIDET",
>>>> +     .irq_mask = irq_chip_mask_parent,
>>>> +     .irq_unmask = irq_chip_unmask_parent,
>>>> +     .irq_eoi = irq_chip_eoi_parent,
>>>> +     .irq_set_type = uniphier_aidet_irq_set_type,
>>>
>>> Is this irqchip only used in a uniprocessor system? If not, how is the
>>> interrupt affinity managed without a irq_set_affinity callback?
>>>
>>
>>
>> After consideration, some questions popped up.
>>
>>
>>
>> We can set other hooks, for example, .irq_{enable,disable} if we like.
>>
>>          .irq_enable = irq_chip_enable_parent,
>>          .irq_disable = irq_chip_disable_parent,
>>
>>
>> I know the parent (GIC) implements unmask/mask instead of enable/disable,
>> but this is also out of the scope of this driver.
>>
>> I am not familiar with the difference between unmask/mask and enable/disable.
>> IIUC, the difference is that
>> if enable/disable hooks are missing, IRQs are masked lazily.
>
> That's a rather good thing. Disabling interrupts lazily is a net
> performance gain when you you have to repeatedly mask/unmask interrupts.
>
>> If a child irqchip implemented enable/disable,
>> IRQs would be masked immediately.  So, in irq-domain hierarchy,
>> a child irqchip need to have a good insight about its parent
>> which is be better, unmask/mask or enable/disable.
>
> Not necessarily. irq_chip_enable_parent will call unmask if enable is
> not implemented in the parent. But you'll loose the benefit of lazy
> masking of interrupts routed through this controller.

Right.
I will not add .irq_{enable/disable} to keep the benefit of lazy masking.




> There are many other things that are *much* worse, like the need to
> implement a irq_eoi callback even if the irqchip has no such concept.

Right. I noticed irq_eoi is mandatory when I tested my driver.

I notice handle_percpu_irq() and handle_percpu_devid_irq()
check the NULL pointer dereference like

        if (chip->irq_eoi)
                chip->irq_eoi(&desc->irq_data);

But, other flow handlers do not this.




>>> Nit: please use irq_domain_create_hierarchy.
>>
>> I'd like to know your intention about your commit
>> 2a5e9a072da6469a37d1f0b1577416f51223c280
>>
>> Is that mean, irq_domain_add_hierarchy will be deprecated
>> some time in the future?
>
> That's the intent, as we're moving towards a firmware-agnostic
> irq_domain layer. Think of it as a deprecated interface.
>
>> If I grep under drivers/irqchip/,
>> most drivers are currently using irq_domain_add_hierarchy(),
>> and this provides a shorter form for DT-based drivers.
> Yes, we have a lot of legacy, and I don't always catch new additions.

I see.

I hope all drivers will be converted and irq_domain_add_hierarchy() will be
deleted.

Having many variants with slight difference is confusing to driver developers.


-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2017-08-23  1:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 10:01 [PATCH v2] irqchip: uniphier-aidet: add UniPhier AIDET irqchip driver Masahiro Yamada
     [not found] ` <1503309663-2742-1-git-send-email-yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
2017-08-21 10:25   ` Marc Zyngier
2017-08-21 10:54     ` Masahiro Yamada
     [not found]       ` <CAK7LNAS_bTsweGB-WqbSoh8myTET9KW-7oN0FLZTmAf_K317aw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-21 11:53         ` Marc Zyngier
2017-08-22  2:03     ` Masahiro Yamada
2017-08-22  8:20       ` Marc Zyngier
2017-08-23  1:30         ` Masahiro Yamada [this message]
2017-08-23  0:40   ` Rob Herring

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=CAK7LNATfeDk0rFjspEM08Y4R_3TKffE2dcBNCLnNn+t1G5YXew@mail.gmail.com \
    --to=yamada.masahiro@socionext.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hans.verkuil@cisco.com \
    --cc=jason@lakedaemon.net \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=robh+dt@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).