]> git.baikalelectronics.ru Git - kernel.git/commit
genirq: Track whether the trigger type has been set
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 9 Nov 2017 14:17:59 +0000 (14:17 +0000)
committerMarc Zyngier <marc.zyngier@arm.com>
Fri, 10 Nov 2017 09:49:48 +0000 (09:49 +0000)
commit123e05a63e056ca524af3db6f9d03d011e77c619
treeafefcfa5b445e3cbd33d7511c603c5e6c02cf000
parentbb64b7c09f6a8ee05789227b2be1352e2a3e0323
genirq: Track whether the trigger type has been set

When requesting a shared interrupt, we assume that the firmware
support code (DT or ACPI) has called irqd_set_trigger_type
already, so that we can retrieve it and check that the requester
is being reasonnable.

Unfortunately, we still have non-DT, non-ACPI systems around,
and these guys won't call irqd_set_trigger_type before requesting
the interrupt. The consequence is that we fail the request that
would have worked before.

We can either chase all these use cases (boring), or address it
in core code (easier). Let's have a per-irq_desc flag that
indicates whether irqd_set_trigger_type has been called, and
let's just check it when checking for a shared interrupt.
If it hasn't been set, just take whatever the interrupt
requester asks.

Fixes: a7234200df79 ("genirq: Use irqd_get_trigger_type to compare the trigger type for shared IRQs")
Cc: stable@vger.kernel.org
Reported-and-tested-by: Petr Cvek <petrcvekcz@gmail.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
include/linux/irq.h
kernel/irq/manage.c