-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'acpi-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kerne…
…l/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These are usual ACPICA code updates (although there are more of them than in the last few releases), a noticeable EC driver update (which mostly consists of cleanups, though), the device enumeration quirks handling rework from Hans, some updates eliminating unnecessary CPU cache flushing in some places (processor idle and system-wide PM code) and a bunch of assorted cleanups and fixes. Specifics: - Update ACPICA code in the kernel to the 20211217 upstream release including the following changes: - iASL/Disassembler: Additional support for NHLT table (Bob Moore). - Change a return_ACPI_STATUS (AE_BAD_PARAMETER) (Bob Moore). - Fix a couple of warnings under MSVC (Bob Moore). - iASL: Add TDEL table to both compiler/disassembler (Bob Moore). - iASL/NHLT table: "Specific Data" field support (Bob Moore). - Use original data_table_region pointer for accesses (Jessica Clarke). - Use original pointer for virtual origin tables (Jessica Clarke). - Macros: Remove ACPI_PHYSADDR_TO_PTR (Jessica Clarke). - Avoid subobject buffer overflow when validating RSDP signature (Jessica Clarke). - iASL: Add suppport for AGDI table (Ilkka Koskinen). - Hardware: Do not flush CPU cache when entering S4 and S5 (Kirill A. Shutemov). - Expand the ACPI_ACCESS_ definitions (Mark Langsdorf). - Utilities: Avoid deleting the same object twice in a row (Rafael Wysocki). - Executer: Fix REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R() (Rafael Wysocki). - Fix AEST Processor generic resource substructure data field byte length (Shuuichirou Ishii). - Fix wrong interpretation of PCC address (Sudeep Holla). - Add support for PCC Opregion special context data (Sudeep Holla). - Implement OperationRegion handler for PCC Type 3 subtype (Sudeep Holla). - Introduce acpi_fetch_acpi_dev() as a replacement for acpi_bus_get_device() and use it in the ACPI subsystem (Rafael Wysocki). - Avoid using _CID for device enumaration if _HID is missing or invalid (Rafael Wysocki). - Rework quirk handling during ACPI device enumeration and add some new quirks for known broken platforms (Hans de Goede). - Avoid unnecessary or redundant CPU cache flushing during system PM transitions (Kirill A. Shutemov). - Add PM debug messages related to power resources (Rafael Wysocki). - Fix kernel-doc comment in the PCI host bridge ACPI driver (Yang Li). - Rework flushing of EC work while suspended to idle and clean up the handling of events in the ACPI EC driver (Rafael Wysocki). - Prohibit ec_sys module parameter write_support from being used when the system is locked down (Hans de Goede). - Make the ACPI processor thermal driver use cpufreq_cpu_get() to check for presence of cpufreq policy (Manfred Spraul). - Avoid unnecessary CPU cache flushing in the ACPI processor idle driver (Kirill A. Shutemov). - Replace kernel.h with the necessary inclusions in the ACPI processor driver (Andy Shevchenko). - Use swap() instead of open coding it in the ACPI processor idle driver (Guo Zhengkui). - Fix the handling of defective LPAT in the ACPI xpower PMIC driver and clean up some definitions of PMIC data structures (Hans de Goede). - Fix outdated comment in the ACPI DPTF driver (Sumeet Pawnikar). - Add AEST to the list of known ACPI table signatures (Shuuichirou Ishii). - Make ACPI NUMA code take hotpluggable memblocks into account when CONFIG_MEMORY_HOTPLUG is not set (Vitaly Kuznetsov). - Use default_groups in kobj_type in the ACPI sysfs code (Greg Kroah-Hartman). - Rearrange _CPC structure documentation (Andy Shevchenko). - Drop an always true check from the ACPI thermal driver (Adam Borowski). - Add new "not charging" quirk for Lenovo ThinkPads to the ACPI battery driver (Thomas Weißschuh)" * tag 'acpi-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (64 commits) ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype ACPI / x86: Skip AC and battery devices on x86 Android tablets with broken DSDTs ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper ACPI: processor: thermal: avoid cpufreq_get_policy() serdev: Do not instantiate serdevs on boards with known bogus DSDT entries i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment ACPI: battery: Add the ThinkPad "Not Charging" quirk ACPI: sysfs: use default_groups in kobj_type ACPICA: Update version to 20211217 ACPICA: iASL/NHLT table: "Specific Data" field support ACPICA: iASL: Add suppport for AGDI table ACPICA: iASL: Add TDEL table to both compiler/disassembler ACPICA: Fixed a couple of warnings under MSVC ACPICA: Change a return_ACPI_STATUS (AE_BAD_PARAMETER) ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5 ACPICA: Add support for PCC Opregion special context data ACPICA: Fix wrong interpretation of PCC address ...
- Loading branch information
Showing
72 changed files
with
1,210 additions
and
590 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
// SPDX-License-Identifier: GPL-2.0-only | ||
/* | ||
* Author: Sudeep Holla <sudeep.holla@arm.com> | ||
* Copyright 2021 Arm Limited | ||
* | ||
* The PCC Address Space also referred as PCC Operation Region pertains to the | ||
* region of PCC subspace that succeeds the PCC signature. The PCC Operation | ||
* Region works in conjunction with the PCC Table(Platform Communications | ||
* Channel Table). PCC subspaces that are marked for use as PCC Operation | ||
* Regions must not be used as PCC subspaces for the standard ACPI features | ||
* such as CPPC, RASF, PDTT and MPST. These standard features must always use | ||
* the PCC Table instead. | ||
* | ||
* This driver sets up the PCC Address Space and installs an handler to enable | ||
* handling of PCC OpRegion in the firmware. | ||
* | ||
*/ | ||
#include <linux/kernel.h> | ||
#include <linux/acpi.h> | ||
#include <linux/completion.h> | ||
#include <linux/idr.h> | ||
#include <linux/io.h> | ||
|
||
#include <acpi/pcc.h> | ||
|
||
struct pcc_data { | ||
struct pcc_mbox_chan *pcc_chan; | ||
void __iomem *pcc_comm_addr; | ||
struct completion done; | ||
struct mbox_client cl; | ||
struct acpi_pcc_info ctx; | ||
}; | ||
|
||
struct acpi_pcc_info pcc_ctx; | ||
|
||
static void pcc_rx_callback(struct mbox_client *cl, void *m) | ||
{ | ||
struct pcc_data *data = container_of(cl, struct pcc_data, cl); | ||
|
||
complete(&data->done); | ||
} | ||
|
||
static acpi_status | ||
acpi_pcc_address_space_setup(acpi_handle region_handle, u32 function, | ||
void *handler_context, void **region_context) | ||
{ | ||
struct pcc_data *data; | ||
struct acpi_pcc_info *ctx = handler_context; | ||
struct pcc_mbox_chan *pcc_chan; | ||
|
||
data = kzalloc(sizeof(*data), GFP_KERNEL); | ||
if (!data) | ||
return AE_NO_MEMORY; | ||
|
||
data->cl.rx_callback = pcc_rx_callback; | ||
data->cl.knows_txdone = true; | ||
data->ctx.length = ctx->length; | ||
data->ctx.subspace_id = ctx->subspace_id; | ||
data->ctx.internal_buffer = ctx->internal_buffer; | ||
|
||
init_completion(&data->done); | ||
data->pcc_chan = pcc_mbox_request_channel(&data->cl, ctx->subspace_id); | ||
if (IS_ERR(data->pcc_chan)) { | ||
pr_err("Failed to find PCC channel for subspace %d\n", | ||
ctx->subspace_id); | ||
return AE_NOT_FOUND; | ||
} | ||
|
||
pcc_chan = data->pcc_chan; | ||
data->pcc_comm_addr = acpi_os_ioremap(pcc_chan->shmem_base_addr, | ||
pcc_chan->shmem_size); | ||
if (!data->pcc_comm_addr) { | ||
pr_err("Failed to ioremap PCC comm region mem for %d\n", | ||
ctx->subspace_id); | ||
return AE_NO_MEMORY; | ||
} | ||
|
||
*region_context = data; | ||
return AE_OK; | ||
} | ||
|
||
static acpi_status | ||
acpi_pcc_address_space_handler(u32 function, acpi_physical_address addr, | ||
u32 bits, acpi_integer *value, | ||
void *handler_context, void *region_context) | ||
{ | ||
int ret; | ||
struct pcc_data *data = region_context; | ||
|
||
reinit_completion(&data->done); | ||
|
||
/* Write to Shared Memory */ | ||
memcpy_toio(data->pcc_comm_addr, (void *)value, data->ctx.length); | ||
|
||
ret = mbox_send_message(data->pcc_chan->mchan, NULL); | ||
if (ret < 0) | ||
return AE_ERROR; | ||
|
||
if (data->pcc_chan->mchan->mbox->txdone_irq) | ||
wait_for_completion(&data->done); | ||
|
||
mbox_client_txdone(data->pcc_chan->mchan, ret); | ||
|
||
memcpy_fromio(value, data->pcc_comm_addr, data->ctx.length); | ||
|
||
return AE_OK; | ||
} | ||
|
||
void __init acpi_init_pcc(void) | ||
{ | ||
acpi_status status; | ||
|
||
status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, | ||
ACPI_ADR_SPACE_PLATFORM_COMM, | ||
&acpi_pcc_address_space_handler, | ||
&acpi_pcc_address_space_setup, | ||
&pcc_ctx); | ||
if (ACPI_FAILURE(status)) | ||
pr_alert("OperationRegion handler could not be installed\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.