All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Andy Shevchenko <andy@kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Platform Driver <platform-driver-x86@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH 2/2] gpio: crystalcove: Set IRQ domain bus token to DOMAIN_BUS_WIRED
Date: Sat, 25 Dec 2021 16:44:51 +0200	[thread overview]
Message-ID: <CAHp75Vd5shpgHFUacof_ythr-ZcgPY+CV58wcZ37jNyF-0PFcg@mail.gmail.com> (raw)
In-Reply-To: <20211225120026.95268-2-hdegoede@redhat.com>

On Sat, Dec 25, 2021 at 2:00 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> For the CRC PMIC we end up with multiple irq-domains with the same fwnode.
> One for the irqchip which demultiplexes the actual PMIC interrupt into
> interrupts for the various cells (known as the level 1 interrupts);
>
> And 2 more for the irqchips which are part of the crystal_cove_gpio
> and crystal_cove_charger cells.
>
> This leads to the following error being printed when
> CONFIG_GENERIC_IRQ_DEBUGFS is enabled:
>  debugfs: File '\_SB.I2C7.PMIC' in directory 'domains' already present!
>
> Set the bus token of the main IRQ domain to DOMAIN_BUS_WIRED to avoid
> this error, this also allows irq_find_matching_fwspec() to find the
> right domain if necessary.
>
> Note all 3 domain registering drivers need to set the IRQ domain bus token.
> This is necessary because the IRQ domain code defaults to creating
> the debugfs dir with just the fwnode name and then renames it when
> the bus token is set. So each one starts with the same default name and
> all 3 must be given a different name to avoid problems when one of the
> other drivers loads and starts with the same default name.

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/gpio/gpio-crystalcove.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
> index 5a909f3c79e8..b55c74a5e064 100644
> --- a/drivers/gpio/gpio-crystalcove.c
> +++ b/drivers/gpio/gpio-crystalcove.c
> @@ -370,7 +370,14 @@ static int crystalcove_gpio_probe(struct platform_device *pdev)
>                 return retval;
>         }
>
> -       return devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
> +       retval = devm_gpiochip_add_data(&pdev->dev, &cg->chip, cg);
> +       if (retval)
> +               return retval;
> +
> +       /* Distuingish IRQ domain from others sharing (MFD) the same fwnode */
> +       irq_domain_update_bus_token(cg->chip.irq.domain, DOMAIN_BUS_WIRED);
> +
> +       return 0;
>  }
>
>  static struct platform_driver crystalcove_gpio_driver = {
> --
> 2.33.1
>


-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2021-12-25 14:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-25 12:00 [PATCH 1/2] gpio: tps68470: Allow building as module Hans de Goede
2021-12-25 12:00 ` [PATCH 2/2] gpio: crystalcove: Set IRQ domain bus token to DOMAIN_BUS_WIRED Hans de Goede
2021-12-25 14:44   ` Andy Shevchenko [this message]
2021-12-25 14:41 ` [PATCH 1/2] gpio: tps68470: Allow building as module Andy Shevchenko
2022-01-04 14:08   ` Andy Shevchenko
2022-01-11 10:42     ` Hans de Goede

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=CAHp75Vd5shpgHFUacof_ythr-ZcgPY+CV58wcZ37jNyF-0PFcg@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=hdegoede@redhat.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=platform-driver-x86@vger.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 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.