mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
PCI/ACPI: Move _OSC query checks to separate function
Move the checks about whether the _OSC controls are requested from the firmware to a separate function. Link: https://lore.kernel.org/r/20210824122054.29481-4-joro@8bytes.org Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Rafael J. Wysocki <rafael@kernel.org>
This commit is contained in:
parent
4c6f6060b7
commit
87f1f87a16
@ -449,6 +449,24 @@ static u32 calculate_control(void)
|
||||
return control;
|
||||
}
|
||||
|
||||
static bool os_control_query_checks(struct acpi_pci_root *root, u32 support)
|
||||
{
|
||||
struct acpi_device *device = root->device;
|
||||
|
||||
if (pcie_ports_disabled) {
|
||||
dev_info(&device->dev, "PCIe port services disabled; not requesting _OSC control\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
|
||||
decode_osc_support(root, "not requesting OS control; OS requires",
|
||||
ACPI_PCIE_REQ_SUPPORT);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
|
||||
bool is_pcie)
|
||||
{
|
||||
@ -485,16 +503,8 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
|
||||
return;
|
||||
}
|
||||
|
||||
if (pcie_ports_disabled) {
|
||||
dev_info(&device->dev, "PCIe port services disabled; not requesting _OSC control\n");
|
||||
if (!os_control_query_checks(root, support))
|
||||
return;
|
||||
}
|
||||
|
||||
if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
|
||||
decode_osc_support(root, "not requesting OS control; OS requires",
|
||||
ACPI_PCIE_REQ_SUPPORT);
|
||||
return;
|
||||
}
|
||||
|
||||
requested = control = calculate_control();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user