linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Alexander A Sverdlin <alexander.sverdlin@nokia.com>,
	Marc Zyngier <maz@kernel.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH] gpio: pl061: Support implementations without GPIOINTR line
Date: Sat, 20 Mar 2021 12:28:11 +0100	[thread overview]
Message-ID: <CACRpkdbnc2UHM8w85DjsoMKoim-pSX7-7c2YOUnUDdthNc9Vpw@mail.gmail.com> (raw)
In-Reply-To: <20210317155919.41450-2-alexander.sverdlin@nokia.com>

Hi Alexander,

I think I answered some stuff around this patch in my previous
mail but just reiterating so it's clear:

On Wed, Mar 17, 2021 at 4:59 PM Alexander A Sverdlin
<alexander.sverdlin@nokia.com> wrote:

> @@ -426,6 +426,7 @@ config GPIO_PL061
>         depends on ARM_AMBA
>         select IRQ_DOMAIN
>         select GPIOLIB_IRQCHIP
> +       select IRQ_DOMAIN_HIERARCHY

I think this needs to be optional otherwise you activate hierarchical
IRQs on a lot of systems that don't have it.

select IRQ_DOMAIN_HIERARCHY if ARCH_OMAP_...

This leads to having to use some if IS_ENABLED and
maybe even ifdef to make it compile without hierarchies.

> +       if (!adev->irq[PL061_GPIO_NR - 1]) {
> +               WARN_ON(adev->irq[1]);
> +
> +               girq->parent_handler = pl061_irq_handler;
> +               girq->num_parents = 1;
> +               girq->parents = devm_kcalloc(dev, 1, sizeof(*girq->parents),
> +                                            GFP_KERNEL);
> +               if (!girq->parents)
> +                       return -ENOMEM;
> +               girq->parents[0] = irq;
> +       } else {
> +               girq->fwnode = dev->fwnode;
> +               girq->parent_domain =
> +                       irq_get_irq_data(adev->irq[PL061_GPIO_NR - 1])->domain;
> +               girq->child_to_parent_hwirq = pl061_child_to_parent_hwirq;
> +       }

This is starting to look right :)

But use the top-level board DT compatible to determine that
hiearchy is needed, and implement a per-soc child_to_parent_hwirq()
and do not attempt to get the IRQs from the device tree.

Yours,
Linus Walleij

  parent reply	other threads:[~2021-03-20 11:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210317155919.41450-1-alexander.sverdlin@nokia.com>
2021-03-17 15:59 ` [PATCH] gpio: pl061: Support implementations without GPIOINTR line Alexander A Sverdlin
2021-03-18  8:04   ` Alexander Sverdlin
2021-03-20 11:28   ` Linus Walleij [this message]
2021-03-22  8:52     ` Alexander Sverdlin
2021-03-22  9:32       ` Linus Walleij
2021-03-22  9:46         ` Alexander Sverdlin
2021-03-22 12:04           ` Linus Walleij
2021-03-22 12:17             ` Linus Walleij
2021-03-22 12:36               ` Alexander Sverdlin
2021-03-22 12:49                 ` Linus Walleij
2021-03-17 15:59 ` [PATCH] gpio: pl061: Warn when IRQ line has not been configured Alexander A Sverdlin
     [not found]   ` <CAHp75Vd-iUzEyo5X5LtKJ+66512i5-tKC+kkpPYJwG7L2qrvdw@mail.gmail.com>
2021-03-18 11:11     ` Alexander Sverdlin
2021-03-18 12:19       ` Andy Shevchenko

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=CACRpkdbnc2UHM8w85DjsoMKoim-pSX7-7c2YOUnUDdthNc9Vpw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=alexander.sverdlin@nokia.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=maz@kernel.org \
    /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).