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:	Wed, 12 Feb 2014 10:17:02 -0600
From:	delicious quinoa <delicious.quinoa@...il.com>
To:	Linus Walleij <linus.walleij@...aro.org>
Cc:	Linus Walleij <linus.walleij@...aro.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
	Jamie Iles <jamie@...ieiles.com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Mark Rutland <mark.rutland@....com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Steffen Trumtrar <s.trumtrar@...gutronix.de>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	Heiko Stuebner <heiko@...ech.de>, Alan Tull <atull@...era.com>,
	Dinh Nguyen <dinguyen@...era.com>,
	Yves Vandervennet <rocket.yvanderv@...il.com>
Subject: Re: [PATCH v11] gpio: add a driver for the Synopsys DesignWare APB
 GPIO block

On Mon, Feb 10, 2014 at 5:06 AM, Linus Walleij <linus.walleij@...aro.org> wrote:
> Hi Alan, this is starting to look good. I's like an ACK from a DT
> maintainer on the bindings but can't see anything really controversial
> about them.
>
> On Thu, Feb 6, 2014 at 11:06 PM, Alan Tull <delicious.quinoa@...il.com> wrote:
>
>> +static int dwapb_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
>> +{
>> +       struct bgpio_chip *bgc = to_bgpio_chip(gc);
>> +       struct dwapb_gpio_port *port = container_of(bgc, struct
>> +                                                   dwapb_gpio_port, bgc);
>> +       struct dwapb_gpio *gpio = port->gpio;
>> +
>> +       return irq_create_mapping(gpio->domain, offset);
>> +}
>
> I think you want to call irq_find_mapping() here. irq_create_mapping()
> should be called for all valid IRQs on probe() instead.
>
>> +               ct = irq_gc->chip_types;
>> +               ct->chip.irq_ack = irq_gc_ack_set_bit;
>> +               ct->chip.irq_mask = irq_gc_mask_set_bit;
>> +               ct->chip.irq_unmask = irq_gc_mask_clr_bit;
>> +               ct->chip.irq_set_type = dwapb_irq_set_type;
>> +               ct->chip.irq_enable = dwapb_irq_enable;
>> +               ct->chip.irq_disable = dwapb_irq_disable;
>> +               ct->regs.ack = GPIO_PORTA_EOI;
>> +               ct->regs.mask = GPIO_INTMASK;
>
> Please add .startup() and .shutdown() callbacks marking the
> respective lines as IRQs, compare to recent patches in the
> GPIO subsystem such as this:
> http://marc.info/?l=linux-gpio&m=138546100215235&w=2
>
> You probably want to call irq_create_mapping() for each
> valid IRQ after registering the chip in this function.

Hi Linus,

Thanks for the feedback.  I am working on making these changes.  The
startup/shutdown were easy to add.

I am wondering about the change in usage of
irq_find_mapping/irq_create_mapping.  It seems like all the GPIO
drivers that use irq domains do it the way I was doing it (that's
where I got the idea in the first place): irq_create_mapping is used
in the to_irq() function.  I guess this is a general direction all the
other drivers will be encouraged to go in also?

Regards,
Alan


>
> 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