[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ+vNU2gnKKxX2YL1JUSnpF7qNqKVAsPhC2emv=Y79HPJbZXzw@mail.gmail.com>
Date: Tue, 10 Mar 2020 16:27:31 -0700
From: Tim Harvey <tharvey@...eworks.com>
To: Lokesh Vutla <lokeshvutla@...com>
Cc: Marc Zyngier <marc.zyngier@....com>,
Santosh Shilimkar <ssantosh@...nel.org>,
Rob Herring <robh+dt@...nel.org>, Nishanth Menon <nm@...com>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Linux ARM Mailing List <linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>,
Tero Kristo <t-kristo@...com>, Sekhar Nori <nsekhar@...com>,
Tony Lindgren <tony@...mide.com>,
Linus Walleij <linus.walleij@...aro.org>,
Peter Ujfalusi <peter.ujfalusi@...com>,
Grygorii Strashko <grygorii.strashko@...com>,
Device Tree Mailing List <devicetree@...r.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH v8 07/14] gpio: thunderx: Use the default parent apis for {request,release}_resources
On Tue, Apr 30, 2019 at 3:14 AM Lokesh Vutla <lokeshvutla@...com> wrote:
>
> thunderx_gpio_irq_{request,release}_resources apis are trying to
> {request,release} resources on parent interrupt. There are default
> apis doing the same. Use the default parent apis instead of writing
> the same code snippet.
>
> Cc: linux-gpio@...r.kernel.org
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Acked-by: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Lokesh Vutla <lokeshvutla@...com>
> ---
> Changes since v7:
> - None
>
> drivers/gpio/gpio-thunderx.c | 16 ++++------------
> 1 file changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c
> index 1306722faa5a..715371b5102a 100644
> --- a/drivers/gpio/gpio-thunderx.c
> +++ b/drivers/gpio/gpio-thunderx.c
> @@ -363,22 +363,16 @@ 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;
>
> - if (parent_data && parent_data->chip->irq_request_resources) {
> - r = parent_data->chip->irq_request_resources(parent_data);
> - if (r)
> - goto error;
> - }
> + r = irq_chip_request_resources_parent(data);
> + if (r)
> + gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
Lokesh,
This patch breaks irq resources for thunderx-gpio as
parent_data->chip->irq_request_resources is undefined thus your new
irq_chip_request_resources_parent() returns -ENOSYS causing this
function to return an error where as before it would happily return 0.
Is the following the correct fix or should we qualify
data->parent_data->chip->irq_request_resources before calling
irq_chip_request_resources_parent() in thunderx-gpio?
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index b3fa2d8..b2435ecb 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -1525,7 +1525,7 @@ int irq_chip_request_resources_parent(struct
irq_data *data)
if (data->chip->irq_request_resources)
return data->chip->irq_request_resources(data);
- return -ENOSYS;
+ return 0;
}
EXPORT_SYMBOL_GPL(irq_chip_request_resources_parent);
Regards,
Tim
Powered by blists - more mailing lists