Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2260594pxk; Sat, 5 Sep 2020 15:05:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4SXkOtxSxXpNW8psPoPPqBN0/5axNKc38tZGGoWkrJj/YnUxa2RIMpHkDsBLhZE+MUTBb X-Received: by 2002:a17:906:c0ce:: with SMTP id bn14mr14907958ejb.422.1599343502866; Sat, 05 Sep 2020 15:05:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599343502; cv=none; d=google.com; s=arc-20160816; b=eO/FBtO2olnWF1n98USypRgugDEmpRVtj85l4nbQF2Xhyn4zx3xausGOCGDEATW5+U R0KWQ4zcAK1f8Ok3Y7QILnGqmtJFgCaH0d5kC6IGaNP35T2sPK3SFtJQwcBM3iuKxEdv U+TRPhXupzXo6Vfbq8njBKZvk/zFySm02934Ri4SlL9zzBnQ9FmAILgxwGi4KLjfXX7Y VaLsXX8E0CPdlfeNTplRbJKOdijirHq20jXSrhPL6lsocZtsoo8wDUh2EIWHF4yjP4+r O/IMnFClv5/WtK7UrFG8Cs4V9miThUzQLTAQEslsY8cB7qNzyvsW8yT7W4NRVjREOMP3 EqAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vO3d6BSwftLKhYV2H6hkgqTfIjMaT3lI8+hTHnv0KjI=; b=fndxyLkyhD349VLXUV9ATJSSKBCz5sG8oJ/yianIC9LFB6T6rIXN+tHZomZVt/+mPG WWAv/0HW8fgMpNP2D+fKaxk2F2GJ73fkSE2esdAUayCp6B4rDbfd3CbX/tQt5PSz3TCV BVri9AAeu3VdNnK3Ty8bCj8p8+vYoi9AP/f9cngI1rxb5blyB9DaBK11iNjVjnTkcACX prb68dsBFBwu/ugr7AqWVjC/REpxH+5/dTTtXRHEaEST1WMN4lcmx1gL30b3YGf9oaMa bHS7sUzypVgFojy/zQgUL03zhKu0tztC09S2VX/+ZmHccgNus34EmKwpw6QVQgMCOxJx xU1w== 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 s22si6349046edc.481.2020.09.05.15.04.40; Sat, 05 Sep 2020 15:05: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 S1728726AbgIEWDw (ORCPT + 99 others); Sat, 5 Sep 2020 18:03:52 -0400 Received: from gloria.sntech.de ([185.11.138.130]:33778 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728327AbgIEWDw (ORCPT ); Sat, 5 Sep 2020 18:03:52 -0400 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEgHm-0005ic-Pe; Sun, 06 Sep 2020 00:03:50 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: linus.walleij@linaro.org, Jianqun Xu Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Jianqun Xu Subject: Re: [PATCH 3/6] pinctrl: rockchip: create irq mapping in gpio_to_irq Date: Sun, 06 Sep 2020 00:03:50 +0200 Message-ID: <3620235.rk29NJRsjD@diego> In-Reply-To: <20200831084753.7115-4-jay.xu@rock-chips.com> References: <20200831084753.7115-1-jay.xu@rock-chips.com> <20200831084753.7115-4-jay.xu@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, 31. August 2020, 10:47:50 CEST schrieb Jianqun Xu: > 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 Reviewed-by: Heiko Stuebner > --- > 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 54abda7b7be8..265d64b8c4f5 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); > } > >