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

Commit 9fd9f8e8 authored by Alexey Starikovskiy's avatar Alexey Starikovskiy Committed by Len Brown
Browse files

ACPI: EC: Block queries until EC is fully initialized

parent 01f22462
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -599,7 +599,7 @@ static struct acpi_ec *make_acpi_ec(void)
	if (!ec)
	if (!ec)
		return NULL;
		return NULL;


	atomic_set(&ec->query_pending, 0);
	atomic_set(&ec->query_pending, 1);
	atomic_set(&ec->event_count, 1);
	atomic_set(&ec->event_count, 1);
	mutex_init(&ec->lock);
	mutex_init(&ec->lock);
	init_waitqueue_head(&ec->wait);
	init_waitqueue_head(&ec->wait);
@@ -715,6 +715,9 @@ static int ec_install_handlers(struct acpi_ec *ec)
		return -ENODEV;
		return -ENODEV;
	}
	}


	/* EC is fully operational, allow queries */
	atomic_set(&ec->query_pending, 0);

	return 0;
	return 0;
}
}