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:   Wed, 24 Nov 2021 18:10:46 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Denis Pauk <pauk.denis@...il.com>
Cc:     Eugene Shalygin <eugene.shalygin@...il.com>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        thomas@...ssschuh.net, Guenter Roeck <linux@...ck-us.net>,
        Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] hwmon: (nct6775) Implement custom lock by ACPI mutex.

> +       if (ACPI_FAILURE(acpi_acquire_mutex(data->acpi_wmi_mutex, NULL, ASUSWMI_DELAY_MSEC_LOCK)))


On Mon, Nov 22, 2021 at 11:29 PM Denis Pauk <pauk.denis@...il.com> wrote:

No period in the Subject.

> Use ACPI lock when board has separate lock for monitoring IO.

the board
a separate

...

> +#define ASUSWMI_DELAY_MSEC_LOCK                500     /* Wait 0.5 s max. to get the lock */

Units are the last in the names, hence (also check the comment's
location and English)

/* Wait for up to 0.5 s to acquire the lock */
#define ASUSWMI_LOCK_TIMEOUT_MS                500

...

> -       struct mutex update_lock;
> +       struct mutex update_lock;       /* non ACPI lock */
> +       acpi_handle acpi_wmi_mutex;     /* ACPI lock */

Couldn't it be an anonymous union?

...

> +static int nct6775_wmi_lock(struct nct6775_data *data)
> +{
> +       if (ACPI_FAILURE(acpi_acquire_mutex(data->acpi_wmi_mutex, NULL, ASUSWMI_DELAY_MSEC_LOCK)))

Please, use a temporary variable here and in the similar cases.

  acpi_status status;

  status = acpi_acquire_mutex(data->acpi_wmi_mutex, NULL,
ASUSWMI_LOCK_TIMEOUT_MS));
  if (ACPI_FAILURE(status))

> +               return -EIO;
> +
> +       return 0;
> +}

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ