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

Commit 3a5cf05a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branches 'acpi-init', 'acpi-pnp', 'acpi-scan', 'acpi-proc' and 'acpi-doc'

* acpi-init:
  ACPI / init: Switch over platform to the ACPI mode later

* acpi-pnp:
  ACPI / PNP: Avoid conflicting resource reservations

* acpi-scan:
  ACPI / scan: constify ACPI device ids
  ACPI / property: Define a symbol for PRP0001
  ACPI / property: Refine consistency check for PRP0001

* acpi-proc:
  ACPI / proc: make ACPI_PROCFS_POWER X86 only

* acpi-doc:
  ACPI: Constify ACPI device IDs in documentation
  ACPI / enumeration: Document the rules regarding the PRP0001 device ID
  ACPI: fix kernel-parameters ordering in Documentation
Loading
Loading
Loading
Loading
+54 −3
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ Adding ACPI support for an existing driver should be pretty
straightforward. Here is the simplest example:

	#ifdef CONFIG_ACPI
	static struct acpi_device_id mydrv_acpi_match[] = {
	static const struct acpi_device_id mydrv_acpi_match[] = {
		/* ACPI IDs here */
		{ }
	};
@@ -166,7 +166,7 @@ the platform device drivers. Below is an example where we add ACPI support
to at25 SPI eeprom driver (this is meant for the above ACPI snippet):

	#ifdef CONFIG_ACPI
	static struct acpi_device_id at25_acpi_match[] = {
	static const struct acpi_device_id at25_acpi_match[] = {
		{ "AT25", 0 },
		{ },
	};
@@ -230,7 +230,7 @@ Below is an example of how to add ACPI support to the existing mpu3050
input driver:

	#ifdef CONFIG_ACPI
	static struct acpi_device_id mpu3050_acpi_match[] = {
	static const struct acpi_device_id mpu3050_acpi_match[] = {
		{ "MPU3050", 0 },
		{ },
	};
@@ -359,3 +359,54 @@ the id should be set like:
The ACPI id "XYZ0001" is then used to lookup an ACPI device directly under
the MFD device and if found, that ACPI companion device is bound to the
resulting child platform device.

Device Tree namespace link device ID
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Device Tree protocol uses device indentification based on the "compatible"
property whose value is a string or an array of strings recognized as device
identifiers by drivers and the driver core.  The set of all those strings may be
regarded as a device indentification namespace analogous to the ACPI/PNP device
ID namespace.  Consequently, in principle it should not be necessary to allocate
a new (and arguably redundant) ACPI/PNP device ID for a devices with an existing
identification string in the Device Tree (DT) namespace, especially if that ID
is only needed to indicate that a given device is compatible with another one,
presumably having a matching driver in the kernel already.

In ACPI, the device identification object called _CID (Compatible ID) is used to
list the IDs of devices the given one is compatible with, but those IDs must
belong to one of the namespaces prescribed by the ACPI specification (see
Section 6.1.2 of ACPI 6.0 for details) and the DT namespace is not one of them.
Moreover, the specification mandates that either a _HID or an _ADR identificaion
object be present for all ACPI objects representing devices (Section 6.1 of ACPI
6.0).  For non-enumerable bus types that object must be _HID and its value must
be a device ID from one of the namespaces prescribed by the specification too.

The special DT namespace link device ID, PRP0001, provides a means to use the
existing DT-compatible device identification in ACPI and to satisfy the above
requirements following from the ACPI specification at the same time.  Namely,
if PRP0001 is returned by _HID, the ACPI subsystem will look for the
"compatible" property in the device object's _DSD and will use the value of that
property to identify the corresponding device in analogy with the original DT
device identification algorithm.  If the "compatible" property is not present
or its value is not valid, the device will not be enumerated by the ACPI
subsystem.  Otherwise, it will be enumerated automatically as a platform device
(except when an I2C or SPI link from the device to its parent is present, in
which case the ACPI core will leave the device enumeration to the parent's
driver) and the identification strings from the "compatible" property value will
be used to find a driver for the device along with the device IDs listed by _CID
(if present).

Analogously, if PRP0001 is present in the list of device IDs returned by _CID,
the identification strings listed by the "compatible" property value (if present
and valid) will be used to look for a driver matching the device, but in that
case their relative priority with respect to the other device IDs listed by
_HID and _CID depends on the position of PRP0001 in the _CID return package.
Specifically, the device IDs returned by _HID and preceding PRP0001 in the _CID
return package will be checked first.  Also in that case the bus type the device
will be enumerated to depends on the device ID returned by _HID.

It is valid to define device objects with a _HID returning PRP0001 and without
the "compatible" property in the _DSD or a _CID as long as one of their
ancestors provides a _DSD with a valid "compatible" property.  Such device
objects are then simply regarded as additional "blocks" providing hierarchical
configuration information to the driver of the composite ancestor device.
+31 −31
Original line number Diff line number Diff line
@@ -179,11 +179,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

			See also Documentation/power/runtime_pm.txt, pci=noacpi

	acpi_rsdp=	[ACPI,EFI,KEXEC]
			Pass the RSDP address to the kernel, mostly used
			on machines running EFI runtime service to boot the
			second kernel for kdump.

	acpi_apic_instance=	[ACPI, IOAPIC]
			Format: <int>
			2: use 2nd APIC table, if available
@@ -197,6 +192,14 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			(e.g. thinkpad_acpi, sony_acpi, etc.) instead
			of the ACPI video.ko driver.

	acpica_no_return_repair [HW, ACPI]
			Disable AML predefined validation mechanism
			This mechanism can repair the evaluation result to make
			the return objects more ACPI specification compliant.
			This option is useful for developers to identify the
			root cause of an AML interpreter issue when the issue
			has something to do with the repair mechanism.

	acpi.debug_layer=	[HW,ACPI,ACPI_DEBUG]
	acpi.debug_level=	[HW,ACPI,ACPI_DEBUG]
			Format: <int>
@@ -225,6 +228,22 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			unusable.  The "log_buf_len" parameter may be useful
			if you need to capture more output.

	acpi_enforce_resources=	[ACPI]
			{ strict | lax | no }
			Check for resource conflicts between native drivers
			and ACPI OperationRegions (SystemIO and SystemMemory
			only). IO ports and memory declared in ACPI might be
			used by the ACPI subsystem in arbitrary AML code and
			can interfere with legacy drivers.
			strict (default): access to resources claimed by ACPI
			is denied; legacy drivers trying to access reserved
			resources will fail to bind to device using them.
			lax: access to resources claimed by ACPI is allowed;
			legacy drivers trying to access reserved resources
			will bind successfully but a warning message is logged.
			no: ACPI OperationRegions are not marked as reserved,
			no further checks are performed.

	acpi_force_table_verification	[HW,ACPI]
			Enable table checksum verification during early stage.
			By default, this is disabled due to x86 early mapping
@@ -253,6 +272,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			This feature is enabled by default.
			This option allows to turn off the feature.

	acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
			   kernels.

	acpi_no_static_ssdt	[HW,ACPI]
			Disable installation of static SSDTs at early boot time
			By default, SSDTs contained in the RSDT/XSDT will be
@@ -263,13 +285,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			dynamic table installation which will install SSDT
			tables to /sys/firmware/acpi/tables/dynamic.

	acpica_no_return_repair [HW, ACPI]
			Disable AML predefined validation mechanism
			This mechanism can repair the evaluation result to make
			the return objects more ACPI specification compliant.
			This option is useful for developers to identify the
			root cause of an AML interpreter issue when the issue
			has something to do with the repair mechanism.
	acpi_rsdp=	[ACPI,EFI,KEXEC]
			Pass the RSDP address to the kernel, mostly used
			on machines running EFI runtime service to boot the
			second kernel for kdump.

	acpi_os_name=	[HW,ACPI] Tell ACPI BIOS the name of the OS
			Format: To spoof as Windows 98: ="Microsoft Windows"
@@ -365,25 +384,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
			Use timer override. For some broken Nvidia NF5 boards
			that require a timer override, but don't have HPET

	acpi_enforce_resources=	[ACPI]
			{ strict | lax | no }
			Check for resource conflicts between native drivers
			and ACPI OperationRegions (SystemIO and SystemMemory
			only). IO ports and memory declared in ACPI might be
			used by the ACPI subsystem in arbitrary AML code and
			can interfere with legacy drivers.
			strict (default): access to resources claimed by ACPI
			is denied; legacy drivers trying to access reserved
			resources will fail to bind to device using them.
			lax: access to resources claimed by ACPI is allowed;
			legacy drivers trying to access reserved resources
			will bind successfully but a warning message is logged.
			no: ACPI OperationRegions are not marked as reserved,
			no further checks are performed.

	acpi_no_memhotplug [ACPI] Disable memory hotplug.  Useful for kdump
			   kernels.

	add_efi_memmap	[EFI; X86] Include EFI memory map in
			kernel's map of available physical RAM.

+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ config ACPI_SLEEP

config ACPI_PROCFS_POWER
	bool "Deprecated power /proc/acpi directories"
	depends on PROC_FS
	depends on X86 && PROC_FS
	help
	  For backwards compatibility, this option allows
          deprecated power /proc/acpi/ directories to exist, even when
+41 −15
Original line number Diff line number Diff line
@@ -470,6 +470,16 @@ static int __init acpi_bus_init_irq(void)
	return 0;
}

/**
 * acpi_early_init - Initialize ACPICA and populate the ACPI namespace.
 *
 * The ACPI tables are accessible after this, but the handling of events has not
 * been initialized and the global lock is not available yet, so AML should not
 * be executed at this point.
 *
 * Doing this before switching the EFI runtime services to virtual mode allows
 * the EfiBootServices memory to be freed slightly earlier on boot.
 */
void __init acpi_early_init(void)
{
	acpi_status status;
@@ -533,13 +543,34 @@ void __init acpi_early_init(void)
		acpi_gbl_FADT.sci_interrupt = acpi_sci_override_gsi;
	}
#endif
	return;

 error0:
	disable_acpi();
}

/**
 * acpi_subsystem_init - Finalize the early initialization of ACPI.
 *
 * Switch over the platform to the ACPI mode (if possible), initialize the
 * handling of ACPI events, install the interrupt and global lock handlers.
 *
 * Doing this too early is generally unsafe, but at the same time it needs to be
 * done before all things that really depend on ACPI.  The right spot appears to
 * be before finalizing the EFI initialization.
 */
void __init acpi_subsystem_init(void)
{
	acpi_status status;

	if (acpi_disabled)
		return;

	status = acpi_enable_subsystem(~ACPI_NO_ACPI_ENABLE);
	if (ACPI_FAILURE(status)) {
		printk(KERN_ERR PREFIX "Unable to enable ACPI\n");
		goto error0;
	}

		disable_acpi();
	} else {
		/*
		 * If the system is using ACPI then we can be reasonably
		 * confident that any regulators are managed by the firmware
@@ -547,12 +578,7 @@ void __init acpi_early_init(void)
		 * know.
		 */
		regulator_has_full_constraints();

	return;

      error0:
	disable_acpi();
	return;
	}
}

static int __init acpi_bus_init(void)
+2 −0
Original line number Diff line number Diff line
@@ -191,6 +191,8 @@ bool acpi_osi_is_win8(void);
/*--------------------------------------------------------------------------
				Device properties
  -------------------------------------------------------------------------- */
#define ACPI_DT_NAMESPACE_HID	"PRP0001"

void acpi_init_properties(struct acpi_device *adev);
void acpi_free_properties(struct acpi_device *adev);

Loading