Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4685469pxu; Tue, 13 Oct 2020 04:56:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpx4pQGHQzmwDP74ISpLlbZymU2T2qtyuxl/83dCRQJXLqGLGIx+1v90jB6+BnUvf95J2m X-Received: by 2002:a17:906:f298:: with SMTP id gu24mr32910587ejb.53.1602590170961; Tue, 13 Oct 2020 04:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602590170; cv=none; d=google.com; s=arc-20160816; b=PPuGifi85SQdsr12Yu5TJ5T7cPwfLJDyUbLN8W18Za6u8DqavKwrUDaYLA9jUVSZGJ IjWmMTByfdmsDlz/tbTmcrlPRLNkLPkDsPeXXidrAxKvcyQl06ZVcEbm3L+YzUdFDfIo 6tLMCFFUWllDzU0GII9TI9Zf72Qtoq8LbSde9MrXV2wnFXxH7CZUHXpeahKzhHJO/HbW TEyCLBuEw302Ocf0ePSkBvsPR8j+qrAyts3X6PPwIPZ1C0ydKbx4L+PIZNs7sZK1bgEW O+TkJcFK76zzxWuNC7rJGCE1/NLBSnlJvELdfjDMJgv31BSTVk7DSQmJmFZsAGDuSerd 7jlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=UQ/i4zVLGqE4guYu5kjmZ7yjeiPOQxizhFArmA+IEUQ=; b=ZGkbfttf+SVBBT+Tjzms1BUosstk3VnfjOpQUTIuf+XmbIatI+r0CgMAqjl2ZZ4jsI TNtlDNyMopOCWzeJRHNkbQpCyNWuyKRi0Ao0CnN43ioxNYF1VAeLhhRYbevyyM7cSBN4 OkB46w8oyO5uNAQ7SnUPdMXM3gueZB0RIpgwrGQqbkgbSFUWv/q2LJklg/Ps5H/kGZHK 17CSP2XMZp03p97xa60AWSHKtc2yoWJIGil9qsfaSf5vDSDYUzeDmX1KQz0DmgNgADXj R3xikhIgxjGbpBuE84xCHnLnEixrgqtR51rR1Un/8PT5TruFOfQipE6K3CF/tQI0v6+B s5iQ== 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 oz20si9277803ejb.373.2020.10.13.04.55.47; Tue, 13 Oct 2020 04:56:10 -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 S2389715AbgJMGoH (ORCPT + 99 others); Tue, 13 Oct 2020 02:44:07 -0400 Received: from lucky1.263xmail.com ([211.157.147.135]:52702 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389644AbgJMGoE (ORCPT ); Tue, 13 Oct 2020 02:44:04 -0400 Received: from localhost (unknown [192.168.167.16]) by lucky1.263xmail.com (Postfix) with ESMTP id F2FBBA51CC; Tue, 13 Oct 2020 14:37:34 +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 P30218T139798958167808S1602571053396950_; Tue, 13 Oct 2020 14:37:35 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <28dc936c7ad6e51da9d9b380cb25ca95> 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: linus.walleij@linaro.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Jianqun Xu To: linus.walleij@linaro.org, heiko@sntech.de Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Jianqun Xu Subject: [PATCH v3 3/3] pinctrl: rockchip: create irq mapping in gpio_to_irq Date: Tue, 13 Oct 2020 14:37:31 +0800 Message-Id: <20201013063731.3618-4-jay.xu@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201013063731.3618-1-jay.xu@rock-chips.com> References: <20201013063731.3618-1-jay.xu@rock-chips.com> 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. Reviewed-by: Heiko Stuebner 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 a2f361aa6d05..70dc03af5699 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -3198,7 +3198,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); @@ -3377,7 +3377,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) { @@ -3404,7 +3404,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); @@ -3413,14 +3413,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; @@ -3437,13 +3429,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