From patchwork Thu Jun 14 05:27:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10463293 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0798C60348 for ; Thu, 14 Jun 2018 05:28:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9A3A287E5 for ; Thu, 14 Jun 2018 05:28:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D986028881; Thu, 14 Jun 2018 05:28:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8F18E287E5 for ; Thu, 14 Jun 2018 05:28:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=xeoFlL+KhrI2NyZcLT9lwhVTBKdzo6nDma9dV5r2Qwg=; b=Zwr ebVMEwfg4XmBd1IOnTlN6FH755M813bNBeGKJF4aVFU8qWWPtAhow01dFd9ooEMEBXwr5Jx4TTFHl HGVPCxwZBcu/DZNxWYLgw22vKB1uSQxdJ8rTWTxiAGgqdpqOJupHFOJlXhDbc8jvS8ZLCxKGIN0+w Bj1oR6NOgH9TzghX753/qN/k6ZpK2+P7KMCl+M8NqQcjkj5HPwToRtCSrVB/EJJqD016vLHPN6SJN RsKUc4w0dWyePrjf+Qsm6LaHpdNALr6V2WCuUGlG/NybzJs+hLSMM0UH/JnJdaLFtmRlSVdrTYywo PvnA5LSxU9gX+zUXMGr5PhgsoJXyhtQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTKoU-0003q5-FB; Thu, 14 Jun 2018 05:28:50 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fTKoP-0003mp-NC for linux-arm-kernel@lists.infradead.org; Thu, 14 Jun 2018 05:28:47 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w5E5RuGd013676; Thu, 14 Jun 2018 14:27:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w5E5RuGd013676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1528954077; bh=eqYtAnV/+K9nYMuCa/VpRmWKdlqJ+MYvrJcN4pfytH0=; h=From:To:Cc:Subject:Date:From; b=SSlY01Q0hFe8Q4dSsFuGlGrcMA4+EIFidmDrteSTfoPI4BvHfgYdUuhKvQoQCFRIt P8GOgVniuU14TRAiJWcxhLmqKFefPKSGLez+g6kP3OwNmWbJplJzANXyN35U08exsk XNmrHHiBqK6IgivAbzaNZR1u4e3mh/u9J8yWG3Z0r6xtnsYBtrL//t8M1WcLDPK6xh i3RBW0Zd5pIHmDJQ24UUXVDEQtAwOStnt7s39P1W1dzK7Gakk+or70WxlU7iwUAStZ mrkEO2Lfn62jmhuaWo8lWl8Jmer8L5hKFrCcgOJ0KuKNrH/Jecs2LEtZ6PwxGjiipP 9Q/hHEsmHc0IA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-gpio@vger.kernel.org, Linus Walleij Subject: [PATCH] gpio: uniphier: set legitimate irq trigger type in .to_irq hook Date: Thu, 14 Jun 2018 14:27:45 +0900 Message-Id: <1528954065-25563-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180613_222846_013374_6CC1A137 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Katsuhiro Suzuki , Jassi Brar , Masami Hiramatsu , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP If a GPIO chip is a part of a hierarchy IRQ domain, there is no way to specify the trigger type when gpio(d)_to_irq() allocates an interrupt on-the-fly. Currently, uniphier_gpio_to_irq() sets IRQ_TYPE_NONE, but it causes an error in the .alloc() hook of the parent domain. (drivers/irq/irq-uniphier-aidet.c) Even if we change irq-uniphier-aidet.c to accept the NONE type, GIC complains about it since commit 83a86fbb5b56 ("irqchip/gic: Loudly complain about the use of IRQ_TYPE_NONE"). Instead, use IRQ_TYPE_LEVEL_HIGH as a temporary value when an irq is allocated. irq_set_irq_type() will override it when the irq is really requested. Fixes: dbe776c2ca54 ("gpio: uniphier: add UniPhier GPIO controller driver") Reported-by: Katsuhiro Suzuki Signed-off-by: Masahiro Yamada Tested-by: Katsuhiro Suzuki --- drivers/gpio/gpio-uniphier.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c index d3cf950..58faeb1 100644 --- a/drivers/gpio/gpio-uniphier.c +++ b/drivers/gpio/gpio-uniphier.c @@ -181,7 +181,11 @@ static int uniphier_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) fwspec.fwnode = of_node_to_fwnode(chip->parent->of_node); fwspec.param_count = 2; fwspec.param[0] = offset - UNIPHIER_GPIO_IRQ_OFFSET; - fwspec.param[1] = IRQ_TYPE_NONE; + /* + * IRQ_TYPE_NONE is rejected by the parent irq domain. Set LEVEL_HIGH + * temporarily. Anyway, ->irq_set_type() will override it later. + */ + fwspec.param[1] = IRQ_TYPE_LEVEL_HIGH; return irq_create_fwspec_mapping(&fwspec); }