lkml.org 
[lkml]   [2024]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] platform/chrome: cros_ec_lpc: MEC access can use an AML mutex
On Wed, May 15, 2024 at 06:56:27AM +0100, Ben Walsh wrote:
> diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.c b/drivers/platform/chrome/cros_ec_lpc_mec.c
[...]
> +static int cros_ec_lpc_mec_lock(void)
> +{
> + bool success;
> +
> + if (!aml_mutex) {
> + mutex_lock(&io_mutex);
> + return 0;
> + }
> +
> + success = ACPI_SUCCESS(acpi_acquire_mutex(aml_mutex,
> + NULL, ACPI_LOCK_DELAY_MS));
> +
> + if (!success) {
> + pr_info("%s failed.", __func__);
> + return -EBUSY;

I guess it doesn't need to print anything as the -EBUSY should be propagated
correctly now.

> +static int cros_ec_lpc_mec_unlock(void)
> +{
> + bool success;
> +
> + if (!aml_mutex) {
> + mutex_unlock(&io_mutex);
> + return 0;
> + }
> +
> + success = ACPI_SUCCESS(acpi_release_mutex(aml_mutex, NULL));
> +
> + if (!success) {
> + pr_err("%s failed.", __func__);
> + return -EBUSY;

Same here.

\
 
 \ /
  Last update: 2024-05-20 11:46    [W:0.025 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site