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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Feb 2023 06:16:44 -0500
From:   William Breathitt Gray <william.gray@...aro.org>
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>,
        Romain Perier <romain.perier@...il.com>,
        Grygorii Strashko <grygorii.strashko@...com>,
        Santosh Shilimkar <ssantosh@...nel.org>,
        Kevin Hilman <khilman@...nel.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 16/17] gpio: pci-idio-16: Convert to immutable irq_chip

On Thu, Feb 16, 2023 at 10:37:17AM +0100, Linus Walleij wrote:
> Convert the driver to immutable irq-chip with a bit of
> intuition.
> 
> Cc: Marc Zyngier <maz@...nel.org>
> Signed-off-by: Linus Walleij <linus.walleij@...aro.org>

FYI, I'm migrating pci-idio-16 to the regmap-irq API soon, so this patch
might not be necessary once the code is removed. Anyway, here's my ack
in case this patch series is merged first.

Acked-by: William Breathitt Gray <william.gray@...aro.org>

> ---
>  drivers/gpio/gpio-pci-idio-16.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-pci-idio-16.c b/drivers/gpio/gpio-pci-idio-16.c
> index a86ce748384b..6726c32e31e6 100644
> --- a/drivers/gpio/gpio-pci-idio-16.c
> +++ b/drivers/gpio/gpio-pci-idio-16.c
> @@ -107,6 +107,8 @@ static void idio_16_irq_mask(struct irq_data *data)
>  
>  		raw_spin_unlock_irqrestore(&idio16gpio->lock, flags);
>  	}
> +
> +	gpiochip_disable_irq(chip, irqd_to_hwirq(data));
>  }
>  
>  static void idio_16_irq_unmask(struct irq_data *data)
> @@ -117,6 +119,8 @@ static void idio_16_irq_unmask(struct irq_data *data)
>  	const unsigned long prev_irq_mask = idio16gpio->irq_mask;
>  	unsigned long flags;
>  
> +	gpiochip_enable_irq(chip, irqd_to_hwirq(data));
> +
>  	idio16gpio->irq_mask |= mask;
>  
>  	if (!prev_irq_mask) {
> @@ -138,12 +142,14 @@ static int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)
>  	return 0;
>  }
>  
> -static struct irq_chip idio_16_irqchip = {
> +static const struct irq_chip idio_16_irqchip = {
>  	.name = "pci-idio-16",
>  	.irq_ack = idio_16_irq_ack,
>  	.irq_mask = idio_16_irq_mask,
>  	.irq_unmask = idio_16_irq_unmask,
> -	.irq_set_type = idio_16_irq_set_type
> +	.irq_set_type = idio_16_irq_set_type,
> +	.flags = IRQCHIP_IMMUTABLE,
> +	GPIOCHIP_IRQ_RESOURCE_HELPERS,
>  };
>  
>  static irqreturn_t idio_16_irq_handler(int irq, void *dev_id)
> @@ -242,7 +248,7 @@ static int idio_16_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	idio_16_state_init(&idio16gpio->state);
>  
>  	girq = &idio16gpio->chip.irq;
> -	girq->chip = &idio_16_irqchip;
> +	gpio_irq_chip_set_chip(girq, &idio_16_irqchip);
>  	/* This will let us handle the parent IRQ in the driver */
>  	girq->parent_handler = NULL;
>  	girq->num_parents = 0;
> 
> -- 
> 2.34.1
> 

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ