From: Shawn Guo <shawn.guo@linaro.org>
To: Marc Zyngier <maz@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Maulik Shah <quic_mkshah@quicinc.com>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
Loic Poulain <loic.poulain@linaro.org>,
devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] irqchip: Add Qualcomm MPM controller driver
Date: Wed, 1 Dec 2021 15:36:25 +0800 [thread overview]
Message-ID: <20211201073622.GJ10105@dragon> (raw)
In-Reply-To: <87fsrdncsg.wl-maz@kernel.org>
On Tue, Nov 30, 2021 at 10:44:15AM +0000, Marc Zyngier wrote:
> On Tue, 30 Nov 2021 09:17:08 +0000,
> Shawn Guo <shawn.guo@linaro.org> wrote:
> >
> > On Tue, Nov 30, 2021 at 08:42:53AM +0000, Marc Zyngier wrote:
> > > On Tue, 30 Nov 2021 02:31:52 +0000,
> > > Shawn Guo <shawn.guo@linaro.org> wrote:
> > > >
> > > > + Maulik
> > > >
> > > > On Mon, Nov 29, 2021 at 03:24:39PM +0000, Marc Zyngier wrote:
> > > > [...]
> > > > > > > > @@ -430,6 +430,14 @@ config QCOM_PDC
> > > > > > > > Power Domain Controller driver to manage and configure wakeup
> > > > > > > > IRQs for Qualcomm Technologies Inc (QTI) mobile chips.
> > > > > > > >
> > > > > > > > +config QCOM_MPM
> > > > > > > > + bool "QCOM MPM"
> > > > > > >
> > > > > > > Can't be built as a module?
> > > > > >
> > > > > > The driver is implemented as a builtin_platform_driver().
> > > > >
> > > > > This, on its own, shouldn't preclude the driver from being built as a
> > > > > module. However, the config option only allows it to be built in. Why?
> > > >
> > > > I just tried to build it as a module, and it seems that "irq_to_desc" is
> > > > only available for built-in build.
> > >
> > > Yet another thing that you should not be using. The irqdomain code
> > > gives you everything you need without having to resort to the
> > > internals of the core IRQ infrastructure.
> >
> > I see. I should use irq_get_irq_data() rather than &desc->irq_data.
>
> Even better:
>
> desc = irq_resolve_mapping(domain, hwirq);
>
> Job done. No extra tracking, no dubious hack in the unmask callback,
> works with modules.
>
> >
> > >
> > > > > Furthermore, why would you look up anywhere other than the wake-up
> > > > > domain? My impression was that only these interrupts would require
> > > > > being re-triggered.
> > > >
> > > > Both domains have MPM pins that could wake up system.
> > >
> > > Then why do you need two domains?
> >
> > This is basically the same situation as qcom-pdc, and I have some
> > description about that in the commit log:
> >
> > - For given SoC, a fixed number of MPM pins are supported, e.g. 96 pins
> > on QCM2290. Each of these MPM pins can be either a MPM_GIC pin or
> > a MPM_GPIO pin. The mapping between MPM_GIC pin and GIC interrupt
> > is defined by SoC, as well as the mapping between MPM_GPIO pin and
> > GPIO number. The former mapping can be found as the SoC data in this
> > MPM driver, while the latter can be found as the msm_gpio_wakeirq_map[]
> > in TLMM driver.
> >
> > - Two irq domains are created for a single irq_chip to handle MPM_GIC
> > and MPM_GPIO pins respectively, i.e. MPM_GIC domain and MPM_GPIO domain.
> > The former is a child domain of GIC irq domain, while the latter is
> > a parent domain of TLMM/GPIO irq domain.
>
> That doesn't answer my question.
>
> It doesn't matter what the pins are used for as long as you can
> identify which ones are routed to the GIC and which are not. You are
> obviously are able to do so, since you are able to disconnect part of
> the hierarchy (why is qcom_mpm_gic_alloc() named as such, since most
> of the interrupts it deals with are *never* routed to the GIC).
>
> All the interrupts have the same irqchip callbacks and act on the same
> 'priv' data, so they it is obvious they don't overlap in the hwirq
> space.
>
> Ergo: you can implement the whole thing with a single domain. All you
> need to make sure is that you identify the pins that are routed to the
> GIC, and you already have that information.
You are right! A single domain works. Nice and clean! Thanks for the
comment, Marc!
Shawn
next prev parent reply other threads:[~2021-12-01 7:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 9:35 [PATCH v2 0/2] Add Qualcomm MPM irqchip driver support Shawn Guo
2021-11-26 9:35 ` [PATCH v2 1/2] dt-bindings: interrupt-controller: Add Qualcomm MPM support Shawn Guo
2021-12-01 23:02 ` Rob Herring
2021-11-26 9:35 ` [PATCH v2 2/2] irqchip: Add Qualcomm MPM controller driver Shawn Guo
2021-11-26 15:13 ` Marc Zyngier
2021-11-26 19:19 ` Marc Zyngier
2021-11-29 13:33 ` Shawn Guo
2021-11-29 15:24 ` Marc Zyngier
2021-11-30 2:31 ` Shawn Guo
2021-11-30 8:42 ` Marc Zyngier
2021-11-30 9:17 ` Shawn Guo
2021-11-30 10:44 ` Marc Zyngier
2021-12-01 7:36 ` Shawn Guo [this message]
[not found] ` <2e821841-a921-3fda-9ee6-3d5127653033@quicinc.com>
2021-11-30 8:31 ` Shawn Guo
2021-11-30 8:52 ` Marc Zyngier
2021-11-30 8:54 ` Maulik Shah
2021-11-30 8:47 ` Marc Zyngier
2021-11-27 7:49 ` kernel test robot
2021-11-29 7:23 ` Maulik Shah
2021-11-29 13:45 ` Shawn Guo
2021-11-30 8:26 ` Maulik Shah
2021-11-30 8:44 ` Shawn Guo
2021-11-30 9:04 ` Maulik Shah
2021-11-30 9:26 ` Shawn Guo
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=20211201073622.GJ10105@dragon \
--to=shawn.guo@linaro.org \
--cc=bjorn.andersson@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=maz@kernel.org \
--cc=quic_mkshah@quicinc.com \
--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).