Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932179AbdIGMZJ (ORCPT ); Thu, 7 Sep 2017 08:25:09 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:59238 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932139AbdIGMZH (ORCPT ); Thu, 7 Sep 2017 08:25:07 -0400 Subject: Re: [PATCH v4 2/6] irqdomain: clear trigger type in irq_domain_push_irq() To: Masahiro Yamada , Thomas Gleixner , Linus Walleij , linux-gpio@vger.kernel.org, Rob Herring Cc: Jassi Brar , devicetree@vger.kernel.org, Jason Cooper , Masami Hiramatsu , David Daney , linux-kernel@vger.kernel.org References: <1504784522-26841-1-git-send-email-yamada.masahiro@socionext.com> <1504784522-26841-3-git-send-email-yamada.masahiro@socionext.com> From: Marc Zyngier Organization: ARM Ltd Message-ID: Date: Thu, 7 Sep 2017 13:25:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1504784522-26841-3-git-send-email-yamada.masahiro@socionext.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1794 Lines: 52 On 07/09/17 12:41, Masahiro Yamada wrote: > Prior to the addition of irq_domain_push_irq(), the hierarchy > IRQ domain always allocates IRQs from the outer-most domain. > Each irqchip usually calls irq_domain_alloc_irqs_parent(), > ascending the topology up to the root irqchip. > > The brand-new function irq_domain_push_irq() allows us to allocate > IRQs for parent domain first, then add a child irq_data to the > tail of the chain. > > For the new use-case, if the parent sets a temporary trigger type, > it may differ from the type requested to the outer-most irqchip, > then irq_create_fwspec_mapping() warns "type mismatch, failed to map..." > > Clear the trigger type when a new irq_data is connected to the chain. > > Signed-off-by: Masahiro Yamada > --- > > Changes in v4: > - Newly added > > > kernel/irq/irqdomain.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c > index da3e0b6..18d11b9 100644 > --- a/kernel/irq/irqdomain.c > +++ b/kernel/irq/irqdomain.c > @@ -1532,6 +1532,9 @@ int irq_domain_push_irq(struct irq_domain *domain, int virq, void *arg) > tail_irq_data->chip = NULL; > tail_irq_data->chip_data = NULL; > > + /* clear the trigger type to avoid "type mismatch" error */ > + irqd_set_trigger_type(tail_irq_data, IRQ_TYPE_NONE); > + This feels wrong. The initial interrupt hierarchy does have a set trigger, because it has been configured already, and switching it to NONE is hiding the fact that you're setting it to another, conflicting value. Your new fwspec should have a type that is really compatible with with the underlying interrupt, however "temporary". If it is not, you have a problem. Thanks, M. -- Jazz is not dead. It just smells funny...