Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1639310ybh; Thu, 16 Jul 2020 18:53:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmzvRmcnYQOK0hN9KjBx5ttMnER2XhdhAwK/dr+RObFqmglOSB/lu/s48HZyejMBzmAadd X-Received: by 2002:aa7:c606:: with SMTP id h6mr7069487edq.363.1594950782870; Thu, 16 Jul 2020 18:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594950782; cv=none; d=google.com; s=arc-20160816; b=NfgM1m1D7p5k/8jR3/hbrcIXMt24cme9ylfZbFFJfRwk1hOpIftqmh/9Or6mrzxuzq HMq7YteL5uDkEp3VBCb9SD3JiejkysmZvfua66VsVjMuRrQLSAni+z2InIW2fOyhaxl7 xBLSVwRL5iTgThZ7RNatQfgm1FdHg1mQI/zX5zWYsk5yzGeVzB/w+cSNGxIYFETGhmS3 q+1g7MpW3ncw5jOlp281zs1fnUMbnL8fghmdQRIPglHW4yfqwcqxqce3DB/oHEdwqHF8 w+fuYmatmnJyjqomeNQgpliMfshOGT8eLeVbP4u6v1HJwAJE9bRTCMHjMhHSomXajVIA ETUA== 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; bh=xiPBsTjFXx095K94SQVuck5zzUWLmvARA1Mt6cJyjok=; b=ipLckD6AD4M0+3srJQgBAx0a5wp+K6HvTQKJ/K04dw4UBxfoE2QT5HM2MScfX9qeGR FlJnbsD6Zpp+IR8MVE2ZnHY0axD+gx7VxjbwUINZ59nTOWap4GwiSiqK5y6PAT/kGd+9 vV3KKFHPAWufELgApiyetlK3+Z+hwuEflLV1M9jmUjrmMzZpix7yQXrtKkI5vUKXFVab NBQx/F+pMPeEJFDOptvzfbLjbYf4uPqh2DUu8xC0GWSluLDq0FM+xMIU9EWYstdzSOMy Wzpvhb3OFO16Np9sYyPX0Hy5GkTm3udQ12CjIljo8Ycx7WCgU40o6cEWwBrLRNHXZqnl ZoiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl8si4260428ejb.425.2020.07.16.18.52.40; Thu, 16 Jul 2020 18:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbgGQBw0 (ORCPT + 99 others); Thu, 16 Jul 2020 21:52:26 -0400 Received: from lucky1.263xmail.com ([211.157.147.133]:38770 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbgGQBwZ (ORCPT ); Thu, 16 Jul 2020 21:52:25 -0400 Received: from localhost (unknown [192.168.167.70]) by lucky1.263xmail.com (Postfix) with ESMTP id 5B07CC5C96; Fri, 17 Jul 2020 09:52:22 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P22085T140330059949824S1594950740444703_; Fri, 17 Jul 2020 09:52:21 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: X-RL-SENDER: jay.xu@rock-chips.com X-SENDER: xjq@rock-chips.com X-LOGIN-NAME: jay.xu@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Jianqun Xu To: heiko@sntech.de, linus.walleij@linaro.org Cc: linux-gpio@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kever.yang@rock-chips.com, david.wu@rock-chips.com, Jianqun Xu Subject: [PATCH 05/13] pinctrl: rockchip: create irq mapping in gpio_to_irq Date: Fri, 17 Jul 2020 09:52:19 +0800 Message-Id: <20200717015219.14047-1-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200717014908.13914-1-jay.xu@rock-chips.com> References: <20200717014908.13914-1-jay.xu@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove totally irq mappings create in probe, the gpio irq mapping will be created when do gpio_to_irq -> rockchip_gpio_to_irq -> irq_create_mapping This patch can speed up system boot on, also abandon many unused irq mappings' create. Signed-off-by: Jianqun Xu --- drivers/pinctrl/pinctrl-rockchip.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index d34fada39227..1be4627f3877 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3196,7 +3196,7 @@ static void rockchip_irq_demux(struct irq_desc *desc) irq = __ffs(pend); pend &= ~BIT(irq); - virq = irq_linear_revmap(bank->domain, irq); + virq = irq_find_mapping(bank->domain, irq); if (!virq) { dev_err(bank->drvdata->dev, "unmapped irq %d\n", irq); @@ -3375,7 +3375,7 @@ static int rockchip_interrupts_register(struct platform_device *pdev, unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; struct irq_chip_generic *gc; int ret; - int i, j; + int i; for (i = 0; i < ctrl->nr_banks; ++i, ++bank) { if (!bank->valid) { @@ -3402,7 +3402,7 @@ static int rockchip_interrupts_register(struct platform_device *pdev, ret = irq_alloc_domain_generic_chips(bank->domain, 32, 1, "rockchip_gpio_irq", handle_level_irq, - clr, 0, IRQ_GC_INIT_MASK_CACHE); + clr, 0, 0); if (ret) { dev_err(&pdev->dev, "could not alloc generic chips for bank %s\n", bank->name); @@ -3411,14 +3411,6 @@ static int rockchip_interrupts_register(struct platform_device *pdev, continue; } - /* - * Linux assumes that all interrupts start out disabled/masked. - * Our driver only uses the concept of masked and always keeps - * things enabled, so for us that's all masked and all enabled. - */ - writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK); - writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN); - gc = irq_get_domain_generic_chip(bank->domain, 0); gc->reg_base = bank->reg_base; gc->private = bank; @@ -3435,13 +3427,17 @@ static int rockchip_interrupts_register(struct platform_device *pdev, gc->chip_types[0].chip.irq_set_type = rockchip_irq_set_type; gc->wake_enabled = IRQ_MSK(bank->nr_pins); + /* + * Linux assumes that all interrupts start out disabled/masked. + * Our driver only uses the concept of masked and always keeps + * things enabled, so for us that's all masked and all enabled. + */ + writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTMASK); + writel_relaxed(0xffffffff, bank->reg_base + GPIO_INTEN); + gc->mask_cache = 0xffffffff; + irq_set_chained_handler_and_data(bank->irq, rockchip_irq_demux, bank); - - /* map the gpio irqs here, when the clock is still running */ - for (j = 0 ; j < 32 ; j++) - irq_create_mapping(bank->domain, j); - clk_disable(bank->clk); } -- 2.17.1