Requesting false output GPIO as IRQ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Linus, Bartosz,

If request_irq() is called on an otherwise unused GPIO that was
incorrectly configured for output by the firmware, this fails with:

    gpio gpiochip2: (e6052000.gpio): gpiochip_lock_as_irq: tried to
flag a GPIO set as output for IRQ
    gpio gpiochip2: (e6052000.gpio): unable to lock HW IRQ 22 for IRQ
    genirq: Failed to request resources for 0-0020 (irq 142) on
irqchip e6052000.gpio

This happens since commit ad817297418539b8 ("gpio: rcar: Implement
.get_direction() callback"), as the (default) input state is changed to
output by reading the hardware state.  Without that callback, the code
just continues.

While I strongly agree the firmware should be fixed not to configure
random GPIOs as outputs, shouldn't Linux just override this, if the GPIO
is not marked in use (has not been requested)?

What is your opinion on this?
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux