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

Commit 511514f1 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpi-tables', 'acpi-debug', 'acpi-ec' and 'acpi-dptf'

* acpi-tables:
  ACPI/PPTT: Add acpi_pptt_warn_missing() to consolidate logs
  ACPI / tables: table override from built-in initrd

* acpi-debug:
  ACPI: debug: Clean up acpi_aml_init()
  ACPI: no need to check return value of debugfs_create functions

* acpi-ec:
  Revert "ACPI / EC: Remove old CLEAR_ON_RESUME quirk"
  ACPI: EC: Simplify boot EC checks in acpi_ec_add()
  ACPI: EC: Eliminate acpi_config_boot_ec()
  ACPI: EC: Make acpi_ec_dsdt_probe() more straightforward
  ACPI: EC: Make acpi_ec_ecdt_probe() more straightforward
  ACPI: EC: Declare boot_ec as static
  ACPI: EC: Clean up probing for early EC

* acpi-dptf:
  ACPI / DPTF: remove header search path to the parent directory
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@ upgrade the ACPI execution environment that is defined by the ACPI tables
via upgrading the ACPI tables provided by the BIOS with an instrumented,
modified, more recent version one, or installing brand new ACPI tables.

When building initrd with kernel in a single image, option
ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD should also be true for this
feature to work.

For a full list of ACPI tables that can be upgraded/installed, take a look
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
drivers/acpi/tables.c.
+10 −0
Original line number Diff line number Diff line
@@ -357,6 +357,16 @@ config ACPI_TABLE_UPGRADE
	  initrd, therefore it's safe to say Y.
	  See Documentation/acpi/initrd_table_override.txt for details

config ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD
	bool "Override ACPI tables from built-in initrd"
	depends on ACPI_TABLE_UPGRADE
	depends on INITRAMFS_SOURCE!="" && INITRAMFS_COMPRESSION=""
	help
	  This option provides functionality to override arbitrary ACPI tables
	  from built-in uncompressed initrd.

	  See Documentation/acpi/initrd_table_override.txt for details

config ACPI_DEBUG
	bool "Debug Statements"
	help
+9 −21
Original line number Diff line number Diff line
@@ -750,48 +750,36 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {

int __init acpi_aml_init(void)
{
	int ret = 0;

	if (!acpi_debugfs_dir) {
		ret = -ENOENT;
		goto err_exit;
	}
	int ret;

	/* Initialize AML IO interface */
	mutex_init(&acpi_aml_io.lock);
	init_waitqueue_head(&acpi_aml_io.wait);
	acpi_aml_io.out_crc.buf = acpi_aml_io.out_buf;
	acpi_aml_io.in_crc.buf = acpi_aml_io.in_buf;

	acpi_aml_dentry = debugfs_create_file("acpidbg",
					      S_IFREG | S_IRUGO | S_IWUSR,
					      acpi_debugfs_dir, NULL,
					      &acpi_aml_operations);
	if (acpi_aml_dentry == NULL) {
		ret = -ENODEV;
		goto err_exit;
	}
	ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
	if (ret)
		goto err_fs;
	acpi_aml_initialized = true;

err_fs:
	ret = acpi_register_debugger(THIS_MODULE, &acpi_aml_debugger);
	if (ret) {
		debugfs_remove(acpi_aml_dentry);
		acpi_aml_dentry = NULL;
	}
err_exit:
		return ret;
	}

	acpi_aml_initialized = true;
	return 0;
}

void __exit acpi_aml_exit(void)
{
	if (acpi_aml_initialized) {
		acpi_unregister_debugger(&acpi_aml_debugger);
		if (acpi_aml_dentry) {
		debugfs_remove(acpi_aml_dentry);
		acpi_aml_dentry = NULL;
		}
		acpi_aml_initialized = false;
	}
}
+22 −64
Original line number Diff line number Diff line
@@ -679,7 +679,6 @@ static int __init einj_init(void)
{
	int rc;
	acpi_status status;
	struct dentry *fentry;
	struct apei_exec_context ctx;

	if (acpi_disabled) {
@@ -707,25 +706,13 @@ static int __init einj_init(void)

	rc = -ENOMEM;
	einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
	if (!einj_debug_dir) {
		pr_err("Error creating debugfs node.\n");
		goto err_cleanup;
	}

	fentry = debugfs_create_file("available_error_type", S_IRUSR,
				     einj_debug_dir, NULL,
				     &available_error_type_fops);
	if (!fentry)
		goto err_cleanup;

	fentry = debugfs_create_file("error_type", S_IRUSR | S_IWUSR,
				     einj_debug_dir, NULL, &error_type_fops);
	if (!fentry)
		goto err_cleanup;
	fentry = debugfs_create_file("error_inject", S_IWUSR,
				     einj_debug_dir, NULL, &error_inject_fops);
	if (!fentry)
		goto err_cleanup;

	debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir,
			    NULL, &available_error_type_fops);
	debugfs_create_file("error_type", S_IRUSR | S_IWUSR, einj_debug_dir,
			    NULL, &error_type_fops);
	debugfs_create_file("error_inject", S_IWUSR, einj_debug_dir,
			    NULL, &error_inject_fops);

	apei_resources_init(&einj_resources);
	einj_exec_ctx_init(&ctx);
@@ -750,66 +737,37 @@ static int __init einj_init(void)
	rc = -ENOMEM;
	einj_param = einj_get_parameter_address();
	if ((param_extension || acpi5) && einj_param) {
		fentry = debugfs_create_x32("flags", S_IRUSR | S_IWUSR,
					    einj_debug_dir, &error_flags);
		if (!fentry)
			goto err_unmap;
		fentry = debugfs_create_x64("param1", S_IRUSR | S_IWUSR,
					    einj_debug_dir, &error_param1);
		if (!fentry)
			goto err_unmap;
		fentry = debugfs_create_x64("param2", S_IRUSR | S_IWUSR,
					    einj_debug_dir, &error_param2);
		if (!fentry)
			goto err_unmap;
		fentry = debugfs_create_x64("param3", S_IRUSR | S_IWUSR,
					    einj_debug_dir, &error_param3);
		if (!fentry)
			goto err_unmap;
		fentry = debugfs_create_x64("param4", S_IRUSR | S_IWUSR,
					    einj_debug_dir, &error_param4);
		if (!fentry)
			goto err_unmap;

		fentry = debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
		debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
				   &error_flags);
		debugfs_create_x64("param1", S_IRUSR | S_IWUSR, einj_debug_dir,
				   &error_param1);
		debugfs_create_x64("param2", S_IRUSR | S_IWUSR, einj_debug_dir,
				   &error_param2);
		debugfs_create_x64("param3", S_IRUSR | S_IWUSR, einj_debug_dir,
				   &error_param3);
		debugfs_create_x64("param4", S_IRUSR | S_IWUSR, einj_debug_dir,
				   &error_param4);
		debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
				   einj_debug_dir, &notrigger);
		if (!fentry)
			goto err_unmap;
	}

	if (vendor_dev[0]) {
		vendor_blob.data = vendor_dev;
		vendor_blob.size = strlen(vendor_dev);
		fentry = debugfs_create_blob("vendor", S_IRUSR,
					     einj_debug_dir, &vendor_blob);
		if (!fentry)
			goto err_unmap;
		fentry = debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
		debugfs_create_blob("vendor", S_IRUSR, einj_debug_dir,
				    &vendor_blob);
		debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
				   einj_debug_dir, &vendor_flags);
		if (!fentry)
			goto err_unmap;
	}

	pr_info("Error INJection is initialized.\n");

	return 0;

err_unmap:
	if (einj_param) {
		acpi_size size = (acpi5) ?
			sizeof(struct set_error_type_with_address) :
			sizeof(struct einj_parameter);

		acpi_os_unmap_iomem(einj_param, size);
		pr_err("Error creating param extension debugfs nodes.\n");
	}
	apei_exec_post_unmap_gars(&ctx);
err_release:
	apei_resources_release(&einj_resources);
err_fini:
	apei_resources_fini(&einj_resources);
err_cleanup:
	pr_err("Error creating primary debugfs nodes.\n");
	debugfs_remove_recursive(einj_debug_dir);

	return rc;
+0 −6
Original line number Diff line number Diff line
@@ -79,14 +79,8 @@ static const struct file_operations cm_fops = {

static int __init acpi_custom_method_init(void)
{
	if (acpi_debugfs_dir == NULL)
		return -ENOENT;

	cm_dentry = debugfs_create_file("custom_method", S_IWUSR,
					acpi_debugfs_dir, NULL, &cm_fops);
	if (cm_dentry == NULL)
		return -ENODEV;

	return 0;
}

Loading