diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/irq/manage.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 2ff1c0c82fc9..0f922729bab9 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -1246,7 +1246,18 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) * set the trigger type must match. Also all must * agree on ONESHOT. */ - unsigned int oldtype = irqd_get_trigger_type(&desc->irq_data); + unsigned int oldtype; + + /* + * If nobody did set the configuration before, inherit + * the one provided by the requester. + */ + if (irqd_trigger_type_was_set(&desc->irq_data)) { + oldtype = irqd_get_trigger_type(&desc->irq_data); + } else { + oldtype = new->flags & IRQF_TRIGGER_MASK; + irqd_set_trigger_type(&desc->irq_data, oldtype); + } if (!((old->flags & new->flags) & IRQF_SHARED) || (oldtype != (new->flags & IRQF_TRIGGER_MASK)) || |