From: Kevin Hao <haokexin@gmail.com>
To: linux-gpio@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Kevin Hao <haokexin@gmail.com>
Subject: [PATCH 3/4] gpiolib: Add the support for the msi parent domain
Date: Tue, 14 Jan 2020 16:28:20 +0800 [thread overview]
Message-ID: <20200114082821.14015-4-haokexin@gmail.com> (raw)
In-Reply-To: <20200114082821.14015-1-haokexin@gmail.com>
If the gpio's parent irqdomain is a msi irqdomain, we should ignore
the EEXIST error returned by the msi irqdomain because all the msi
interrupts have already been allocated.
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
drivers/gpio/gpiolib.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index bedf611a7c9e..1cca9ab61923 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2037,6 +2037,12 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d,
chip_info(gc, "alloc_irqs_parent for %d parent hwirq %d\n",
irq, parent_hwirq);
ret = irq_domain_alloc_irqs_parent(d, irq, 1, parent_arg);
+ /*
+ * If the parent irqdomain is msi, the interrupts have already
+ * been allocated, so the EEXIST is good.
+ */
+ if (irq_domain_is_msi(d->parent) && (ret == -EEXIST))
+ ret = 0;
if (ret)
chip_err(gc,
"failed to allocate parent hwirq %d for hwirq %lu\n",
--
2.14.4
next prev parent reply other threads:[~2020-01-14 8:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-14 8:28 [PATCH 0/4] Fix the regression for the thunderx gpio Kevin Hao
2020-01-14 8:28 ` [PATCH 1/4] Revert "gpio: thunderx: Switch to GPIOLIB_IRQCHIP" Kevin Hao
2020-01-14 8:28 ` [PATCH 2/4] gpiolib: Add support for the irqdomain which doesn't use irq_fwspec as arg Kevin Hao
2020-01-14 8:28 ` Kevin Hao [this message]
2020-01-14 8:28 ` [PATCH 4/4] gpio: thunderx: Switch to GPIOLIB_IRQCHIP Kevin Hao
2020-01-15 10:20 ` [PATCH 0/4] Fix the regression for the thunderx gpio Linus Walleij
2020-03-10 20:40 ` Tim Harvey
2020-03-13 1:14 ` Kevin Hao
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=20200114082821.14015-4-haokexin@gmail.com \
--to=haokexin@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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 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).