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]
Date:	Tue, 9 Apr 2013 10:23:03 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Kukjin Kim <kgene.kim@...sung.com>
Cc:	linux-samsung-soc <linux-samsung-soc@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Thomas Abraham <thomas.ab@...sung.com>
Subject: Re: [PATCH 2/3] pinctrl: exynos5440: add gpio interrupt support

On Tue, Mar 26, 2013 at 4:12 PM, Kukjin Kim <kgene.kim@...sung.com> wrote:

> From: Thomas Abraham <thomas.ab@...sung.com>
>
> Exynos5440 supports gpio interrupts on gpios 16 to 23. The eight interrupt lines
> originating from the pin-controller are connected to the gic. Add irq-chip support
> for these interrupts.
>
> Signed-off-by: Thomas Abraham <thomas.ab@...sung.com>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Kukjin Kim <kgene.kim@...sung.com>

Basically really nice. Patch has been applied, but some comments
for future reference:

> +/* gpiolib gpio_to_irq callback function */
> +static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
> +{
> +       struct exynos5440_pinctrl_priv_data *priv = dev_get_drvdata(gc->dev);
> +       unsigned int virq;

I'm a bit annoyed by use of the abbreviation "virq" as if the IRQs were
"virtual", they are not - this implies that the Linux IRQ numbers are not
"real" or something.

I use the nomenclature:

irq = Linux IRQ
hwirq = whatever offset that IRQ has in the hardware IRQ controller.

virq I think is confusing...

> +static irqreturn_t exynos5440_gpio_irq(int irq, void *data)
> +{
> +       struct exynos5440_gpio_intr_data *intd = data;
> +       struct exynos5440_pinctrl_priv_data *d = intd->priv;
> +       int virq;
> +
> +       virq = irq_linear_revmap(d->irq_domain, intd->gpio_int);
> +       if (!virq)
> +               return IRQ_NONE;
> +       generic_handle_irq(virq);
> +       return IRQ_HANDLED;
> +}

Same here. Actually, I guess irq_linear_revmap works here,
but irq_find_mapping(domain, hwirq) is more archaic, could
you test if that works as well and make a follow-up patch to
change it?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ