summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-10-21 12:08:18 -1000
committerLinus Torvalds <torvalds@linux-foundation.org>2026-10-21 12:08:18 -1000
commit4df4d2a577db2d3d57b888bcfb1206fc74661d16 (patch)
tree367359c23fde15d3821059affdd4101a7ac447c1 /include
parentccc4d9f8912a5d9f519a34c3633fe53c8f9b429e (diff)
parent84c4409e8566549d0f21f25e2bac9327dc279d23 (diff)
Merge tag 'acpi-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI support updates from Rafael Wysocki: "The most significant change here is the rework of the core ACPI device enumeration code to avoid initializing ACPI power management prematurely for devices with unmet dependencies. This essentially is a problem fix, but it requires taking PCI device enumeration ordering into account among other things, so it is far from straightforward. There was an attempt to do this in the 7.3 time frame that had to be reverted, so this time it is done much more carefully. There is also an ACPI thermal control update rearranging the code to register thermal class cooling devices under specific parents, which is visible in sysfs. This helps to figure out what is represented by those devices much more easily, but it also allows the binding of cooling devices to trip points in thermal zones to be adjusted so it need not rely on specific cooling device data usage in thermal drivers. From the number of commits perspective, the most visible part is the one replacing acpi_get_first_physical_node() with acpi_bus_get_primary_device() everywhere and dropping the former that was inherently racy and generally unsafe to use. Fortunately, the maintainers involved responded timely and all of that could be done within one development cycle. Another quite visible part is Dave Jiang's series fixing multiple issues reported by Sashiko in the ACPI APEI support code with a PCI AER improvement on top. It took several iterations of this to make Sashiko happy and the code in question should be much more robust going forward. One other thing worth mentioning separately is that the ACPI bus type is now going to be registered as a "companion" one and it will not be possible to register a driver binding directly to a struct acpi_device. All of the existing users of those drivers in the tree were converted to platform drivers in the previous cycles, so this is just a final step in a longer journey. Apart from the above, there are many fixes, mostly in drivers, with a noticeable exception of a fix in the code binding devices to their ACPI companions, new IOVT IOMMU support in ACPICA, new _Ixx object support for suspend-to-idle on x86, multiple new quirks, mostly related to unused ACPI power resources and backlight handling, and assorted cleanups. Specifics: - Make the core ACPI device enumeration code stop attempting to initialize ACPI power management for devices before they are known to be present and functional (Rafael Wysocki) - Simplify and clean up the core ACPI device enumeration code on top of the previous adjustment and reduce debug noise coming from it (Rafael Wysocki) - Fix locking in the code binding devices to their ACPI companions, prevent it from replacing a valid ACPI companion pointer with NULL incidentally, improve its messaging (including debug noise reduction), and reduce its overhead by making it skip the cases in which no ACPI companion may exist early (Rafael Wysocki) - Reduce runtime memory footprint of struct acpi_device by rearranging fields in it (Andy Shevchenko) - Update the driver core to allow bus types without drivers to be registered as "companion bus types" without driver-related sysfs attributes and register the ACPI bus type as a companion one (Rafael Wysocki) - Use strscpy() instead of strcpy() in the ACPI sysfs interface (Ruslan Vagner) - Remove __meminitdata from hmat_adist_nb declaration preserving it even when CONFIG_MEMORY_HOTPLUG is not set to prevent notifier chain corruption in some cases (Alejandro Lucero) - Prevent a NULL pointer dereference when attempting to read the table length after a mapping bookkeeping failure during an initrd override invocation with permanent table mappings enabled (Slavin Liu) - Use for_each_populated_zone() in get_node_num() in the MRRM table pareser (Sang-Heon Jeon) - Use vsnprintf() in acpi_os_vprintf() to prevent memory corruption resulting from overly long diagnostic messages that may not fit into a static buffer used by ACPICA and may be produced by a malformed ACPI table (Vlatko Kosturjak) - Ignore leading root scope prefix in string _UID match to allow AMD IOMMU matching to work as expected in some cases (Mario Limonciello) - Adjust message printing macros for ACPI objects to use dev_fmt() for more consistency with the analogous dev_*() macros (Rafael Wysocki) - Add _Ixx GPE wake indicator support to the x86 suspend-to-idle handling code (Saranya Gopal) - Clear driver_data before free in the ACPI PCI Link driver to prevent a dangling pointer from being used later (Jiale Yao) - Accumulate the queued flag across error sections of a CPER record in ghes_do_proc() to prevent it from being cleared by a later section or entry that does not queue memory-failure work (Breno Leitao) - Map a raw PCI AER Capability image field by field to prevent information loss from occurring while processing it (Dave Jiang) - Update a stale driver source reference in the ACPI APEI EINJ driver documentation (Prabhakar Pujeri) - Reject CPER records with an out-of-range error_data_length or an error status block length wrapping a u32 in the EFI CPER driver (Dave Jiang) - Address multiple assorted issues in the ACPI extlog driver (Dave Jiang) - Address two issues related to CXL in the ACPI APEI GHES driver (Dave Jiang) - Read only validated fields in cper_mem_err_pack() (Dave Jiang) - Validate memory error section length before payload access, prevent writes past array bounds from occurring and sanitize software metadata in the ACPI APEI GHES driver (Dave Jiang) - Make cxl_cper_handle_prot_err() static (Dave Jiang) - Add IOVT IOMMU support to ACPICA (Bibo Mao) - Fix PCC OperationRegion command offsets in ACPICA (Sudeep Holla) - Fix memory leak in acpi_ds_create_field() related to the handling of internal_pcc_buffer allocations (Breno Leitao) - Fix memory leak due to leftover devm_kcalloc() argument in the ACPI fan driver (Rafael Wysocki) - Fix backlight unregistration ordering in the ACPI video bus device driver (Rafael Wysocki) - Update the thermal core to allow the registration of thermal class cooling devices under specific parents and convert the ACPI fan, ACPI processor, and ACPI video bus device drivers to do so (Rafael Wysocki) - Adjust the ACPI thermal zone driver to use thermal class cooling device parent information for binding cooling devices to trip points in thermal zones (Rafael Wysocki) - Use cooling device data that is a better match for a given driver instead of a struct acpi_device pointer that had to be used for this purpose previously in the ACPI fan and processor drivers (Rafael Wysocki) - Fix acpi_thermal_guess_offset() in the ACPI thermal zone driver for thermal zone devices with a 273.0°K offset (Hans de Goede) - Define a free for ACPI objects allocated by ACPICA helpers and use it to simplify AML error handling in the ACPI fan driver (Rafael Wysocki) - Switch over the users of acpi_get_first_physical_node(), that was inherently racy and therefore not really safe to use, to use its replacement acpi_bus_get_primary_device(), and eliminate the former (Rafael Wysocki) - Add !CONFIG_ACPI stubs for acpi_find_child_device() and acpi_device_uid() (Mario Limonciello and Robin Murphy) - Fix bogus cycle count values on systems without _BIX in the ACPI battery driver (Armin Wolf) - Fix NULL pointer dereference on allocation failure and report relative state of charge as CAPACITY in the ACPI SBS driver (Itay Shem-tov and Guangshuo Li) - Add lid_init_state quirk for Razer Blade Stealth 13 (Early 2020) RZ09-0310 to the ACPI button driver (Ian Gallagher) - Add new quirks to force the native backlight on Dell OptiPlex AIO 7410 35W and Acer Nitro AN515-58 in the ACPI video bus device driver (Chitransh Mandhaniya and Dirga Yuza) - Fix the shared memory signature handling in the ACPI PCC address space handler, free the PCC mailbox channel on operation region deactivation, and avoid unnecessary repeated computations of the PCC operation region command timeout (Sudeep Holla) - Fix a log message typo in the ACPI NUMA support code (Hemanth Selam) - Zero-initialize capability query result in the ACPI Platform Firmware Runtime Update and Telemetry driver to avoid disclosure of kernel stack data to user space (Karl Mehltretter) - Replace the remaining built-in/module check for CONFIG_ACPI_WMI in a header file with IS_ENABLED() macro (Lalit Shankar Chowdhury) - Retry probing battery docks after hotplug in the ACPI docking station driver to avoid missing ACPI add notifications (Vibhor Goel) - Detach device after resource transition failure in pnp_device_probe() to avoid blocking later manual PNP configuration attempts (Myeonghun Pak)" * tag 'acpi-7.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (90 commits) ACPI: PM: Add Acer Aspire A515-53G to dmi_leave_unused_power_resources_on[] ACPI: video: force native backlight on Dell OptiPlex AIO 7410 35W ACPI: PM: sleep: Drop unused sleep_no_lps0 define ACPI: PM: Add unused power resource quirk for Casper Excalibur G900 ACPI: dock: Retry probing battery docks after hotplug ACPI: PCI: pci_link: clear driver_data before free ACPI: APEI: accumulate the queued flag across error sections ACPICA: actbl2.h: Add bit constants of the Flags field in the IOVT IOMMU structure ACPI: bus: Drop acpi_get_first_physical_node() efi/dev-path-parser: Switch to use acpi_bus_get_primary_device() ALSA: hda: tas2781: Switch to use acpi_bus_get_primary_device() ALSA: hda: cs35l41: Switch to use acpi_bus_get_primary_device() iommu/arm-smmu-v3: Switch to use acpi_bus_get_primary_device() PCI/AER: Map a raw AER Capability image field by field ACPI: NUMA: fix typo in log message ACPI: Add stub for acpi_find_child_device() driver core/ACPI: Introduce companion_bus_register() ACPI: PCC: Cache OpRegion command timeout ACPI: PCC: Free channel on OpRegion deactivation ACPI: PCC: Preserve shared memory signature in OpRegion handler ...
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h43
-rw-r--r--include/acpi/actbl2.h7
-rw-r--r--include/acpi/ghes.h4
-rw-r--r--include/acpi/processor.h6
-rw-r--r--include/cxl/event.h6
-rw-r--r--include/linux/acpi.h37
-rw-r--r--include/linux/aer.h9
-rw-r--r--include/linux/apple-gmux.h2
-rw-r--r--include/linux/device/bus.h1
-rw-r--r--include/linux/thermal.h19
10 files changed, 91 insertions, 43 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index a10a591c18b2..a755b15af9db 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -9,6 +9,8 @@
#ifndef __ACPI_BUS_H__
#define __ACPI_BUS_H__
+#ifdef CONFIG_ACPI
+
#include <linux/completion.h>
#include <linux/container_of.h>
#include <linux/device.h>
@@ -58,7 +60,6 @@ bool acpi_dock_match(acpi_handle handle);
bool acpi_check_dsm(acpi_handle handle, const guid_t *guid, u64 rev, u64 funcs);
union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const guid_t *guid,
u64 rev, u64 func, union acpi_object *argv4);
-#ifdef CONFIG_ACPI
bool
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
@@ -77,7 +78,6 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,
return obj;
}
-#endif
#define ACPI_INIT_DSM_ARGV4(cnt, eles) \
{ \
@@ -90,8 +90,6 @@ bool acpi_dev_found(const char *hid);
bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
bool acpi_reduced_hardware(void);
-#ifdef CONFIG_ACPI
-
struct proc_dir_entry;
#define ACPI_BUS_FILE_ROOT "acpi"
@@ -435,9 +433,9 @@ struct acpi_device_software_nodes {
/* Device */
struct acpi_device {
+ acpi_handle handle; /* no handle for fixed hardware */
u32 pld_crc;
int device_type;
- acpi_handle handle; /* no handle for fixed hardware */
struct fwnode_handle fwnode;
struct list_head wakeup_list;
struct list_head del_list;
@@ -613,7 +611,6 @@ int acpi_bus_get_status(struct acpi_device *device);
int acpi_bus_set_power(acpi_handle handle, int state);
const char *acpi_power_state_string(int state);
int acpi_device_set_power(struct acpi_device *device, int state);
-int acpi_bus_init_power(struct acpi_device *device);
int acpi_device_fix_up_power(struct acpi_device *device);
void acpi_device_fix_up_power_extended(struct acpi_device *adev);
void acpi_device_fix_up_power_children(struct acpi_device *adev);
@@ -665,7 +662,7 @@ struct acpi_bus_type {
int register_acpi_bus_type(struct acpi_bus_type *);
int unregister_acpi_bus_type(struct acpi_bus_type *);
int acpi_bind_one(struct device *dev, struct acpi_device *adev);
-int acpi_unbind_one(struct device *dev);
+void acpi_unbind_one(struct device *dev);
enum acpi_bridge_type {
ACPI_BRIDGE_TYPE_PCIE = 1,
@@ -830,7 +827,15 @@ static inline bool acpi_str_uid_match(struct acpi_device *adev, const char *uid2
{
const char *uid1 = acpi_device_uid(adev);
- return uid1 && uid2 && !strcmp(uid1, uid2);
+ if (!uid1 || !uid2)
+ return false;
+
+ if (*uid1 == '\\' && uid1[1])
+ uid1++;
+ if (*uid2 == '\\' && uid2[1])
+ uid2++;
+
+ return !strcmp(uid1, uid2);
}
static inline bool acpi_int_uid_match(struct acpi_device *adev, u64 uid2)
@@ -857,6 +862,10 @@ static inline bool acpi_int_uid_match(struct acpi_device *adev, u64 uid2)
*
* Matches UID in @adev with given @uid2.
*
+ * If both the UID in @adev and @uid2 are strings, they are compared
+ * after optionally skipping a leading backslash ('\') if the given
+ * string contains additional characters.
+ *
* Returns: %true if matches, %false otherwise.
*/
#define acpi_dev_uid_match(adev, uid2) \
@@ -942,8 +951,21 @@ int acpi_wait_for_acpi_ipmi(void);
int acpi_scan_add_dep(acpi_handle handle, struct acpi_handle_list *dep_devices);
u32 arch_acpi_add_auto_dep(acpi_handle handle);
+
#else /* CONFIG_ACPI */
+static inline struct acpi_device *
+acpi_find_child_device(struct acpi_device *parent, u64 address,
+ bool check_children)
+{
+ return NULL;
+}
+
+static inline bool acpi_has_method(acpi_handle handle, char *name)
+{
+ return false;
+}
+
static inline struct device *acpi_bus_get_primary_device(struct acpi_device *adev)
{
return NULL;
@@ -959,6 +981,11 @@ static inline const char *acpi_device_hid(struct acpi_device *device)
return "";
}
+static inline char *acpi_device_uid(struct acpi_device *device)
+{
+ return NULL;
+}
+
static inline bool
acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld)
{
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index baef525367b5..76e4a5bc79b4 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -919,6 +919,13 @@ struct acpi_iovt_iommu {
u32 device_entry_offset;
};
+/* Masks for Flags field above */
+#define ACPI_IOVT_IOMMU_PCI_DEVICE (1<<0)
+#define ACPI_IOVT_IOMMU_PXM_VALID (1<<1)
+#define ACPI_IOVT_IOMMU_MAGAGE_BY_SEGMENT (1<<2)
+#define ACPI_IOVT_IOMMU_HW_CAP_SUPPORT (1<<3)
+#define ACPI_IOVT_IOMMU_MSI_INT_BYPASS (1<<4)
+
struct acpi_iovt_device_entry {
u8 type;
u8 length;
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index 8d7e5caef3f1..7acf209061ea 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -85,6 +85,10 @@ int devm_ghes_register_vendor_record_notifier(struct device *dev,
struct list_head *ghes_get_devices(void);
void ghes_estatus_pool_region_free(unsigned long addr, u32 size);
+
+struct cxl_cper_sec_prot_err;
+void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,
+ int severity, u32 len);
#else
static inline struct list_head *ghes_get_devices(void) { return NULL; }
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 554be224ce76..b5447af4d40b 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -427,10 +427,8 @@ int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi);
#endif /* CONFIG_ACPI_PROCESSOR_IDLE */
/* in processor_thermal.c */
-int acpi_processor_thermal_init(struct acpi_processor *pr,
- struct acpi_device *device);
-void acpi_processor_thermal_exit(struct acpi_processor *pr,
- struct acpi_device *device);
+int acpi_processor_thermal_init(struct acpi_processor *pr);
+void acpi_processor_thermal_exit(struct acpi_processor *pr);
extern const struct thermal_cooling_device_ops processor_cooling_ops;
#ifdef CONFIG_CPU_FREQ
void acpi_thermal_cpufreq_init(struct cpufreq_policy *policy);
diff --git a/include/cxl/event.h b/include/cxl/event.h
index b5673384d930..a9f5c2381cc9 100644
--- a/include/cxl/event.h
+++ b/include/cxl/event.h
@@ -312,13 +312,13 @@ static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data
#endif
#ifdef CONFIG_ACPI_APEI_PCIEAER
-int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err);
+int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err, u32 len);
int cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd,
struct cxl_cper_sec_prot_err *prot_err,
int severity);
#else
static inline int
-cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err)
+cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err, u32 len)
{
return -EOPNOTSUPP;
}
@@ -331,6 +331,4 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd,
}
#endif
-void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *wd);
-
#endif /* _LINUX_CXL_EVENT_H */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index ddacac812094..d7f1f3d05390 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,17 +25,19 @@ struct irq_domain_ops;
#define _LINUX
#endif
#include <acpi/acpi.h>
+#include <acpi/acpi_bus.h>
#include <acpi/acpi_numa.h>
#ifdef CONFIG_ACPI
+DEFINE_FREE(acpi_object_free, union acpi_object *, if (_T) ACPI_FREE(_T));
+
#include <linux/list.h>
#include <linux/dynamic_debug.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/fw_table.h>
-#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_io.h>
#include <asm/acpi.h>
@@ -105,8 +107,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev)
return dev_name(&adev->dev);
}
-struct device *acpi_get_first_physical_node(struct acpi_device *adev);
-
enum acpi_irq_model_id {
ACPI_IRQ_MODEL_PIC = 0,
ACPI_IRQ_MODEL_IOAPIC,
@@ -434,7 +434,7 @@ extern acpi_handle ec_get_handle(void);
extern bool acpi_is_pnp_device(struct acpi_device *);
-#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
+#if IS_ENABLED(CONFIG_ACPI_WMI)
typedef void (*wmi_notify_handler) (union acpi_object *data, void *context);
@@ -938,11 +938,6 @@ static inline const char *acpi_dev_name(struct acpi_device *adev)
return NULL;
}
-static inline struct device *acpi_get_first_physical_node(struct acpi_device *adev)
-{
- return NULL;
-}
-
static inline void acpi_early_init(void) { }
static inline void acpi_subsystem_init(void) { }
@@ -1305,34 +1300,34 @@ void __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle, const c
#endif
/*
- * acpi_handle_<level>: Print message with ACPI prefix and object path
+ * acpi_handle_<level> - Print a message with ACPI prefix and object path
*
- * These interfaces acquire the global namespace mutex to obtain an object
- * path. In interrupt context, it shows the object path as <n/a>.
+ * In thread context, the global namespace mutex is acquired to obtain the
+ * object path. In interrupt context, the object path is shown as <n/a>.
*/
#define acpi_handle_emerg(handle, fmt, ...) \
- acpi_handle_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_EMERG, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_alert(handle, fmt, ...) \
- acpi_handle_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_ALERT, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_crit(handle, fmt, ...) \
- acpi_handle_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_CRIT, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_err(handle, fmt, ...) \
- acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_ERR, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_warn(handle, fmt, ...) \
- acpi_handle_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_WARNING, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_notice(handle, fmt, ...) \
- acpi_handle_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_NOTICE, handle, dev_fmt(fmt), ##__VA_ARGS__)
#define acpi_handle_info(handle, fmt, ...) \
- acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_INFO, handle, dev_fmt(fmt), ##__VA_ARGS__)
#if defined(DEBUG)
#define acpi_handle_debug(handle, fmt, ...) \
- acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
+ acpi_handle_printk(KERN_DEBUG, handle, dev_fmt(fmt), ##__VA_ARGS__)
#else
#if defined(CONFIG_DYNAMIC_DEBUG)
#define acpi_handle_debug(handle, fmt, ...) \
_dynamic_func_call(fmt, __acpi_handle_debug, \
- handle, pr_fmt(fmt), ##__VA_ARGS__)
+ handle, dev_fmt(fmt), ##__VA_ARGS__)
#else
#define acpi_handle_debug(handle, fmt, ...) \
({ \
diff --git a/include/linux/aer.h b/include/linux/aer.h
index df0f5c382286..043ee76b6f53 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -24,6 +24,13 @@
#define PCIE_STD_MAX_TLP_PREFIXLOG 4
#define PCIE_STD_MAX_TLP_HEADERLOG (PCIE_STD_NUM_TLP_HEADERLOG + 10)
+/*
+ * Size of the AER Capability register block in hardware, long enough for the
+ * longest Flit mode TLP Log. struct aer_capability_regs below is larger and
+ * laid out differently; use aer_cap_regs_unpack() to convert.
+ */
+#define PCIE_AER_CAP_HW_SIZE 96
+
struct pci_dev;
struct pcie_tlp_log {
@@ -68,6 +75,8 @@ static inline void pci_aer_unmask_internal_errors(struct pci_dev *dev) { }
void pci_print_aer(struct pci_dev *dev, int aer_severity,
struct aer_capability_regs *aer);
+void aer_cap_regs_unpack(struct aer_capability_regs *regs, const void *raw,
+ size_t raw_len);
int cper_severity_to_aer(int cper_severity);
void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
int severity, struct aer_capability_regs *aer_regs);
diff --git a/include/linux/apple-gmux.h b/include/linux/apple-gmux.h
index 206d97ffda79..d7939c3a08fd 100644
--- a/include/linux/apple-gmux.h
+++ b/include/linux/apple-gmux.h
@@ -109,7 +109,7 @@ static inline bool apple_gmux_detect(struct pnp_dev *pnp_dev, enum apple_gmux_ty
if (!adev)
return false;
- dev = get_device(acpi_get_first_physical_node(adev));
+ dev = acpi_bus_get_primary_device(adev);
acpi_dev_put(adev);
if (!dev)
return false;
diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h
index a38f7229b8f4..89e156b9acb5 100644
--- a/include/linux/device/bus.h
+++ b/include/linux/device/bus.h
@@ -113,6 +113,7 @@ struct bus_type {
bool need_parent_lock;
};
+int __must_check companion_bus_register(const struct bus_type *bus);
int __must_check bus_register(const struct bus_type *bus);
void bus_unregister(const struct bus_type *bus);
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 083b4f533933..306ad17aed89 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -293,8 +293,9 @@ struct device *thermal_zone_device(struct thermal_zone_device *tzd);
void thermal_zone_device_update(struct thermal_zone_device *,
enum thermal_notify_event);
-struct thermal_cooling_device *thermal_cooling_device_register(const char *,
- void *, const struct thermal_cooling_device_ops *);
+struct thermal_cooling_device *thermal_cooling_device_create(
+ struct device *parent, const char *type, void *devdata,
+ const struct thermal_cooling_device_ops *ops);
struct thermal_cooling_device *
devm_thermal_cooling_device_register(struct device *dev, const char *type, void *devdata,
@@ -340,9 +341,9 @@ static inline void thermal_zone_device_update(struct thermal_zone_device *tz,
enum thermal_notify_event event)
{ }
-static inline struct thermal_cooling_device *
-thermal_cooling_device_register(const char *type, void *devdata,
- const struct thermal_cooling_device_ops *ops)
+static inline struct thermal_cooling_device *thermal_cooling_device_create(
+ struct device *parent, const char *type, void *devdata,
+ const struct thermal_cooling_device_ops *ops)
{ return ERR_PTR(-ENODEV); }
static inline struct thermal_cooling_device *
@@ -391,4 +392,12 @@ static inline void thermal_pm_prepare(void) {}
static inline void thermal_pm_complete(void) {}
#endif /* CONFIG_THERMAL */
+static inline struct thermal_cooling_device *thermal_cooling_device_register(
+ const char *type, void *devdata,
+ const struct thermal_cooling_device_ops *ops)
+{
+ return thermal_cooling_device_create(NULL, type, devdata, ops);
+}
+
+
#endif /* __THERMAL_H__ */