提交 596d3de1 编写于 作者: B Benjamin Herrenschmidt 提交者: Xie XiuQi

PCI/ACPI: Evaluate PCI Boot Configuration _DSM

mainline inclusion
from mainline-5.3-rc3
commit a78cf965
category: feature
bugzilla: 23453
CVE: NA

-------------------------------------------

Evaluate _DSM Function #5, the "PCI Boot Configuration" function.  If the
result is 0, the OS should preserve any resource assignments made by the
firmware.

Link: https://lore.kernel.org/r/20190615002359.29577-2-benh@kernel.crashing.orgSigned-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
[bhelgaas: commit log]
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 1fb992c0
...@@ -883,6 +883,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, ...@@ -883,6 +883,7 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
int node = acpi_get_node(device->handle); int node = acpi_get_node(device->handle);
struct pci_bus *bus; struct pci_bus *bus;
struct pci_host_bridge *host_bridge; struct pci_host_bridge *host_bridge;
union acpi_object *obj;
info->root = root; info->root = root;
info->bridge = device; info->bridge = device;
...@@ -919,6 +920,17 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, ...@@ -919,6 +920,17 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
if (!(root->osc_control_set & OSC_PCI_EXPRESS_LTR_CONTROL)) if (!(root->osc_control_set & OSC_PCI_EXPRESS_LTR_CONTROL))
host_bridge->native_ltr = 0; host_bridge->native_ltr = 0;
/*
* Evaluate the "PCI Boot Configuration" _DSM Function. If it
* exists and returns 0, we must preserve any PCI resource
* assignments made by firmware for this host bridge.
*/
obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
IGNORE_PCI_BOOT_CONFIG_DSM, NULL);
if (obj && obj->type == ACPI_TYPE_INTEGER && obj->integer.value == 0)
host_bridge->preserve_config = 1;
ACPI_FREE(obj);
pci_scan_child_bus(bus); pci_scan_child_bus(bus);
pci_set_host_bridge_release(host_bridge, acpi_pci_root_release_info, pci_set_host_bridge_release(host_bridge, acpi_pci_root_release_info,
info); info);
......
...@@ -107,9 +107,10 @@ static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } ...@@ -107,9 +107,10 @@ static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { }
#endif #endif
extern const guid_t pci_acpi_dsm_guid; extern const guid_t pci_acpi_dsm_guid;
#define DEVICE_LABEL_DSM 0x07 #define IGNORE_PCI_BOOT_CONFIG_DSM 0x05
#define RESET_DELAY_DSM 0x08 #define DEVICE_LABEL_DSM 0x07
#define FUNCTION_DELAY_DSM 0x09 #define RESET_DELAY_DSM 0x08
#define FUNCTION_DELAY_DSM 0x09
#else /* CONFIG_ACPI */ #else /* CONFIG_ACPI */
static inline void acpi_pci_add_bus(struct pci_bus *bus) { } static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
......
...@@ -512,6 +512,8 @@ struct pci_host_bridge { ...@@ -512,6 +512,8 @@ struct pci_host_bridge {
unsigned int native_shpc_hotplug:1; /* OS may use SHPC hotplug */ unsigned int native_shpc_hotplug:1; /* OS may use SHPC hotplug */
unsigned int native_pme:1; /* OS may use PCIe PME */ unsigned int native_pme:1; /* OS may use PCIe PME */
unsigned int native_ltr:1; /* OS may use PCIe LTR */ unsigned int native_ltr:1; /* OS may use PCIe LTR */
unsigned int preserve_config:1; /* Preserve FW resource setup */
/* Resource alignment requirements */ /* Resource alignment requirements */
resource_size_t (*align_resource)(struct pci_dev *dev, resource_size_t (*align_resource)(struct pci_dev *dev,
const struct resource *res, const struct resource *res,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册