Skip to content

Commit d55cc9f

Browse files
committed
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
5 parents 8c34f11 + 26da9a8 + e18afcb + 8d60902 + 2b959bd commit d55cc9f

File tree

8 files changed

+85
-8
lines changed

8 files changed

+85
-8
lines changed

drivers/acpi/internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,5 +302,6 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle);
302302
void acpi_mipi_scan_crs_csi2(void);
303303
void acpi_mipi_init_crs_csi2_swnodes(void);
304304
void acpi_mipi_crs_csi2_cleanup(void);
305+
bool acpi_graph_ignore_port(acpi_handle handle);
305306

306307
#endif /* _ACPI_INTERNAL_H_ */

drivers/acpi/mipi-disco-img.c

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020

2121
#include <linux/acpi.h>
22+
#include <linux/dmi.h>
2223
#include <linux/limits.h>
2324
#include <linux/list.h>
2425
#include <linux/module.h>
@@ -723,3 +724,73 @@ void acpi_mipi_crs_csi2_cleanup(void)
723724
list_for_each_entry_safe(csi2, csi2_tmp, &acpi_mipi_crs_csi2_list, entry)
724725
acpi_mipi_del_crs_csi2(csi2);
725726
}
727+
728+
static const struct dmi_system_id dmi_ignore_port_nodes[] = {
729+
{
730+
.matches = {
731+
DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
732+
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"),
733+
},
734+
},
735+
{ }
736+
};
737+
738+
static const char *strnext(const char *s1, const char *s2)
739+
{
740+
s1 = strstr(s1, s2);
741+
742+
if (!s1)
743+
return NULL;
744+
745+
return s1 + strlen(s2);
746+
}
747+
748+
/**
749+
* acpi_graph_ignore_port - Tell whether a port node should be ignored
750+
* @handle: The ACPI handle of the node (which may be a port node)
751+
*
752+
* Return: true if a port node should be ignored and the data to that should
753+
* come from other sources instead (Windows ACPI definitions and
754+
* ipu-bridge). This is currently used to ignore bad port nodes related to IPU6
755+
* ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with
756+
* Intel VSC.
757+
*/
758+
bool acpi_graph_ignore_port(acpi_handle handle)
759+
{
760+
const char *path = NULL, *orig_path;
761+
static bool dmi_tested, ignore_port;
762+
763+
if (!dmi_tested) {
764+
ignore_port = dmi_first_match(dmi_ignore_port_nodes);
765+
dmi_tested = true;
766+
}
767+
768+
if (!ignore_port)
769+
return false;
770+
771+
/* Check if the device is either "IPU" or "LNK" (sensor). */
772+
orig_path = acpi_handle_path(handle);
773+
if (!orig_path)
774+
return false;
775+
path = strnext(orig_path, "IPU");
776+
if (!path)
777+
path = strnext(orig_path, "LNK");
778+
if (!path)
779+
goto out_free;
780+
781+
if (!(isdigit(path[0]) && path[1] == '.'))
782+
goto out_free;
783+
784+
/* Check if the node has a "PRT" prefix. */
785+
path = strnext(path, "PRT");
786+
if (path && isdigit(path[0]) && !path[1]) {
787+
acpi_handle_debug(handle, "ignoring data node\n");
788+
789+
kfree(orig_path);
790+
return true;
791+
}
792+
793+
out_free:
794+
kfree(orig_path);
795+
return false;
796+
}

drivers/acpi/nfit/core.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem)
17371737
if ((nfit_mem->dsm_mask & (1 << func)) == 0)
17381738
return;
17391739

1740-
out_obj = acpi_evaluate_dsm(handle, guid, revid, func, &in_obj);
1741-
if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER
1742-
|| out_obj->buffer.length < sizeof(smart)) {
1740+
out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, ACPI_TYPE_BUFFER);
1741+
if (!out_obj || out_obj->buffer.length < sizeof(smart)) {
17431742
dev_dbg(dev->parent, "%s: failed to retrieve initial health\n",
17441743
dev_name(dev));
17451744
ACPI_FREE(out_obj);

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,8 @@ int acpi_processor_power_exit(struct acpi_processor *pr)
14301430
acpi_processor_registered--;
14311431
if (acpi_processor_registered == 0)
14321432
cpuidle_unregister_driver(&acpi_idle_driver);
1433+
1434+
kfree(dev);
14331435
}
14341436

14351437
pr->flags.power_setup_done = 0;

drivers/acpi/property.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ static bool acpi_nondev_subnode_extract(union acpi_object *desc,
8080
struct acpi_data_node *dn;
8181
bool result;
8282

83+
if (acpi_graph_ignore_port(handle))
84+
return false;
85+
8386
dn = kzalloc(sizeof(*dn), GFP_KERNEL);
8487
if (!dn)
8588
return false;

drivers/acpi/thermal_lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int thermal_temp(int error, int temp_decik, int *ret_temp)
100100
*/
101101
int thermal_acpi_active_trip_temp(struct acpi_device *adev, int id, int *ret_temp)
102102
{
103-
int temp_decik;
103+
int temp_decik = 0;
104104
int ret = acpi_active_trip_temp(adev, id, &temp_decik);
105105

106106
return thermal_temp(ret, temp_decik, ret_temp);
@@ -119,7 +119,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_active_trip_temp);
119119
*/
120120
int thermal_acpi_passive_trip_temp(struct acpi_device *adev, int *ret_temp)
121121
{
122-
int temp_decik;
122+
int temp_decik = 0;
123123
int ret = acpi_passive_trip_temp(adev, &temp_decik);
124124

125125
return thermal_temp(ret, temp_decik, ret_temp);
@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_passive_trip_temp);
139139
*/
140140
int thermal_acpi_hot_trip_temp(struct acpi_device *adev, int *ret_temp)
141141
{
142-
int temp_decik;
142+
int temp_decik = 0;
143143
int ret = acpi_hot_trip_temp(adev, &temp_decik);
144144

145145
return thermal_temp(ret, temp_decik, ret_temp);
@@ -158,7 +158,7 @@ EXPORT_SYMBOL_GPL(thermal_acpi_hot_trip_temp);
158158
*/
159159
int thermal_acpi_critical_trip_temp(struct acpi_device *adev, int *ret_temp)
160160
{
161-
int temp_decik;
161+
int temp_decik = 0;
162162
int ret = acpi_critical_trip_temp(adev, &temp_decik);
163163

164164
return thermal_temp(ret, temp_decik, ret_temp);

drivers/acpi/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ EXPORT_SYMBOL(acpi_evaluate_ost);
559559
*
560560
* Caller must free the returned buffer
561561
*/
562-
static char *acpi_handle_path(acpi_handle handle)
562+
char *acpi_handle_path(acpi_handle handle)
563563
{
564564
struct acpi_buffer buffer = {
565565
.length = ACPI_ALLOCATE_BUFFER,

include/linux/acpi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ static inline void acpi_ec_set_gpe_wake_mask(u8 action) {}
11701170
#endif
11711171

11721172
#ifdef CONFIG_ACPI
1173+
char *acpi_handle_path(acpi_handle handle);
11731174
__printf(3, 4)
11741175
void acpi_handle_printk(const char *level, acpi_handle handle,
11751176
const char *fmt, ...);

0 commit comments

Comments
 (0)