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]
Date:   Tue, 2 Mar 2021 11:27:25 +0200
From:   Grygorii Strashko <grygorii.strashko@...com>
To:     Alexander Sverdlin <alexander.sverdlin@...il.com>,
        <linux-omap@...r.kernel.org>
CC:     Santosh Shilimkar <ssantosh@...nel.org>,
        Kevin Hilman <khilman@...nel.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Rob Herring <robh+dt@...nel.org>, <linux-gpio@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: omap: Honor "aliases" node



On 02/03/2021 03:18, Alexander Sverdlin wrote:
> Currently the naming of the GPIO chips depends on their order in the DT,
> but also on the kernel version (I've noticed the change from v5.10.x to
> v5.11). Honor the persistent enumeration in the "aliases" node like other
> GPIO drivers do.
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@...il.com>
> ---
> Yes, I noticed checkpatch "WARNING: DT binding docs and includes should be
> a separate patch."
> However, the parts below are tiny and barely make sense separately.
> 
>   Documentation/devicetree/bindings/gpio/gpio-omap.txt | 6 ++++++
>   drivers/gpio/gpio-omap.c                             | 5 +++++
>   2 files changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
> index e57b2cb28f6c..6050db3fd84e 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-omap.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
> @@ -30,9 +30,15 @@ OMAP specific properties:
>   - ti,gpio-always-on: 	Indicates if a GPIO bank is always powered and
>   			so will never lose its logic state.
>   
> +Note: GPIO ports can have an alias correctly numbered in "aliases" node for
> +persistent enumeration.
>   
>   Example:
>   
> +aliases {
> +	gpio0 = &gpio0;
> +};
> +
>   gpio0: gpio@...07000 {
>       compatible = "ti,omap4-gpio";
>       reg = <0x44e07000 0x1000>;
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 41952bb818ad..dd2a8f6d920f 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1014,6 +1014,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   			bank->chip.parent = &omap_mpuio_device.dev;
>   		bank->chip.base = OMAP_MPUIO(0);
>   	} else {
> +#ifdef CONFIG_OF_GPIO
> +		ret = of_alias_get_id(bank->chip.of_node, "gpio");
> +		if (ret >= 0)
> +			gpio = ret * bank->width;
> +#endif
>   		label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d",
>   				       gpio, gpio + bank->width - 1);
>   		if (!label)
> 

You're not the first one, this was not accepted. See [1]
[1] https://patchwork.kernel.org/project/linux-omap/patch/1465898604-16294-1-git-send-email-u.kleine-koenig@pengutronix.de/


-- 
Best regards,
grygorii

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ