Re: Requesting false output GPIO as IRQ

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

 



wt., 26 lut 2019 o 11:01 Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> napisał(a):
>
> 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!
>

I think you're right about overriding this, because it's not only the
firmware that can change the configuration. Let's imagine user-space
that sets a GPIO, then releases it - it now stays configured as
output. We should probably force input in this case and maybe just
hint it with a pr_debug()?

Bart




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux