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: <CAHp75VdWA-0a_FeicHSi_FfWurQ9EvkdW0raqgoRVySTyxDJ0Q@mail.gmail.com>
Date:   Sun, 28 Jan 2018 16:39:25 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Pali Rohár <pali.rohar@...il.com>
Cc:     Jean Delvare <jdelvare@...e.com>, Wolfram Sang <wsa@...-dreams.de>,
        Michał Kępień <kernel@...pniu.pl>,
        Steven Honeyman <stevenhoneyman@...il.com>,
        Valdis Kletnieks <Valdis.Kletnieks@...edu>,
        Jochen Eisinger <jochen@...guin-breeder.org>,
        Gabriele Mazzotta <gabriele.mzt@...il.com>,
        Andy Lutomirski <luto@...nel.org>,
        Mario Limonciello <Mario_Limonciello@...l.com>,
        Alex Hung <alex.hung@...onical.com>,
        Takashi Iwai <tiwai@...e.de>,
        linux-i2c <linux-i2c@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>
Subject: Re: [PATCH v2] i2c: i801: Register optional lis3lv02d i2c device on
 Dell machines

On Sat, Jan 27, 2018 at 3:32 PM, Pali Rohár <pali.rohar@...il.com> wrote:
> Dell platform team told us that some (DMI whitelisted) Dell Latitude
> machines have ST microelectronics accelerometer at i2c address 0x29.
>
> Presence of that ST microelectronics accelerometer is verified by existence
> of SMO88xx ACPI device which represent that accelerometer. Unfortunately
> ACPI device does not specify i2c address.
>
> This patch registers lis3lv02d device for selected Dell Latitude machines
> at i2c address 0x29 after detection. And for Dell Vostro V131 machine at
> i2c address 0x1d which was manually detected.
>
> Finally commit a7ae81952cda ("i2c: i801: Allow ACPI SystemIO OpRegion to
> conflict with PCI BAR") allowed to use i2c-i801 driver on Dell machines so
> lis3lv02d correctly initialize accelerometer.
>
> Tested on Dell Latitude E6440.

> +static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle,
> +                                            u32 nesting_level,
> +                                            void *context,
> +                                            void **return_value)
> +{
> +       struct acpi_device_info *info;
> +       acpi_status status;
> +       char *hid;
> +
> +       status = acpi_get_object_info(obj_handle, &info);
> +       if (!ACPI_SUCCESS(status) || !(info->valid & ACPI_VALID_HID))
> +               return AE_OK;
> +
> +       hid = info->hardware_id.string;
> +       if (!hid)
> +               return AE_OK;
> +
> +       if (strlen(hid) < 7)
> +               return AE_OK;
> +
> +       if (memcmp(hid, "SMO88", 5) != 0)
> +               return AE_OK;
> +
> +       *((bool *)return_value) = true;
> +       return AE_CTRL_TERMINATE;
> +}
> +
> +static bool is_dell_system_with_lis3lv02d(void)
> +{

> +       /*
> +        * Check that ACPI device SMO88xx exists and is enabled. That ACPI
> +        * device represent our ST microelectronics lis3lv02d accelerometer but
> +        * unfortunately without any other information (like i2c address).
> +        */

Isn't it simple

return acpi_dev_present("SMO88", NULL, -1);

call?

> +       found = false;
> +       status = acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL,
> +                                 (void **)&found);
> +       if (!ACPI_SUCCESS(status) || !found)
> +               return false;
> +
> +       return true;
> +}


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ