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: <CABgxDoLkhOR=eq5TAoLk-GfOvPgKzbRyedaM+j-8YsRYn27DMw@mail.gmail.com>
Date:   Fri, 10 Mar 2023 09:06:38 +0100
From:   Romain Perier <romain.perier@...il.com>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Mun Yew Tham <mun.yew.tham@...el.com>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Joel Stanley <joel@....id.au>,
        Andrew Jeffery <andrew@...id.au>, Alban Bedel <albeu@...e.fr>,
        Orson Zhai <orsonzhai@...il.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Chunyan Zhang <zhang.lyra@...il.com>,
        Jay Fang <f.fangjian@...wei.com>,
        Daniel Palmer <daniel@...ngy.jp>,
        Santosh Shilimkar <ssantosh@...nel.org>,
        Kevin Hilman <khilman@...nel.org>,
        William Breathitt Gray <william.gray@...aro.org>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-aspeed@...ts.ozlabs.org, linux-omap@...r.kernel.org,
        Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH v3 11/17] gpio: msc313: Convert to immutable irq_chip

Le jeu. 9 mars 2023 à 08:46, Linus Walleij <linus.walleij@...aro.org> a écrit :
>
> Convert the driver to immutable irq-chip with a bit of
> intuition.
>
> This conversion follows the pattern of the gpio-ixp4xx
> hierarchical GPIO interrupt driver.

Hi,

lgtm

>
> Cc: Marc Zyngier <maz@...nel.org>
> Acked-by: Marc Zyngier <maz@...nel.org>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>

Reviewed-by: Romain Perier <romain.perier@...il.com>

> ---
>  drivers/gpio/gpio-msc313.c | 26 ++++++++++++++++++++++----
>  1 file changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c
> index b0773e5652fa..036ad2324892 100644
> --- a/drivers/gpio/gpio-msc313.c
> +++ b/drivers/gpio/gpio-msc313.c
> @@ -532,17 +532,35 @@ static int msc313_gpio_direction_output(struct gpio_chip *chip, unsigned int off
>         return 0;
>  }
>
> +static void msc313_gpio_irq_mask(struct irq_data *d)
> +{
> +       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> +
> +       irq_chip_mask_parent(d);
> +       gpiochip_disable_irq(gc, d->hwirq);
> +}
> +
> +static void msc313_gpio_irq_unmask(struct irq_data *d)
> +{
> +       struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> +
> +       gpiochip_enable_irq(gc, d->hwirq);
> +       irq_chip_unmask_parent(d);
> +}
> +
>  /*
>   * The interrupt handling happens in the parent interrupt controller,
>   * we don't do anything here.
>   */
> -static struct irq_chip msc313_gpio_irqchip = {
> +static const struct irq_chip msc313_gpio_irqchip = {
>         .name = "GPIO",
>         .irq_eoi = irq_chip_eoi_parent,
> -       .irq_mask = irq_chip_mask_parent,
> -       .irq_unmask = irq_chip_unmask_parent,
> +       .irq_mask = msc313_gpio_irq_mask,
> +       .irq_unmask = msc313_gpio_irq_unmask,
>         .irq_set_type = irq_chip_set_type_parent,
>         .irq_set_affinity = irq_chip_set_affinity_parent,
> +       .flags = IRQCHIP_IMMUTABLE,
> +       GPIOCHIP_IRQ_RESOURCE_HELPERS,
>  };
>
>  /*
> @@ -644,7 +662,7 @@ static int msc313_gpio_probe(struct platform_device *pdev)
>         gpiochip->names = gpio->gpio_data->names;
>
>         gpioirqchip = &gpiochip->irq;
> -       gpioirqchip->chip = &msc313_gpio_irqchip;
> +       gpio_irq_chip_set_chip(gpioirqchip, &msc313_gpio_irqchip);
>         gpioirqchip->fwnode = of_node_to_fwnode(dev->of_node);
>         gpioirqchip->parent_domain = parent_domain;
>         gpioirqchip->child_to_parent_hwirq = msc313e_gpio_child_to_parent_hwirq;
>
> --
> 2.34.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ