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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZWU75VtJ/mXpMyQr@perf>
Date:   Tue, 28 Nov 2023 10:01:25 +0900
From:   Youngmin Nam <youngmin.nam@...sung.com>
To:     Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Cc:     tomasz.figa@...il.com, krzysztof.kozlowski@...aro.org,
        s.nawrocki@...sung.com, alim.akhtar@...sung.com,
        linus.walleij@...aro.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-gpio@...r.kernel.org,
        linux-kernel@...r.kernel.org, semen.protsenko@...aro.org
Subject: Re: [PATCH v2] pinctrl: samsung: add irq_set_affinity() for non
 wake up external gpio interrupt

On Mon, Nov 27, 2023 at 10:54:56AM +0100, Krzysztof Kozlowski wrote:
> On 26/11/2023 10:46, Youngmin Nam wrote:
> > To support affinity setting for non wake up external gpio interrupt,
> > add irq_set_affinity callback using irq number from pinctrl driver data.
> > 
> > Before this patch, changing the irq affinity of gpio interrupt is not possible:
> > 
> >     # cat /proc/irq/418/smp_affinity
> >     3ff
> >     # echo 00f > /proc/irq/418/smp_affinity
> 
> Does this command succeed on your board?
> 
Yes.

> >     # cat /proc/irq/418/smp_affinity
> >     3ff
> >     # cat /proc/interrupts
> >                CPU0       CPU1       CPU2       CPU3    ...
> >     418:       3631          0          0          0    ...
> > 
> > With this patch applied, it's possible to change irq affinity of gpio interrupt:
> 
> ...
> 
> On which board did you test it?
> 
> 
I tested on S5E9945 ERD(Exynos Reference Development) board.

> > +	if (parent)
> > +		return parent->chip->irq_set_affinity(parent, dest, force);
> > +
> 
> I think there is a  helper for it: irq_chip_set_affinity_parent().
> 
> 

The irq_chip_set_affinity_parent() requires parent_data of irq_data.
But when I tested as below, exynos's irqd->parent_data was null.
So we should use irqchip's affinity function instead of the helper function.

--- a/drivers/pinctrl/samsung/pinctrl-exynos.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.c
@@ -153,14 +153,12 @@ static int exynos_irq_set_type(struct irq_data *irqd, unsigned int type)
 static int exynos_irq_set_affinity(struct irq_data *irqd,
                                   const struct cpumask *dest, bool force)
 {
-       struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd);
-       struct samsung_pinctrl_drv_data *d = bank->drvdata;
-       struct irq_data *parent = irq_get_irq_data(d->irq);
-
-       if (parent)
-               return parent->chip->irq_set_affinity(parent, dest, force);
+       if (!irqd->parent_data) {
+               pr_err("irqd->parent_data is null!!\n");
+               return -EINVAL;
+       }

-       return -EINVAL;
+       return irq_chip_set_affinity_parent(irqd, dest, force);
 }

[  149.658395] irqd->parent_data is null!!

> Best regards,
> Krzysztof
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ