From patchwork Thu Sep 7 11:41:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 111890 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp682263qge; Thu, 7 Sep 2017 04:45:35 -0700 (PDT) X-Google-Smtp-Source: ADKCNb5nW0xngABhla6UWLTN9E3XRXsq4+DKcyYBt/m6RTjYmgHTkvuXB3D5k3JJjce+RZcQIu83 X-Received: by 10.84.129.193 with SMTP id b59mr2804449plb.108.1504784735445; Thu, 07 Sep 2017 04:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504784735; cv=none; d=google.com; s=arc-20160816; b=eKAp3Wt2gv3zbfYOu7xzc8rcpxXSJJHVq1ENpbcvrj+EV/BW29PO02dXNNoHJpXGkp aj9G4TH2T7GqUFd8Ws3O7MUMJQhQ8H7GgTvm6NLBJQ+yEAPJfkNvUQGd7z82kmFJE/S6 kLcgxH94dzlflAFQWKbgyxHxARmwBCg8j4rSJYhQ9nm3XrBrre321Hj8uC3kUIxrIWYD gnqUqxJvvJeAEDYhk3HyO8JRy7SCSsHnACEFFZGSE8k1NgXpMVx3UnG5y9hHeQ3U8ykN jc3umI2h6uOSJf9zYQ1PyAJHPRJ9eAafi5umjMdD7nE8tM81BUiPQs5zEBy+mLvStNfn 6pfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=IBfDz1kQGKy4HSf4gyTyv3RWhyF3TqSGq+5ofwdc88c=; b=X/uDm2zHkEk8GB/84JYhqAnJ8bFG4xlyZYau5JI8VSQm9an1rK2lK+PYMzA3nbigvn pa0YH384zz9MTIx40o/GTvGKuiL5IcJhLG1hSjAzrEZcpIOYhMaG0nRDqAD2edVzNXSU E/0B0t5NFvGBt/Lia9pkyfyPnyKeya6OmZ0+E5jMVBdrkw2eXcsomB+FKWxY0E8w6+Kg C0JLtQHw5zg6BKscy3lYruEJOPGPy/ooGJloHglawNglY/GhrxTpYg4NdIL7g/H45nw0 mti+2Z1bvcawC7nekYucwpV0Q8fvEgMHKiH5y7N7WM3ezt5b/l9SHrDRimuB9iP2er5e PTcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hhdWwkFY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si1887336plk.806.2017.09.07.04.45.35; Thu, 07 Sep 2017 04:45:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=hhdWwkFY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755413AbdIGLpc (ORCPT + 26 others); Thu, 7 Sep 2017 07:45:32 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:17249 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755222AbdIGLn7 (ORCPT ); Thu, 7 Sep 2017 07:43:59 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id v87BgcP0021413; Thu, 7 Sep 2017 20:42:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v87BgcP0021413 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1504784562; bh=IBfDz1kQGKy4HSf4gyTyv3RWhyF3TqSGq+5ofwdc88c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hhdWwkFY2VVgmfK0BafD18nwODXyKoX6Unz5z44F79J+KOq4TZpRNYmtsTFhgr9P7 OddeSwrxCFitHaeJCk+MEOT93qOgBR7wif0IoMZ+ZumYdcaUnRSWJDNE5W2PZNv0sN 8uEf2IWrg6yoiZ/mn0/a81/wKvZac5i8XcNqVV3RxZ92kGtkJ2qgGTRvuSjjzNNZdR cdosmVRClAqChK2I/DBiZn842Ni9WM4PDOM9GjXy7h/wyG/+zMhYzEAW569+Ijzjmh 3PjVuPHBGwtilYnT3Bh+iALSdMZx5MqvhFtyCffma+REfxNaCChu8KBcFatdH1dxgl 0b8ybjMPLFDHQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: Marc Zyngier , Thomas Gleixner , Linus Walleij , linux-gpio@vger.kernel.org, Rob Herring Cc: Jassi Brar , devicetree@vger.kernel.org, Jason Cooper , Masami Hiramatsu , David Daney , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] irqdomain: clear trigger type in irq_domain_push_irq() Date: Thu, 7 Sep 2017 20:41:58 +0900 Message-Id: <1504784522-26841-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504784522-26841-1-git-send-email-yamada.masahiro@socionext.com> References: <1504784522-26841-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.7.4 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); + /* May (probably does) set hwirq, chip, etc. */ rv = irq_domain_alloc_irqs_hierarchy(domain, virq, 1, arg); if (rv) {