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: <CAHp75Vf+8t78NbYeCh+VLEAzcYJxDP9Pz7DPW_MC9D-K_Ff8uA@mail.gmail.com>
Date:   Fri, 18 Jun 2021 17:31:23 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Akhil R <akhilrajeev@...dia.com>
Cc:     Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Jon Hunter <jonathanh@...dia.com>,
        Krishna Yarlagadda <kyarlagadda@...dia.com>,
        Laxman Dewangan <ldewangan@...dia.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-tegra@...r.kernel.org,
        Mikko Perttunen <mperttunen@...dia.com>,
        Suresh Mangipudi <smangipudi@...dia.com>,
        Thierry Reding <thierry.reding@...il.com>
Subject: Re: [PATCH v2] gpio: tegra186: Add ACPI support

On Fri, Jun 18, 2021 at 4:39 PM Akhil R <akhilrajeev@...dia.com> wrote:

Thanks for update, my comments below.

> From: Akhil Rajeev <akhilrajeev@...dia.com>

You need to fix your Git configuration so you won't have this header
inside the commit message.

> Add ACPI module ID to probe the driver from the ACPI based bootloader
> firmware.

...

> +#include <linux/acpi.h>

property.h ? (see below)

...

> -       gpio->soc = of_device_get_match_data(&pdev->dev);
> +       gpio->soc = device_get_match_data(&pdev->dev);
>
>         gpio->secure = devm_platform_ioremap_resource_byname(pdev, "security");
> -       if (IS_ERR(gpio->secure))
> -               return PTR_ERR(gpio->secure);
> -
>         gpio->base = devm_platform_ioremap_resource_byname(pdev, "gpio");
> -       if (IS_ERR(gpio->base))
> -               return PTR_ERR(gpio->base);

> +       if (IS_ERR(gpio->secure) || IS_ERR(gpio->base)) {
> +               gpio->secure = devm_platform_ioremap_resource(pdev, 0);
> +               gpio->base = devm_platform_ioremap_resource(pdev, 1);
> +
> +               if (IS_ERR(gpio->secure))
> +                       return PTR_ERR(gpio->secure);
> +
> +               if (IS_ERR(gpio->base))
> +                       return PTR_ERR(gpio->base);
> +       }


What about doing like

      gpio->secure = devm_platform_ioremap_resource_byname(pdev, "security");
      if (IS_ERR(gpio->secure))
              gpio->secure = devm_platform_ioremap_resource(pdev, 0);
      if (IS_ERR(gpio->secure))
              return PTR_ERR(gpio->secure);

and similar for gpio->base?

...

> -       gpio->gpio.of_node = pdev->dev.of_node;
> -       gpio->gpio.of_gpio_n_cells = 2;
> -       gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
>
> -       gpio->intc.name = pdev->dev.of_node->name;

> +       if (!has_acpi_companion(&pdev->dev)) {
> +               gpio->gpio.of_node = pdev->dev.of_node;
> +               gpio->gpio.of_gpio_n_cells = 2;
> +               gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
> +               gpio->intc.name = pdev->dev.of_node->name;
> +       } else {
> +               gpio->intc.name = gpio->soc->name;
> +       }

Wouldn't the following be enough?

-       gpio->intc.name = pdev->dev.of_node->name;
+       gpio->intc.name = devm_kasprintf(&pdev->dev, "%pfw",
dev_fwnode(&pdev->dev));
+       if (!gpio->intc.name)
+               return -ENOMEM;

Note, all above are questions and you know better which direction to
take. In either way, please test and look at the result.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ