ACPI fixes for 6.10-rc5

- 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).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmZ1cXASHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRx+KQP/10APBYP+F2sjuM8DpIyCLd4pJ9ayXHJ
 DTbLUTHqnzRBPaeI/eGPyqD8qfMhuFhaowHvab6wEz2yK6eT5FN+/aIlo1Pz1IFC
 MWpvwA66TvVCyxxyd9YYLH7NEMJAMfxN5qntk0HY5lpVj09UGde1VBPPpHdixyLm
 i/JcoV1G7r25tYwgc9oM+VkDrKiULZtDmX9XYOylEYXFZfzW0DIoqZ5BqwdM2Nbv
 ZTikrU2gpuduyQCcUkq9hRTCfEVgpu/MOFmAVb4rnjLDjIGrjHv6zojNzfwX0+nM
 tepJpKt6718TGSRwXoNOo1+ImDmy9IG+ZoKj3wt63LAS2a55L0hX6eaMya6voQXE
 xMqbdqcikNuLSKK73Agz9DyONFmJKQVIYR+KcrMVHskCAY+s1JN4U+S3zulYqiQZ
 T1dYN2tro2ZdLjTsITIzosJ+9Pfigku8HhYSHgKTqDqWcngTP+Sih8LhsYA5HxzF
 17/UQJvgEO4oXq8CF+r2UitPEW4U6F6PIOZkRW/jVGnWow8Wp1fUfWD0pmFyj1XX
 rzi/MF0U8B+TdbtRGfjFLDqKZwzyIiSr1xy6Uq/YHgoNgIlhUd4Xb45ycNkU5VtA
 bisGFsKtxeomZtg/BB4EfcBUEt+eueHY6r+QEhQxS7zRFGEWUJw8D/2EnjgXJ5Au
 /4MGPvCZWz1w
 =jmUu
 -----END PGP SIGNATURE-----

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."
This commit is contained in:
Linus Torvalds 2024-06-21 11:20:37 -07:00
commit 36c0758374
3 changed files with 25 additions and 30 deletions

View file

@ -44,7 +44,6 @@ acpi_ex_system_memory_space_handler(u32 function,
struct acpi_mem_mapping *mm = mem_info->cur_mm;
u32 length;
acpi_size map_length;
acpi_size page_boundary_map_length;
#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
u32 remainder;
#endif
@ -138,26 +137,8 @@ acpi_ex_system_memory_space_handler(u32 function,
map_length = (acpi_size)
((mem_info->address + mem_info->length) - address);
/*
* If mapping the entire remaining portion of the region will cross
* a page boundary, just map up to the page boundary, do not cross.
* On some systems, crossing a page boundary while mapping regions
* can cause warnings if the pages have different attributes
* due to resource management.
*
* This has the added benefit of constraining a single mapping to
* one page, which is similar to the original code that used a 4k
* maximum window.
*/
page_boundary_map_length = (acpi_size)
(ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address);
if (page_boundary_map_length == 0) {
page_boundary_map_length = ACPI_DEFAULT_PAGE_SIZE;
}
if (map_length > page_boundary_map_length) {
map_length = page_boundary_map_length;
}
if (map_length > ACPI_DEFAULT_PAGE_SIZE)
map_length = ACPI_DEFAULT_PAGE_SIZE;
/* Create a new mapping starting at the address given */

View file

@ -302,6 +302,10 @@ void acpi_mipi_check_crs_csi2(acpi_handle handle);
void acpi_mipi_scan_crs_csi2(void);
void acpi_mipi_init_crs_csi2_swnodes(void);
void acpi_mipi_crs_csi2_cleanup(void);
#ifdef CONFIG_X86
bool acpi_graph_ignore_port(acpi_handle handle);
#else
static inline bool acpi_graph_ignore_port(acpi_handle handle) { return false; }
#endif
#endif /* _ACPI_INTERNAL_H_ */

View file

@ -725,14 +725,20 @@ void acpi_mipi_crs_csi2_cleanup(void)
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"),
},
},
{ }
#ifdef CONFIG_X86
#include <asm/cpu_device_id.h>
#include <asm/intel-family.h>
/* CPU matches for Dell generations with broken ACPI MIPI DISCO info */
static const struct x86_cpu_id dell_broken_mipi_disco_cpu_gens[] = {
X86_MATCH_VFM(INTEL_TIGERLAKE, NULL),
X86_MATCH_VFM(INTEL_TIGERLAKE_L, NULL),
X86_MATCH_VFM(INTEL_ALDERLAKE, NULL),
X86_MATCH_VFM(INTEL_ALDERLAKE_L, NULL),
X86_MATCH_VFM(INTEL_RAPTORLAKE, NULL),
X86_MATCH_VFM(INTEL_RAPTORLAKE_P, NULL),
X86_MATCH_VFM(INTEL_RAPTORLAKE_S, NULL),
{}
};
static const char *strnext(const char *s1, const char *s2)
@ -761,7 +767,10 @@ bool acpi_graph_ignore_port(acpi_handle handle)
static bool dmi_tested, ignore_port;
if (!dmi_tested) {
ignore_port = dmi_first_match(dmi_ignore_port_nodes);
if (dmi_name_in_vendors("Dell Inc.") &&
x86_match_cpu(dell_broken_mipi_disco_cpu_gens))
ignore_port = true;
dmi_tested = true;
}
@ -794,3 +803,4 @@ bool acpi_graph_ignore_port(acpi_handle handle)
kfree(orig_path);
return false;
}
#endif