Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3d695839 authored by Len Brown's avatar Len Brown
Browse files

ACPI: handle systems which asynchoronously enable ACPI mode

Folklore suggested that such systems existed
in the pre-history of ACPI.

However, we removed the SCI_EN polling loop from
acpi_hw_set_mode() in b430acbd
because it delayed resume by 3 seconds on boxes
that refused to set SCI_EN.

Matthew removed the call to acpi_enable() from
the suspend resume path.

James found a modern system that still needs to be polled
upon boot.

So here we restore the workaround, except that we
put it in acpi_enable() rather than the low level
acpi_hw_set_mode().

https://bugzilla.kernel.org/show_bug.cgi?id=16271



Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 93416253
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
acpi_status acpi_enable(void)
{
	acpi_status status;
	int retry;

	ACPI_FUNCTION_TRACE(acpi_enable);

@@ -98,16 +99,18 @@ acpi_status acpi_enable(void)

	/* Sanity check that transition succeeded */

	if (acpi_hw_get_mode() != ACPI_SYS_MODE_ACPI) {
		ACPI_ERROR((AE_INFO,
			    "Hardware did not enter ACPI mode"));
		return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
	for (retry = 0; retry < 30000; ++retry) {
		if (acpi_hw_get_mode() == ACPI_SYS_MODE_ACPI) {
			if (retry != 0)
				ACPI_WARNING((AE_INFO,
				"Platform took > %d00 usec to enter ACPI mode", retry));
			return_ACPI_STATUS(AE_OK);
		}
		acpi_os_stall(100);	/* 100 usec */
	}

	ACPI_DEBUG_PRINT((ACPI_DB_INIT,
			  "Transition to ACPI mode successful\n"));

	return_ACPI_STATUS(AE_OK);
	ACPI_ERROR((AE_INFO, "Hardware did not enter ACPI mode"));
	return_ACPI_STATUS(AE_NO_HARDWARE_RESPONSE);
}

ACPI_EXPORT_SYMBOL(acpi_enable)