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

Commit 66c44877 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpi-osl', 'acpi-pad', 'acpi-video' and 'acpi-assorted'

* acpi-osl:
  ACPI / PM: Fix incorrect wakeup IRQ setting during suspend-to-idle
  ACPI: Using correct irq when waiting for events
  ACPI: Use correct IRQ when uninstalling ACPI interrupt handler

* acpi-pad:
  ACPI / PAD: power_saving_thread() is not freezable

* acpi-video:
  ACPI / video: Add a quirk to force native backlight on Lenovo IdeaPad S405

* acpi-assorted:
  ACPI / Documentation: add copy_dsdt to ACPI format options
  ACPI / sysfs: correctly check failing memory allocation
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -167,7 +167,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

	acpi=		[HW,ACPI,X86,ARM64]
			Advanced Configuration and Power Interface
			Format: { force | off | strict | noirq | rsdt }
			Format: { force | off | strict | noirq | rsdt |
				  copy_dsdt }
			force -- enable ACPI if default was off
			off -- disable ACPI if default was on
			noirq -- do not use ACPI for IRQ routing
+0 −2
Original line number Diff line number Diff line
@@ -148,8 +148,6 @@ static int power_saving_thread(void *data)
	while (!kthread_should_stop()) {
		unsigned long expire_time;

		try_to_freeze();

		/* round robin to cpus */
		expire_time = last_jiffies + round_robin_time * HZ;
		if (time_before(expire_time, jiffies)) {
+8 −5
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ static struct workqueue_struct *kacpid_wq;
static struct workqueue_struct *kacpi_notify_wq;
static struct workqueue_struct *kacpi_hotplug_wq;
static bool acpi_os_initialized;
unsigned int acpi_sci_irq = INVALID_ACPI_IRQ;

/*
 * This list of permanent mappings is for memory that may be accessed from
@@ -854,17 +855,19 @@ acpi_os_install_interrupt_handler(u32 gsi, acpi_osd_handler handler,
		acpi_irq_handler = NULL;
		return AE_NOT_ACQUIRED;
	}
	acpi_sci_irq = irq;

	return AE_OK;
}

acpi_status acpi_os_remove_interrupt_handler(u32 irq, acpi_osd_handler handler)
acpi_status acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler handler)
{
	if (irq != acpi_gbl_FADT.sci_interrupt)
	if (gsi != acpi_gbl_FADT.sci_interrupt || !acpi_sci_irq_valid())
		return AE_BAD_PARAMETER;

	free_irq(irq, acpi_irq);
	free_irq(acpi_sci_irq, acpi_irq);
	acpi_irq_handler = NULL;
	acpi_sci_irq = INVALID_ACPI_IRQ;

	return AE_OK;
}
@@ -1178,8 +1181,8 @@ void acpi_os_wait_events_complete(void)
	 * Make sure the GPE handler or the fixed event handler is not used
	 * on another CPU after removal.
	 */
	if (acpi_irq_handler)
		synchronize_hardirq(acpi_gbl_FADT.sci_interrupt);
	if (acpi_sci_irq_valid())
		synchronize_hardirq(acpi_sci_irq);
	flush_workqueue(kacpid_wq);
	flush_workqueue(kacpi_notify_wq);
}
+4 −2
Original line number Diff line number Diff line
@@ -632,14 +632,16 @@ static int acpi_freeze_prepare(void)
	acpi_enable_wakeup_devices(ACPI_STATE_S0);
	acpi_enable_all_wakeup_gpes();
	acpi_os_wait_events_complete();
	enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
	if (acpi_sci_irq_valid())
		enable_irq_wake(acpi_sci_irq);
	return 0;
}

static void acpi_freeze_restore(void)
{
	acpi_disable_wakeup_devices(ACPI_STATE_S0);
	disable_irq_wake(acpi_gbl_FADT.sci_interrupt);
	if (acpi_sci_irq_valid())
		disable_irq_wake(acpi_sci_irq);
	acpi_enable_all_runtime_gpes();
}

+3 −0
Original line number Diff line number Diff line
@@ -878,6 +878,9 @@ int __init acpi_sysfs_init(void)
		return result;

	hotplug_kobj = kobject_create_and_add("hotplug", acpi_kobj);
	if (!hotplug_kobj)
		return -ENOMEM;

	result = sysfs_create_file(hotplug_kobj, &force_remove_attr.attr);
	if (result)
		return result;
Loading