From 89e7ba7562dc826612b44a6a6a8d8003cc5cce42 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 24 Jun 2024 09:48:23 -0400 Subject: [PATCH] Fixes for 4.19 Signed-off-by: Sasha Levin --- ...pica-avoid-info-mapping-multiple-bar.patch | 84 +++++++++++++++++++ ...atdma-fix-missing-kmem_cache_destroy.patch | 46 ++++++++++ ...ix-modpost-error-regulator_get_regma.patch | 38 +++++++++ queue-4.19/series | 3 + 4 files changed, 171 insertions(+) create mode 100644 queue-4.19/acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch create mode 100644 queue-4.19/dmaengine-ioatdma-fix-missing-kmem_cache_destroy.patch create mode 100644 queue-4.19/regulator-core-fix-modpost-error-regulator_get_regma.patch diff --git a/queue-4.19/acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch b/queue-4.19/acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch new file mode 100644 index 00000000000..54e6179921f --- /dev/null +++ b/queue-4.19/acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch @@ -0,0 +1,84 @@ +From ea0c457c3326d6958207da9a1d09155a6656be09 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Jun 2024 19:31:49 +0530 +Subject: ACPICA: Revert "ACPICA: avoid Info: mapping multiple BARs. Your + kernel is fine." + +From: Raju Rangoju + +[ Upstream commit a83e1385b780d41307433ddbc86e3c528db031f0 ] + +Undo the modifications made in commit d410ee5109a1 ("ACPICA: avoid +"Info: mapping multiple BARs. Your kernel is fine.""). The initial +purpose of this commit was to stop memory mappings for operation +regions from overlapping page boundaries, as it can trigger warnings +if different page attributes are present. + +However, it was found that when this situation arises, mapping +continues until the boundary's end, but there is still an attempt to +read/write the entire length of the map, leading to a NULL pointer +deference. For example, if a four-byte mapping request is made but +only one byte is mapped because it hits the current page boundary's +end, a four-byte read/write attempt is still made, resulting in a NULL +pointer deference. + +Instead, map the entire length, as the ACPI specification does not +mandate that it must be within the same page boundary. It is +permissible for it to be mapped across different regions. + +Link: https://github.com/acpica/acpica/pull/954 +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218849 +Fixes: d410ee5109a1 ("ACPICA: avoid "Info: mapping multiple BARs. Your kernel is fine."") +Co-developed-by: Sanath S +Signed-off-by: Sanath S +Signed-off-by: Raju Rangoju +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Sasha Levin +--- + drivers/acpi/acpica/exregion.c | 23 ++--------------------- + 1 file changed, 2 insertions(+), 21 deletions(-) + +diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c +index 97bbfd07fcf75..2d99cbbf82d10 100644 +--- a/drivers/acpi/acpica/exregion.c ++++ b/drivers/acpi/acpica/exregion.c +@@ -43,7 +43,6 @@ acpi_ex_system_memory_space_handler(u32 function, + struct acpi_mem_space_context *mem_info = region_context; + u32 length; + acpi_size map_length; +- acpi_size page_boundary_map_length; + #ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED + u32 remainder; + #endif +@@ -120,26 +119,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 */ + +-- +2.43.0 + diff --git a/queue-4.19/dmaengine-ioatdma-fix-missing-kmem_cache_destroy.patch b/queue-4.19/dmaengine-ioatdma-fix-missing-kmem_cache_destroy.patch new file mode 100644 index 00000000000..e40bbf5f8e4 --- /dev/null +++ b/queue-4.19/dmaengine-ioatdma-fix-missing-kmem_cache_destroy.patch @@ -0,0 +1,46 @@ +From 98036d4daef9f8ffce58e85e0daed758139697cb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 14 May 2024 13:52:31 +0300 +Subject: dmaengine: ioatdma: Fix missing kmem_cache_destroy() + +From: Nikita Shubin + +[ Upstream commit 5422145d0b749ad554ada772133b9b20f9fb0ec8 ] + +Fix missing kmem_cache_destroy() for ioat_sed_cache in +ioat_exit_module(). + +Noticed via: + +``` +modprobe ioatdma +rmmod ioatdma +modprobe ioatdma +debugfs: Directory 'ioat_sed_ent' with parent 'slab' already present! +``` + +Fixes: c0f28ce66ecf ("dmaengine: ioatdma: move all the init routines") +Signed-off-by: Nikita Shubin +Acked-by: Dave Jiang +Link: https://lore.kernel.org/r/20240514-ioatdma_fixes-v1-1-2776a0913254@yadro.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/ioat/init.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c +index 0fec3c554fe35..673d0e32f589a 100644 +--- a/drivers/dma/ioat/init.c ++++ b/drivers/dma/ioat/init.c +@@ -1429,6 +1429,7 @@ module_init(ioat_init_module); + static void __exit ioat_exit_module(void) + { + pci_unregister_driver(&ioat_pci_driver); ++ kmem_cache_destroy(ioat_sed_cache); + kmem_cache_destroy(ioat_cache); + } + module_exit(ioat_exit_module); +-- +2.43.0 + diff --git a/queue-4.19/regulator-core-fix-modpost-error-regulator_get_regma.patch b/queue-4.19/regulator-core-fix-modpost-error-regulator_get_regma.patch new file mode 100644 index 00000000000..57ea1337555 --- /dev/null +++ b/queue-4.19/regulator-core-fix-modpost-error-regulator_get_regma.patch @@ -0,0 +1,38 @@ +From bae9c9f16c8ec42c9240e6a621743aea1513bf29 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 10 Jun 2024 20:55:32 +0100 +Subject: regulator: core: Fix modpost error "regulator_get_regmap" undefined + +From: Biju Das + +[ Upstream commit 3f60497c658d2072714d097a177612d34b34aa3d ] + +Fix the modpost error "regulator_get_regmap" undefined by adding export +symbol. + +Fixes: 04eca28cde52 ("regulator: Add helpers for low-level register access") +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202406110117.mk5UR3VZ-lkp@intel.com +Signed-off-by: Biju Das +Link: https://lore.kernel.org/r/20240610195532.175942-1-biju.das.jz@bp.renesas.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/regulator/core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index 14f9977f1ec08..6831ce0ae49dd 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -2710,6 +2710,7 @@ struct regmap *regulator_get_regmap(struct regulator *regulator) + + return map ? map : ERR_PTR(-EOPNOTSUPP); + } ++EXPORT_SYMBOL_GPL(regulator_get_regmap); + + /** + * regulator_get_hardware_vsel_register - get the HW voltage selector register +-- +2.43.0 + diff --git a/queue-4.19/series b/queue-4.19/series index eeaec3435c5..c2448e8006a 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -80,3 +80,6 @@ xfrm6-check-ip6_dst_idev-return-value-in-xfrm6_get_s.patch virtio-net-ethtool-configurable-lro.patch virtio_net-checksum-offloading-handling-fix.patch net-usb-rtl8150-fix-unintiatilzed-variables-in-rtl81.patch +regulator-core-fix-modpost-error-regulator_get_regma.patch +dmaengine-ioatdma-fix-missing-kmem_cache_destroy.patch +acpica-revert-acpica-avoid-info-mapping-multiple-bar.patch -- 2.47.3