summaryrefslogtreecommitdiffstats
path: root/Documentation/driver-api/acpi
AgeCommit message (Collapse)AuthorLines
2026-01-15ACPI: Documentation: driver-api: Disapprove of using ACPI driversRafael J. Wysocki-0/+81
Sadly, there is quite a bit of technical debt related to the kernel's ACPI support subsystem and one of the most significant pieces of it is the existence and use of ACPI drivers represented by struct acpi_driver objects. Those drivers are bound directly to struct acpi_device objects, also referred to as "ACPI device nodes", representing device objects in the ACPI namespace defined as: A hierarchical tree structure in OS-controlled memory that contains named objects. These objects may be data objects, control method objects, bus/device package objects, and so on. according to the ACPI specification [1]. The above definition implies, although rather indirectly, that the objects in question don't really represent hardware. They are just "device package objects" containing some information on the devices present in the given platform that is known to the platform firmware. Although the platform firmware can be the only source of information on some devices, the information provided by it alone may be insufficient for device enumeration in general. If that is the case, binding a driver directly to a given ACPI device node clearly doesn't make sense. If the device in question is enumerated through a hardware interface, it will be represented by a device object matching that interface, like a struct pci_dev, and the ACPI device node corresponding to it will be treated as its "ACPI companions" whose role is to amend the "native" enumeratiom mechanism. For the sake of consistency and confusion avoidance, it is better to treat ACPI device nodes in general as ACPI companions of other device objects representing hardware. In some cases though it appeared easier to take a shortcut and use an ACPI driver binding directly to an ACPI device node. Moreover, there were corner cases in which that was the only choice, but they all have been addressed now. In all cases in which an ACPI driver might be used, the ACPI device node it might bind to is an ACPI companion of another device object representing a piece of hardware. It is thus better to use a driver binding to the latter than to use an ACPI driver and leave the other device object alone, not just because doing so is more consistent and less confusing, but also because using ACPI drivers may lead to potential functional deficiencies, like possible ordering issues related to power management. Unfortunately, there are quite a few ACPI drivers in use and, as a rule, they bind to ACPI device nodes that are ACPI companions of platform devices, so in fact they play the role of platform drivers although in a kind of convoluted way. An effort has been under way to replace them with platform drivers, which is relatively straightforward in the vast majority of cases, but it has not been pursued very aggressively so far, mostly due to the existence of the corner cases mentioned above. However, since those corner cases are gone now, it makes sense to spend more time on driver conversions with the ultimate goal to get rid of struct acpi_driver and the related code from the kernel. To that end, add a document explaining why using ACPI drivers is not a good idea, so it need not be explained from scratch on every attempt to convert an ACPI driver to a platform one. Link: https://uefi.org/specs/ACPI/6.6/02_Definition_of_Terms.html#term-ACPI-Namespace [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Reviewed-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Danilo Krummrich <dakr@kernel.org> Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Link: https://patch.msgid.link/2396510.ElGaqSPkdT@rafael.j.wysocki
2021-06-17Documentation: ACPI: fix error script nameHao Chen-1/+1
The correct script name should be 'divergence.sh' instead of 'divergences.sh'. I didn't find divergences.sh in the path of acpica/generate/linux/. Signed-off-by: Hao Chen <chenhaoa@uniontech.com> Link: https://lore.kernel.org/r/20210617023300.30114-1-chenhaoa@uniontech.com Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-06-08Replace HTTP links with HTTPS ones: documentationAlexander A. Klimov-3/+3
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Link: https://lore.kernel.org/r/20200526060544.25127-1-grandmaster@al2klimov.de Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2019-04-25Documentation: ACPI: move scan_handlers.txt to driver-api/acpi and convert ↵Changbin Du-0/+84
to reST This converts the plain text documentation to reStructuredText format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-04-25Documentation: ACPI: move linuxized-acpica.txt to driver-api/acpi and ↵Changbin Du-0/+280
convert to reST This converts the plain text documentation to reStructuredText format and adds it to Sphinx TOC tree. No essential content change. Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-04-25Documentation: add Linux ACPI to Sphinx TOC treeChangbin Du-0/+7
Add below index.rst files for ACPI subsystem. More docs will be added later. o admin-guide/acpi/index.rst o driver-api/acpi/index.rst o firmware-guide/index.rst Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>