Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Make a shareable UUID for PCI firmware ACPI _DSM

The PCI Firmware Specification, r3.0, sec 4.6.4.1.3, defines a single UUID
for an ACPI _DSM method to provide device-specific control functions. This
_DSM method support several functions, including PCI Express Slot
Information, PCI Express Slot Number, PCI Bus Capabilities, etc.

Move the UUID definition from pci/pci-label.c, where it could be used only
for one function, to pci/pci-acpi.c where it can be shared for all these
functions.

[bhelgaas: changelog]
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Aaron Lu and committed by
Bjorn Helgaas
18e94a33 c89ac443

+14 -9
+9
drivers/pci/pci-acpi.c
··· 18 18 #include <linux/pm_qos.h> 19 19 #include "pci.h" 20 20 21 + /* 22 + * The UUID is defined in the PCI Firmware Specification available here: 23 + * https://www.pcisig.com/members/downloads/pcifw_r3_1_13Dec10.pdf 24 + */ 25 + const u8 pci_acpi_dsm_uuid[] = { 26 + 0xd0, 0x37, 0xc9, 0xe5, 0x53, 0x35, 0x7a, 0x4d, 27 + 0x91, 0x17, 0xea, 0x4d, 0x19, 0xc3, 0x43, 0x4d 28 + }; 29 + 21 30 phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle) 22 31 { 23 32 acpi_status status = AE_NOT_EXIST;
+2 -9
drivers/pci/pci-label.c
··· 31 31 #include <linux/pci-acpi.h> 32 32 #include "pci.h" 33 33 34 - #define DEVICE_LABEL_DSM 0x07 35 - 36 34 #ifdef CONFIG_DMI 37 35 enum smbios_attr_enum { 38 36 SMBIOS_ATTR_NONE = 0, ··· 146 148 #endif 147 149 148 150 #ifdef CONFIG_ACPI 149 - static const char device_label_dsm_uuid[] = { 150 - 0xD0, 0x37, 0xC9, 0xE5, 0x53, 0x35, 0x7A, 0x4D, 151 - 0x91, 0x17, 0xEA, 0x4D, 0x19, 0xC3, 0x43, 0x4D 152 - }; 153 - 154 151 enum acpi_attr_enum { 155 152 ACPI_ATTR_LABEL_SHOW, 156 153 ACPI_ATTR_INDEX_SHOW, ··· 172 179 if (!handle) 173 180 return -1; 174 181 175 - obj = acpi_evaluate_dsm(handle, device_label_dsm_uuid, 0x2, 182 + obj = acpi_evaluate_dsm(handle, pci_acpi_dsm_uuid, 0x2, 176 183 DEVICE_LABEL_DSM, NULL); 177 184 if (!obj) 178 185 return -1; ··· 212 219 if (!handle) 213 220 return false; 214 221 215 - return !!acpi_check_dsm(handle, device_label_dsm_uuid, 0x2, 222 + return !!acpi_check_dsm(handle, pci_acpi_dsm_uuid, 0x2, 216 223 1 << DEVICE_LABEL_DSM); 217 224 } 218 225
+3
include/linux/pci-acpi.h
··· 77 77 static inline void acpiphp_check_host_bridge(struct acpi_device *adev) { } 78 78 #endif 79 79 80 + extern const u8 pci_acpi_dsm_uuid[]; 81 + #define DEVICE_LABEL_DSM 0x07 82 + 80 83 #else /* CONFIG_ACPI */ 81 84 static inline void acpi_pci_add_bus(struct pci_bus *bus) { } 82 85 static inline void acpi_pci_remove_bus(struct pci_bus *bus) { }