Skip to content

Commit 36c0758

Browse files
committed
Merge tag 'acpi-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fixes from Rafael Wysocki: "These address a possible NULL pointer dereference in the ACPICA code and quirk camera enumeration on multiple platforms where incorrect data are present in the platform firmware. Specifics: - Undo an ACPICA code change that attempted to keep operation regions within a page boundary, but allowed accesses to unmapped memory to occur (Raju Rangoju) - Ignore MIPI camera graph port nodes created with the help of the information from the ACPI tables on all Dell Tiger, Alder and Raptor Lake models as that information is reported to be invalid on the platforms in question (Hans de Goede) - Use new Intel CPU model matching macros in the MIPI DisCo for Imaging part of ACPI device enumeration (Hans de Goede)" * tag 'acpi-6.10-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: mipi-disco-img: Switch to new Intel CPU model defines ACPI: scan: Ignore camera graph port nodes on all Dell Tiger, Alder and Raptor Lake models ACPICA: Revert "ACPICA: avoid Info: mapping multiple BARs. Your kernel is fine."
2 parents fbe7ef3 + 5e409a2 commit 36c0758

File tree

3 files changed

+25
-30
lines changed

3 files changed

+25
-30
lines changed

drivers/acpi/acpica/exregion.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ acpi_ex_system_memory_space_handler(u32 function,
4444
struct acpi_mem_mapping *mm = mem_info->cur_mm;
4545
u32 length;
4646
acpi_size map_length;
47-
acpi_size page_boundary_map_length;
4847
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
4948
u32 remainder;
5049
#endif
@@ -138,26 +137,8 @@ acpi_ex_system_memory_space_handler(u32 function,
138137
map_length = (acpi_size)
139138
((mem_info->address + mem_info->length) - address);
140139

141-
/*
142-
* If mapping the entire remaining portion of the region will cross
143-
* a page boundary, just map up to the page boundary, do not cross.
144-
* On some systems, crossing a page boundary while mapping regions
145-
* can cause warnings if the pages have different attributes
146-
* due to resource management.
147-
*
148-
* This has the added benefit of constraining a single mapping to
149-
* one page, which is similar to the original code that used a 4k
150-
* maximum window.
151-
*/
152-
page_boundary_map_length = (acpi_size)
153-
(ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address);
154-
if (page_boundary_map_length == 0) {
155-
page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
156-
}
157-
158-
if (map_length > page_boundary_map_length) {
159-
map_length = page_boundary_map_length;
160-
}
140+
if (map_length > ACPI_DEFAULT_PAGE_SIZE)
141+
map_length = ACPI_DEFAULT_PAGE_SIZE;
161142

162143
/* Create a new mapping starting at the address given */
163144

drivers/acpi/internal.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ 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+
#ifdef CONFIG_X86
305306
bool acpi_graph_ignore_port(acpi_handle handle);
307+
#else
308+
static inline bool acpi_graph_ignore_port(acpi_handle handle) { return false; }
309+
#endif
306310

307311
#endif /* _ACPI_INTERNAL_H_ */

drivers/acpi/mipi-disco-img.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -725,14 +725,20 @@ void acpi_mipi_crs_csi2_cleanup(void)
725725
acpi_mipi_del_crs_csi2(csi2);
726726
}
727727

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-
{ }
728+
#ifdef CONFIG_X86
729+
#include <asm/cpu_device_id.h>
730+
#include <asm/intel-family.h>
731+
732+
/* CPU matches for Dell generations with broken ACPI MIPI DISCO info */
733+
static const struct x86_cpu_id dell_broken_mipi_disco_cpu_gens[] = {
734+
X86_MATCH_VFM(INTEL_TIGERLAKE, NULL),
735+
X86_MATCH_VFM(INTEL_TIGERLAKE_L, NULL),
736+
X86_MATCH_VFM(INTEL_ALDERLAKE, NULL),
737+
X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL),
738+
X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL),
739+
X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
740+
X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL),
741+
{}
736742
};
737743

738744
static const char *strnext(const char *s1, const char *s2)
@@ -761,7 +767,10 @@ bool acpi_graph_ignore_port(acpi_handle handle)
761767
static bool dmi_tested, ignore_port;
762768

763769
if (!dmi_tested) {
764-
ignore_port = dmi_first_match(dmi_ignore_port_nodes);
770+
if (dmi_name_in_vendors("Dell Inc.") &&
771+
x86_match_cpu(dell_broken_mipi_disco_cpu_gens))
772+
ignore_port = true;
773+
765774
dmi_tested = true;
766775
}
767776

@@ -794,3 +803,4 @@ bool acpi_graph_ignore_port(acpi_handle handle)
794803
kfree(orig_path);
795804
return false;
796805
}
806+
#endif

0 commit comments

Comments
 (0)