lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bf5880ec-8222-74e8-2d15-d9998e0149df@rock-chips.com>
Date:   Wed, 14 Oct 2020 08:24:17 +0800
From:   Kever Yang <kever.yang@...k-chips.com>
To:     Jianqun Xu <jay.xu@...k-chips.com>, linus.walleij@...aro.org,
        heiko@...ech.de
Cc:     linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v3 3/3] pinctrl: rockchip: create irq mapping in gpio_to_irq【请注意,邮件由linux-rockchip-bounces+kever.yang=rock-chips.com@...ts.infradead.org代发】


On 2020/10/13 下午2:37, Jianqun Xu wrote:
> 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 <heiko@...ech.de>
> Signed-off-by: Jianqun Xu <jay.xu@...k-chips.com>
> ---
>   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);
>   	}
>   

Looks good to me,

Reviewed-by: Kever Yang<kever.yang@...k-chips.com>

Thanks,
- Kever



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ