diff options
author | Tim Harvey <tharvey@gateworks.com> | 2020-05-28 07:58:34 -0700 |
---|---|---|
committer | Petr Štetiar <ynezz@true.cz> | 2020-06-03 16:49:28 +0200 |
commit | 3fd8e86079b21459c744b61b466b12c69ed3ab24 (patch) | |
tree | 01cef798e83094fa7c621a0ab16f5aef3a374383 /target | |
parent | c3f9598339c1c528dae2d0d7a2f5f5e3b48663e2 (diff) | |
download | upstream-3fd8e86079b21459c744b61b466b12c69ed3ab24.tar.gz upstream-3fd8e86079b21459c744b61b466b12c69ed3ab24.tar.bz2 upstream-3fd8e86079b21459c744b61b466b12c69ed3ab24.zip |
octeontx: fix gpio irq request
This fixes a regression in 5.4 that causes a crash when a driver requests
an ARM GPIO for an IRQ.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/octeontx/patches-5.4/0002-gpio-thunderx-fix-irq_request_resources.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/octeontx/patches-5.4/0002-gpio-thunderx-fix-irq_request_resources.patch b/target/linux/octeontx/patches-5.4/0002-gpio-thunderx-fix-irq_request_resources.patch new file mode 100644 index 0000000000..8c4de51aae --- /dev/null +++ b/target/linux/octeontx/patches-5.4/0002-gpio-thunderx-fix-irq_request_resources.patch @@ -0,0 +1,46 @@ +From e8287ec10f21877eb0ac4c1fb4e89e42d8bc10da Mon Sep 17 00:00:00 2001 +From: Tim Harvey <tharvey@gateworks.com> +Date: Wed, 11 Mar 2020 08:19:45 -0700 +Subject: [PATCH 2/7] gpio: thunderx: fix irq_request_resources + +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 715371b..feda2a2 100644 +--- a/drivers/gpio/gpio-thunderx.c ++++ b/drivers/gpio/gpio-thunderx.c +@@ -363,15 +363,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 + |