lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ed6472a7-5bd8-25bd-e2bc-f88f97a82607@ti.com>
Date:   Wed, 11 Mar 2020 10:26:47 +0530
From:   Lokesh Vutla <lokeshvutla@...com>
To:     Tim Harvey <tharvey@...eworks.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

Hi Tim,

On 11/03/20 4:57 AM, Tim Harvey wrote:
> 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.

Returning -ENOSYS is the right behaviour. If the parent doesn't have the
resources, child driver should not hook it at all.

> 
> 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?

If there are no parent resources why should  thunderx-gpio request parent
resources at all?

Thanks and regards,
Lokesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ