From: Tim Harvey <tharvey@gateworks.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Robert Richter <rrichter@marvell.com>,
Lokesh Vutla <lokeshvutla@ti.com>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Tim Harvey <tharvey@gateworks.com>
Subject: [PATCH] gpio: thunderx: fix irq_request_resources
Date: Wed, 11 Mar 2020 08:43:53 -0700 [thread overview]
Message-ID: <1583941433-15876-1-git-send-email-tharvey@gateworks.com> (raw)
If there are no parent resources do not call irq_chip_request_resources_parent
at all as this will return an error.
This resolves a regression where devices using a thunderx gpio as an interrupt
would fail probing.
Fixes: 0d04d0c ("gpio: thunderx: Use the default parent apis for {request,release}_resources")
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
---
drivers/gpio/gpio-thunderx.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c
index 4627704..f84b9b1 100644
--- a/drivers/gpio/gpio-thunderx.c
+++ b/drivers/gpio/gpio-thunderx.c
@@ -366,15 +366,18 @@ static int thunderx_gpio_irq_request_resources(struct irq_data *data)
{
struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
struct thunderx_gpio *txgpio = txline->txgpio;
+ struct irq_data *parent_data = data->parent_data;
int r;
r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
if (r)
return r;
- r = irq_chip_request_resources_parent(data);
- if (r)
- gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
+ if (parent_data && parent_data->chip->irq_request_resources) {
+ r = irq_chip_request_resources_parent(data);
+ if (r)
+ gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
+ }
return r;
}
--
2.7.4
next reply other threads:[~2020-03-11 15:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 15:43 Tim Harvey [this message]
2020-03-12 13:42 ` [PATCH] gpio: thunderx: fix irq_request_resources Linus Walleij
2020-03-12 17:16 ` Tim Harvey
2020-03-13 15:01 ` Sasha Levin
2020-03-25 23:33 ` Linus Walleij
2020-03-13 15:31 ` Robert Richter
2020-03-13 19:12 ` Robert Richter
2020-03-13 19:41 ` Tim Harvey
2020-03-13 20:24 ` Robert Richter
2020-03-13 21:06 ` Tim Harvey
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=1583941433-15876-1-git-send-email-tharvey@gateworks.com \
--to=tharvey@gateworks.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lokeshvutla@ti.com \
--cc=rrichter@marvell.com \
/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