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:	Mon, 3 Aug 2015 11:34:23 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Rabin Vincent <rabin@....in>
Cc:	Alexandre Courbot <gnurou@...il.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] gpio: etraxfs: add interrupt support

On Fri, Jul 31, 2015 at 2:48 PM, Rabin Vincent <rabin@....in> wrote:

> On ETRAX FS, all pins on the first port (and only the first port) have
> interrupt support.
>
> On ARTPEC-3, all pins on all ports have interrupt support.  However,
> there are only eight interrupts.  Each of the interrupts is associated
> with a group of pins and for each interrupt the one pin from the group
> which will trigger it can be selected.
>
> Signed-off-by: Rabin Vincent <rabin@....in>

Hm wait now I get confused ... probably tripping over my own shoelaces
as usual but help me here:

> +static void etraxfs_gpio_irq_ack(struct irq_data *d)
> +{
> +       struct etraxfs_gpio_chip *chip = irq_data_get_irq_chip_data(d);

I don't see how this works in the irqchip functions.

Usually the chip data is the struct gpio_chip when using the
GPIOLIB_IRQCHIP, then we use some container_of to boil
out the containing struct, like:

static inline struct extraxfs_gpio_chip *to_etraxfs(struct gpio_chip *chip)
{
        return container_of(chip, struct etraxfs_gpio_chip, bgc.gc);
}

So it would be:

struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct etraxfs_gpio_chip *chip = to_etraxfs(gc);

so how did you manage to replace that pointer with a pointer
to your struct etraxfs_gpio_chip?

> +               ret = gpiochip_irqchip_add(&bgc->gc, &etraxfs_gpio_irq_chip, 0,
> +                                          handle_level_irq, IRQ_TYPE_NONE);

Because this sets the irqdomain host_data to gc, then the
irqdomain .map function sets the chip data to the same.

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