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] [day] [month] [year] [list]
Date:   Thu, 3 Mar 2022 20:58:25 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc:     ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "Rafael J. Wysocki" <rafael@...nel.org>,
        Len Brown <lenb@...nel.org>
Subject: Re: [PATCH v1 1/7] ACPI: enumeration: Discourage to use custom _DSM methods

On Mon, Feb 28, 2022 at 11:39 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
> Since we have _DSD established and specified (ACPI v5.1+) there is no
> need to use custom _DSM methods. Rewrite documentation to use _DSD.
>
> Fixes: f60e7074902a ("misc: at25: Make use of device property API")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  .../firmware-guide/acpi/enumeration.rst       | 48 ++++++++-----------
>  1 file changed, 21 insertions(+), 27 deletions(-)
>
> diff --git a/Documentation/firmware-guide/acpi/enumeration.rst b/Documentation/firmware-guide/acpi/enumeration.rst
> index d0022567c022..3b221cc9ff5f 100644
> --- a/Documentation/firmware-guide/acpi/enumeration.rst
> +++ b/Documentation/firmware-guide/acpi/enumeration.rst
> @@ -227,43 +227,37 @@ to at25 SPI eeprom driver (this is meant for the above ACPI snippet)::
>         };
>
>  Note that this driver actually needs more information like page size of the
> -eeprom etc. but at the time writing this there is no standard way of
> -passing those. One idea is to return this in _DSM method like::
> +eeprom, etc. This information can be passed via _DSD method like::
>
>         Device (EEP0)
>         {
>                 ...
> -               Method (_DSM, 4, NotSerialized)
> +               Name (_DSD, Package ()
>                 {
> -                       Store (Package (6)
> +                       ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
> +                       Package ()
>                         {
> -                               "byte-len", 1024,
> -                               "addr-mode", 2,
> -                               "page-size, 32
> -                       }, Local0)
> -
> -                       // Check UUIDs etc.
> -
> -                       Return (Local0)
> -               }
> -
> -Then the at25 SPI driver can get this configuration by calling _DSM on its
> -ACPI handle like::
> -
> -       struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
> -       struct acpi_object_list input;
> -       acpi_status status;
> +                               Package () { "size", 1024 },
> +                               Package () { "pagesize", 32 },
> +                               Package () { "address-width", 16 },
> +                       }
> +               })
> +       }
>
> -       /* Fill in the input buffer */
> +Then the at25 SPI driver can get this configuration by calling device property
> +APIs during ->probe() phase like::
>
> -       status = acpi_evaluate_object(ACPI_HANDLE(&spi->dev), "_DSM",
> -                                     &input, &output);
> -       if (ACPI_FAILURE(status))
> -               /* Handle the error */
> +       err = device_property_read_u32(dev, "size", &size);
> +       if (err)
> +               ...error handling...
>
> -       /* Extract the data here */
> +       err = device_property_read_u32(dev, "pagesize", &page_size);
> +       if (err)
> +               ...error handling...
>
> -       kfree(output.pointer);
> +       err = device_property_read_u32(dev, "address-width", &addr_width);
> +       if (err)
> +               ...error handling...
>
>  I2C serial bus support
>  ======================
> --

Applied as 5.18 material along with the rest of the series, but I
dropped the first hunk in patch [6/7] which didn't apply.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ