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: 929248 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=socionext.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="SSlY01Q0"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 415sys4DDrz9ry1 for ; Thu, 14 Jun 2018 15:45:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752701AbeFNFpI (ORCPT ); Thu, 14 Jun 2018 01:45:08 -0400 Received: from condef-03.nifty.com ([202.248.20.68]:19217 "EHLO condef-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752355AbeFNFpI (ORCPT ); Thu, 14 Jun 2018 01:45:08 -0400 X-Greylist: delayed 703 seconds by postgrey-1.27 at vger.kernel.org; Thu, 14 Jun 2018 01:45:07 EDT Received: from conuserg-08.nifty.com ([10.126.8.71])by condef-03.nifty.com with ESMTP id w5E5Spu1026960 for ; Thu, 14 Jun 2018 14:28:51 +0900 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 Cc: Masami Hiramatsu , Jassi Brar , Katsuhiro Suzuki , Masahiro Yamada , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org 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); }