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, 13 Mar 2013 18:20:32 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Magnus Damm <magnus.damm@...il.com>
Cc:	linux-kernel@...r.kernel.org, grant.likely@...retlab.ca,
	horms@...ge.net.au, linux-sh@...r.kernel.org
Subject: Re: [PATCH] gpio: Renesas R-Car GPIO driver

On Tue, Mar 5, 2013 at 1:32 AM, Magnus Damm <magnus.damm@...il.com> wrote:

> +static int gpio_rcar_irq_set_type(struct irq_data *d, unsigned int type)
> +{
> +       struct gpio_rcar_priv *p = irq_data_get_irq_chip_data(d);
> +       unsigned int hwirq = irqd_to_hwirq(d);
> +
> +       pr_debug("gpio: sense irq = %d, type = %d\n", hwirq, type);
> +
> +       switch (type & IRQ_TYPE_SENSE_MASK) {
> +       case IRQ_TYPE_LEVEL_HIGH:
> +               gpio_rcar_config_interrupt_input_mode(p, hwirq, true, true);
> +               break;
> +       case IRQ_TYPE_LEVEL_LOW:
> +               gpio_rcar_config_interrupt_input_mode(p, hwirq, false, true);
> +               break;
> +       case IRQ_TYPE_EDGE_RISING:
> +               gpio_rcar_config_interrupt_input_mode(p, hwirq, true, false);
> +               break;
> +       case IRQ_TYPE_EDGE_FALLING:
> +               gpio_rcar_config_interrupt_input_mode(p, hwirq, false, false);
> +               break;

It is quite common to request IRQ on *both* rising and falling edges,
what happens then?

See <linux/irqs.h>
        IRQ_TYPE_EDGE_RISING    = 0x00000001,
        IRQ_TYPE_EDGE_FALLING   = 0x00000002,
        IRQ_TYPE_EDGE_BOTH      = (IRQ_TYPE_EDGE_FALLING |
IRQ_TYPE_EDGE_RISING),

I guess then you get just rising edge...


> +       default:
> +               return -EINVAL;
> +       }
> +       return 0;
> +}

(...)

The rest I think is already covered by Laurent's comments.

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