Commit d55cc9f8 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'acpi-tables', 'acpi-processor', 'acpi-property' and 'acpi-thermal'

Merge ACPI tables parsing change, ACPI processor driver change, ACPI
device properties handling changes and an ACPI thermal code change for
6.9-rc1:

 - Make the NFIT parsing code use acpi_evaluate_dsm_typed() (Andy
   Shevchenko).

 - Fix a memory leak in acpi_processor_power_exit() (Armin Wolf).

 - Make it possible to quirk the CSI-2 and MIPI DisCo for Imaging
   properties parsing and add a quirk for Dell XPS 9315 (Sakari Ailus).

 - Prevent false-positive static checker warnings from triggering by
   intializing some variables in the ACPI thermal code to zero (Colin
   Ian King).

* acpi-tables:
  ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed()

* acpi-processor:
  ACPI: processor_idle: Fix memory leak in acpi_processor_power_exit()

* acpi-property:
  ACPI: property: Polish ignoring bad data nodes
  ACPI: property: Ignore bad graph port nodes on Dell XPS 9315
  ACPI: utils: Make acpi_handle_path() not static

* acpi-thermal:
  ACPI: thermal_lib: Initialize temp_decik to zero
...@@ -302,5 +302,6 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle); ...@@ -302,5 +302,6 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle);
void acpi_mipi_scan_crs_csi2(void); void acpi_mipi_scan_crs_csi2(void);
void acpi_mipi_init_crs_csi2_swnodes(void); void acpi_mipi_init_crs_csi2_swnodes(void);
void acpi_mipi_crs_csi2_cleanup(void); void acpi_mipi_crs_csi2_cleanup(void);
bool acpi_graph_ignore_port(acpi_handle handle);
#endif /* _ACPI_INTERNAL_H_ */ #endif /* _ACPI_INTERNAL_H_ */
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/limits.h> #include <linux/limits.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -723,3 +724,73 @@ void acpi_mipi_crs_csi2_cleanup(void) ...@@ -723,3 +724,73 @@ void acpi_mipi_crs_csi2_cleanup(void)
list_for_each_entry_safe(csi2, csi2_tmp, &acpi_mipi_crs_csi2_list, entry) list_for_each_entry_safe(csi2, csi2_tmp, &acpi_mipi_crs_csi2_list, entry)
acpi_mipi_del_crs_csi2(csi2); acpi_mipi_del_crs_csi2(csi2);
} }
static const struct dmi_system_id dmi_ignore_port_nodes[] = {
{
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"),
},
},
{ }
};
static const char *strnext(const char *s1, const char *s2)
{
s1 = strstr(s1, s2);
if (!s1)
return NULL;
return s1 + strlen(s2);
}
/**
* acpi_graph_ignore_port - Tell whether a port node should be ignored
* @handle: The ACPI handle of the node (which may be a port node)
*
* Return: true if a port node should be ignored and the data to that should
* come from other sources instead (Windows ACPI definitions and
* ipu-bridge). This is currently used to ignore bad port nodes related to IPU6
* ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with
* Intel VSC.
*/
bool acpi_graph_ignore_port(acpi_handle handle)
{
const char *path = NULL, *orig_path;
static bool dmi_tested, ignore_port;
if (!dmi_tested) {
ignore_port = dmi_first_match(dmi_ignore_port_nodes);
dmi_tested = true;
}
if (!ignore_port)
return false;
/* Check if the device is either "IPU" or "LNK" (sensor). */
orig_path = acpi_handle_path(handle);
if (!orig_path)
return false;
path = strnext(orig_path, "IPU");
if (!path)
path = strnext(orig_path, "LNK");
if (!path)
goto out_free;
if (!(isdigit(path[0]) && path[1] == '.'))
goto out_free;
/* Check if the node has a "PRT" prefix. */
path = strnext(path, "PRT");
if (path && isdigit(path[0]) && !path[1]) {
acpi_handle_debug(handle, "ignoring data node\n");
kfree(orig_path);
return true;
}
out_free:
kfree(orig_path);
return false;
}
...@@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem) ...@@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem)
if ((nfit_mem->dsm_mask & (1 << func)) == 0) if ((nfit_mem->dsm_mask & (1 << func)) == 0)
return; return;
out_obj = acpi_evaluate_dsm(handle, guid, revid, func, &in_obj); out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, ACPI_TYPE_BUFFER);
if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER if (!out_obj || out_obj->buffer.length < sizeof(smart)) {
|| out_obj->buffer.length < sizeof(smart)) {
dev_dbg(dev->parent, "%s: failed to retrieve initial health\n", dev_dbg(dev->parent, "%s: failed to retrieve initial health\n",
dev_name(dev)); dev_name(dev));
ACPI_FREE(out_obj); ACPI_FREE(out_obj);
......
...@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr) ...@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr)
acpi_processor_registered--; acpi_processor_registered--;
if (acpi_processor_registered == 0) if (acpi_processor_registered == 0)
cpuidle_unregister_driver(&acpi_idle_driver); cpuidle_unregister_driver(&acpi_idle_driver);
kfree(dev);
} }
pr->flags.power_setup_done = 0; pr->flags.power_setup_done = 0;
......
...@@ -80,6 +80,9 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc, ...@@ -80,6 +80,9 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc,
struct acpi_data_node *dn; struct acpi_data_node *dn;
bool result; bool result;
if (acpi_graph_ignore_port(handle))
return false;
dn = kzalloc(sizeof(*dn), GFP_KERNEL); dn = kzalloc(sizeof(*dn), GFP_KERNEL);
if (!dn) if (!dn)
return false; return false;
......
...@@ -100,7 +100,7 @@ static int thermal_temp(int error, int temp_decik, int *ret_temp) ...@@ -100,7 +100,7 @@ static int thermal_temp(int error, int temp_decik, int *ret_temp)
*/ */
int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp) int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp)
{ {
int temp_decik; int temp_decik = 0;
int ret = acpi_active_trip_temp(adev, id, &temp_decik); int ret = acpi_active_trip_temp(adev, id, &temp_decik);
return thermal_temp(ret, temp_decik, ret_temp); return thermal_temp(ret, temp_decik, ret_temp);
...@@ -119,7 +119,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_active_trip_temp); ...@@ -119,7 +119,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_active_trip_temp);
*/ */
int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp) int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp)
{ {
int temp_decik; int temp_decik = 0;
int ret = acpi_passive_trip_temp(adev, &temp_decik); int ret = acpi_passive_trip_temp(adev, &temp_decik);
return thermal_temp(ret, temp_decik, ret_temp); return thermal_temp(ret, temp_decik, ret_temp);
...@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_passive_trip_temp); ...@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_passive_trip_temp);
*/ */
int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp) int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp)
{ {
int temp_decik; int temp_decik = 0;
int ret = acpi_hot_trip_temp(adev, &temp_decik); int ret = acpi_hot_trip_temp(adev, &temp_decik);
return thermal_temp(ret, temp_decik, ret_temp); return thermal_temp(ret, temp_decik, ret_temp);
...@@ -158,7 +158,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_hot_trip_temp); ...@@ -158,7 +158,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_hot_trip_temp);
*/ */
int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp) int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp)
{ {
int temp_decik; int temp_decik = 0;
int ret = acpi_critical_trip_temp(adev, &temp_decik); int ret = acpi_critical_trip_temp(adev, &temp_decik);
return thermal_temp(ret, temp_decik, ret_temp); return thermal_temp(ret, temp_decik, ret_temp);
......
...@@ -559,7 +559,7 @@ EXPORT_SYMBOL(acpi_evaluate_ost); ...@@ -559,7 +559,7 @@ EXPORT_SYMBOL(acpi_evaluate_ost);
* *
* Caller must free the returned buffer * Caller must free the returned buffer
*/ */
static char *acpi_handle_path(acpi_handle handle) char *acpi_handle_path(acpi_handle handle)
{ {
struct acpi_buffer buffer = { struct acpi_buffer buffer = {
.length = ACPI_ALLOCATE_BUFFER, .length = ACPI_ALLOCATE_BUFFER,
......
...@@ -1170,6 +1170,7 @@ static inline void acpi_ec_set_gpe_wake_mask(u8 action) {} ...@@ -1170,6 +1170,7 @@ static inline void acpi_ec_set_gpe_wake_mask(u8 action) {}
#endif #endif
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
char *acpi_handle_path(acpi_handle handle);
__printf(3, 4) __printf(3, 4)
void acpi_handle_printk(const char *level, acpi_handle handle, void acpi_handle_printk(const char *level, acpi_handle handle,
const char *fmt, ...); const char *fmt, ...);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment