Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1700700 > unrolled thread

Re: [RFC/RFT PATCH 3/3] gpiolib: make gpio irqchip compatible with sparse_irq

Started byLinus Walleij <linus.walleij@linaro.org>
First post2017-08-01 09:50 +0200
Last post2017-08-01 09:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [RFC/RFT PATCH 3/3] gpiolib: make gpio irqchip compatible with sparse_irq Linus Walleij <linus.walleij@linaro.org> - 2017-08-01 09:50 +0200

#1700700 — Re: [RFC/RFT PATCH 3/3] gpiolib: make gpio irqchip compatible with sparse_irq

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-08-01 09:50 +0200
SubjectRe: [RFC/RFT PATCH 3/3] gpiolib: make gpio irqchip compatible with sparse_irq
Message-ID<u9A6d-mj-1@gated-at.bofh.it>
On Sun, Jul 9, 2017 at 12:44 AM, Grygorii Strashko
<grygorii.strashko@ti.com> wrote:

> Now IRQ mappings are always created for all (allowed) GPIOs in gpio irqchip in
> gpiochip_irqchip_add_key() which goes against the idea of SPARSE_IRQ and,
> as result, leads to:
>  - increasing of memory consumption because of allocated IRQ descriptors most
> of which will never ever be used (especially on platform with a
> high number of GPIOs)
>  - imposibility to use GPIO irqchip APIs by gpio drivers when HW implements
> GPIO IRQ functionality as IRQ crossbar/multiplexer which has only limited
> number of IRQ outputs (example from [1], all GPIOs can be mapped on only 8
> IRQs).
>
> Hence, remove static IRQ mapping code from gpiochip_irqchip_add_key() and
> instead replace irq_find_mapping() with irq_create_mapping() in
> gpiochip_to_irq(). Also add additional gpiochip_irqchip_irq_valid() calls
> in gpiochip_to_irq() and gpiochip_irq_map().
>
> After this change gpio2irq mapping will happen the following way when GPIO
> irqchip APIs are used by gpio driver:
>  - IRQ mappings will be created statically if driver passes first_irq>0
> vlaue in gpiochip_irqchip_add_key().
>  - IRQ mappings will be created dynamically from gpio_to_irq() or
> of_irq_get().
>
> [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1435847.html
> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>

This is obviously better and what I should have done from the beginning
had I only been smart enough, so what better to do than to throw this in
now for -next and see what happens :)

Patch applied.

Yours,
Linus Walleij

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web