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: <CACRpkdaZwAg4X9QT4QMR2GSH6Cekc7Xuk+-pqhCyON-Y3cnCrA@mail.gmail.com>
Date:   Thu, 25 Mar 2021 09:13:51 +0100
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Andy Shevchenko <andy@...nel.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Jan Kiszka <jan.kiszka@...mens.com>
Subject: Re: [PATCH v5 1/2] gpio: sch: Add edge event support

On Wed, Mar 17, 2021 at 4:19 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:

> From: Jan Kiszka <jan.kiszka@...mens.com>
>
> Add the required infrastructure to enable and report edge events
> of the pins to the GPIO core. The actual hook-up of the event interrupt
> will happen separately.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@...mens.com>
> Co-developed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>

I can't believe it that nobody added irq support to this driver for 10
years given how widely deployed it is! (Good work.)

Don't you need to add

select GPIOLIB_IRQCHIP

to Kconfig? So the gpio_chip contains the .irq member you're using.

> +       sch->irqchip.name = "sch_gpio";
> +       sch->irqchip.irq_ack = sch_irq_ack;
> +       sch->irqchip.irq_mask = sch_irq_mask;
> +       sch->irqchip.irq_unmask = sch_irq_unmask;
> +       sch->irqchip.irq_set_type = sch_irq_type;
> +
> +       sch->chip.irq.chip = &sch->irqchip;
> +       sch->chip.irq.num_parents = 0;
> +       sch->chip.irq.parents = NULL;
> +       sch->chip.irq.parent_handler = NULL;
> +       sch->chip.irq.default_type = IRQ_TYPE_NONE;
> +       sch->chip.irq.handler = handle_bad_irq;

I always add a local variable like:

struct gpio_irq_chip *girq;

And assign with the arrow, so as to make it easier to read:

girq->parent_handler = NULL

etc.

+/- the above:
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ