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:   Tue, 24 Nov 2020 15:00:41 +0100
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Kai-Heng Feng <kai.heng.feng@...onical.com>
Cc:     Rafael Wysocki <rafael.j.wysocki@...el.com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Hans de Goede <hdegoede@...hat.com>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
        Linux PCI <linux-pci@...r.kernel.org>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ACPI: PM: Re-enable ACPI GPE if it's already enabled

On Tue, Nov 24, 2020 at 8:36 AM Kai-Heng Feng
<kai.heng.feng@...onical.com> wrote:
>
> Dell Precision 5550 fails to detect Thunderbolt device hotplug events,
> once the Thunderbolt device and its root port are runtime-suspended to
> D3cold.
>
> While putting the entire hierarchy to D3cold, the root port ACPI GPE is
> enabled via acpi_pci_propagate_wakeup() when suspending Thunderbolt
> bridges/switches. So when putting the root port to D3cold as last step,
> ACPI GPE is untouched as it's already enabled.
>
> However, platform may need PCI devices to be in D3hot or PME enabled
> prior enabling GPE to make it work.

What platforms and why.

> So re-enable ACPI GPE to address this.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@...onical.com>
> ---
>  drivers/acpi/device_pm.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
> index 94d91c67aeae..dc25d9d204ae 100644
> --- a/drivers/acpi/device_pm.c
> +++ b/drivers/acpi/device_pm.c
> @@ -757,11 +757,10 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
>
>         mutex_lock(&acpi_wakeup_lock);
>
> -       if (wakeup->enable_count >= max_count)
> -               goto out;
> -
> -       if (wakeup->enable_count > 0)
> -               goto inc;
> +       if (wakeup->enable_count > 0) {
> +               acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
> +               acpi_disable_wakeup_device_power(adev);
> +       }

An event occurring at this point may be lost after this patch.

It looks like you are trying to work around a hardware issue.  Can you
please describe that issue in detail?

>
>         error = acpi_enable_wakeup_device_power(adev, target_state);
>         if (error)
> @@ -777,8 +776,8 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
>         acpi_handle_debug(adev->handle, "GPE%2X enabled for wakeup\n",
>                           (unsigned int)wakeup->gpe_number);
>
> -inc:
> -       wakeup->enable_count++;
> +       if (wakeup->enable_count < max_count)
> +               wakeup->enable_count++;
>
>  out:
>         mutex_unlock(&acpi_wakeup_lock);
> --
> 2.29.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ