From: Sasha Levin Date: Wed, 11 Oct 2023 14:22:53 +0000 (-0400) Subject: Fixes for 6.5 X-Git-Tag: v6.1.58~51 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8b4e52e8365b620312d246b3dae60b9c502f380e;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.5 Signed-off-by: Sasha Levin --- diff --git a/queue-6.5/arm_pmu-acpi-add-a-representative-platform-device-fo.patch b/queue-6.5/arm_pmu-acpi-add-a-representative-platform-device-fo.patch new file mode 100644 index 00000000000..265c4606466 --- /dev/null +++ b/queue-6.5/arm_pmu-acpi-add-a-representative-platform-device-fo.patch @@ -0,0 +1,115 @@ +From 286f8d8d5b6adefccbaa091d1f8558ffc7b0b202 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 17 Aug 2023 11:24:03 +0530 +Subject: arm_pmu: acpi: Add a representative platform device for TRBE + +From: Anshuman Khandual + +[ Upstream commit 1aa3d0274a4aac338ee45a3dfc3b17c944bcc2bc ] + +ACPI TRBE does not have a HID for identification which could create and add +a platform device into the platform bus. Also without a platform device, it +cannot be probed and bound to a platform driver. + +This creates a dummy platform device for TRBE after ascertaining that ACPI +provides required interrupts uniformly across all cpus on the system. This +device gets created inside drivers/perf/arm_pmu_acpi.c to accommodate TRBE +being built as a module. + +Cc: Catalin Marinas +Cc: Will Deacon +Cc: Mark Rutland +Cc: linux-arm-kernel@lists.infradead.org +Cc: linux-kernel@vger.kernel.org +Signed-off-by: Anshuman Khandual +Link: https://lore.kernel.org/r/20230817055405.249630-3-anshuman.khandual@arm.com +Signed-off-by: Will Deacon +Stable-dep-of: 4785aa802853 ("cpuidle, ACPI: Evaluate LPI arch_flags for broadcast timer") +Signed-off-by: Sasha Levin +--- + arch/arm64/include/asm/acpi.h | 3 +++ + drivers/perf/arm_pmu_acpi.c | 35 +++++++++++++++++++++++++++++++++++ + include/linux/perf/arm_pmu.h | 1 + + 3 files changed, 39 insertions(+) + +diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h +index bd68e1b7f29f3..4d537d56eb847 100644 +--- a/arch/arm64/include/asm/acpi.h ++++ b/arch/arm64/include/asm/acpi.h +@@ -42,6 +42,9 @@ + #define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \ + spe_interrupt) + sizeof(u16)) + ++#define ACPI_MADT_GICC_TRBE (offsetof(struct acpi_madt_generic_interrupt, \ ++ trbe_interrupt) + sizeof(u16)) ++ + /* Basic configuration for ACPI */ + #ifdef CONFIG_ACPI + pgprot_t __acpi_get_mem_attribute(phys_addr_t addr); +diff --git a/drivers/perf/arm_pmu_acpi.c b/drivers/perf/arm_pmu_acpi.c +index 90815ad762ebc..8baeeb369118e 100644 +--- a/drivers/perf/arm_pmu_acpi.c ++++ b/drivers/perf/arm_pmu_acpi.c +@@ -139,6 +139,40 @@ static inline void arm_spe_acpi_register_device(void) + } + #endif /* CONFIG_ARM_SPE_PMU */ + ++#if IS_ENABLED(CONFIG_CORESIGHT_TRBE) ++static struct resource trbe_resources[] = { ++ { ++ /* irq */ ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++static struct platform_device trbe_dev = { ++ .name = ARMV8_TRBE_PDEV_NAME, ++ .id = -1, ++ .resource = trbe_resources, ++ .num_resources = ARRAY_SIZE(trbe_resources) ++}; ++ ++static u16 arm_trbe_parse_gsi(struct acpi_madt_generic_interrupt *gicc) ++{ ++ return gicc->trbe_interrupt; ++} ++ ++static void arm_trbe_acpi_register_device(void) ++{ ++ int ret = arm_acpi_register_pmu_device(&trbe_dev, ACPI_MADT_GICC_TRBE, ++ arm_trbe_parse_gsi); ++ if (ret) ++ pr_warn("ACPI: TRBE: Unable to register device\n"); ++} ++#else ++static inline void arm_trbe_acpi_register_device(void) ++{ ++ ++} ++#endif /* CONFIG_CORESIGHT_TRBE */ ++ + static int arm_pmu_acpi_parse_irqs(void) + { + int irq, cpu, irq_cpu, err; +@@ -374,6 +408,7 @@ static int arm_pmu_acpi_init(void) + return 0; + + arm_spe_acpi_register_device(); ++ arm_trbe_acpi_register_device(); + + return 0; + } +diff --git a/include/linux/perf/arm_pmu.h b/include/linux/perf/arm_pmu.h +index a0801f68762bf..143fbc10ecfe0 100644 +--- a/include/linux/perf/arm_pmu.h ++++ b/include/linux/perf/arm_pmu.h +@@ -187,5 +187,6 @@ void armpmu_free_irq(int irq, int cpu); + #endif /* CONFIG_ARM_PMU */ + + #define ARMV8_SPE_PDEV_NAME "arm,spe-v1" ++#define ARMV8_TRBE_PDEV_NAME "arm,trbe" + + #endif /* __ARM_PMU_H__ */ +-- +2.40.1 + diff --git a/queue-6.5/cpuidle-acpi-evaluate-lpi-arch_flags-for-broadcast-t.patch b/queue-6.5/cpuidle-acpi-evaluate-lpi-arch_flags-for-broadcast-t.patch new file mode 100644 index 00000000000..f09b71371ba --- /dev/null +++ b/queue-6.5/cpuidle-acpi-evaluate-lpi-arch_flags-for-broadcast-t.patch @@ -0,0 +1,124 @@ +From 1715a813faf0596472dec3f01f95625195d76540 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 3 Oct 2023 10:33:33 -0700 +Subject: cpuidle, ACPI: Evaluate LPI arch_flags for broadcast timer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Oza Pawandeep + +[ Upstream commit 4785aa8028536c2be656d22c74ec1995b97056f3 ] + +Arm® Functional Fixed Hardware Specification defines LPI states, +which provide an architectural context loss flags field that can +be used to describe the context that might be lost when an LPI +state is entered. + +- Core context Lost + - General purpose registers. + - Floating point and SIMD registers. + - System registers, include the System register based + - generic timer for the core. + - Debug register in the core power domain. + - PMU registers in the core power domain. + - Trace register in the core power domain. +- Trace context loss +- GICR +- GICD + +Qualcomm's custom CPUs preserves the architectural state, +including keeping the power domain for local timers active. +when core is power gated, the local timers are sufficient to +wake the core up without needing broadcast timer. + +The patch fixes the evaluation of cpuidle arch_flags, and moves only to +broadcast timer if core context lost is defined in ACPI LPI. + +Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states") +Reviewed-by: Sudeep Holla +Acked-by: Rafael J. Wysocki +Signed-off-by: Oza Pawandeep +Link: https://lore.kernel.org/r/20231003173333.2865323-1-quic_poza@quicinc.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + arch/arm64/include/asm/acpi.h | 19 +++++++++++++++++++ + drivers/acpi/processor_idle.c | 3 +-- + include/linux/acpi.h | 9 +++++++++ + 3 files changed, 29 insertions(+), 2 deletions(-) + +diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h +index 4d537d56eb847..6792a1f83f2ad 100644 +--- a/arch/arm64/include/asm/acpi.h ++++ b/arch/arm64/include/asm/acpi.h +@@ -9,6 +9,7 @@ + #ifndef _ASM_ACPI_H + #define _ASM_ACPI_H + ++#include + #include + #include + #include +@@ -44,6 +45,24 @@ + + #define ACPI_MADT_GICC_TRBE (offsetof(struct acpi_madt_generic_interrupt, \ + trbe_interrupt) + sizeof(u16)) ++/* ++ * Arm® Functional Fixed Hardware Specification Version 1.2. ++ * Table 2: Arm Architecture context loss flags ++ */ ++#define CPUIDLE_CORE_CTXT BIT(0) /* Core context Lost */ ++ ++static inline unsigned int arch_get_idle_state_flags(u32 arch_flags) ++{ ++ if (arch_flags & CPUIDLE_CORE_CTXT) ++ return CPUIDLE_FLAG_TIMER_STOP; ++ ++ return 0; ++} ++#define arch_get_idle_state_flags arch_get_idle_state_flags ++ ++#define CPUIDLE_TRACE_CTXT BIT(1) /* Trace context loss */ ++#define CPUIDLE_GICR_CTXT BIT(2) /* GICR */ ++#define CPUIDLE_GICD_CTXT BIT(3) /* GICD */ + + /* Basic configuration for ACPI */ + #ifdef CONFIG_ACPI +diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c +index dc615ef6550a1..3a34a8c425fe4 100644 +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -1217,8 +1217,7 @@ static int acpi_processor_setup_lpi_states(struct acpi_processor *pr) + strscpy(state->desc, lpi->desc, CPUIDLE_DESC_LEN); + state->exit_latency = lpi->wake_latency; + state->target_residency = lpi->min_residency; +- if (lpi->arch_flags) +- state->flags |= CPUIDLE_FLAG_TIMER_STOP; ++ state->flags |= arch_get_idle_state_flags(lpi->arch_flags); + if (i != 0 && lpi->entry_method == ACPI_CSTATE_FFH) + state->flags |= CPUIDLE_FLAG_RCU_IDLE; + state->enter = acpi_idle_lpi_enter; +diff --git a/include/linux/acpi.h b/include/linux/acpi.h +index 641dc48439873..42c22a6ff48d0 100644 +--- a/include/linux/acpi.h ++++ b/include/linux/acpi.h +@@ -1476,6 +1476,15 @@ static inline int lpit_read_residency_count_address(u64 *address) + } + #endif + ++#ifdef CONFIG_ACPI_PROCESSOR_IDLE ++#ifndef arch_get_idle_state_flags ++static inline unsigned int arch_get_idle_state_flags(u32 arch_flags) ++{ ++ return 0; ++} ++#endif ++#endif /* CONFIG_ACPI_PROCESSOR_IDLE */ ++ + #ifdef CONFIG_ACPI_PPTT + int acpi_pptt_cpu_is_thread(unsigned int cpu); + int find_acpi_cpu_topology(unsigned int cpu, int level); +-- +2.40.1 + diff --git a/queue-6.5/drm-amdgpu-fix-a-memory-leak.patch b/queue-6.5/drm-amdgpu-fix-a-memory-leak.patch new file mode 100644 index 00000000000..d0df811691d --- /dev/null +++ b/queue-6.5/drm-amdgpu-fix-a-memory-leak.patch @@ -0,0 +1,37 @@ +From bb565bd5708fbfd9a0d6c55271167d0fced2e0da Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 22 Sep 2023 17:21:21 -0400 +Subject: drm/amdgpu: Fix a memory leak + +From: Luben Tuikov + +[ Upstream commit 5d061675b7538e25d060d13310880c01160207c4 ] + +Fix a memory leak in amdgpu_fru_get_product_info(). + +Cc: Alex Deucher +Reported-by: Yang Wang +Fixes: 0dbf2c562625 ("drm/amdgpu: Interpret IPMI data for product information (v2)") +Signed-off-by: Luben Tuikov +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +index 4620c4712ce32..1005edeea39e5 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +@@ -169,6 +169,7 @@ int amdgpu_fru_get_product_info(struct amdgpu_device *adev) + csum += pia[size - 1]; + if (csum) { + DRM_ERROR("Bad Product Info Area checksum: 0x%02x", csum); ++ kfree(pia); + return -EIO; + } + +-- +2.40.1 + diff --git a/queue-6.5/drm-i915-register-engines-early-to-avoid-type-confus.patch b/queue-6.5/drm-i915-register-engines-early-to-avoid-type-confus.patch new file mode 100644 index 00000000000..c35758608fa --- /dev/null +++ b/queue-6.5/drm-i915-register-engines-early-to-avoid-type-confus.patch @@ -0,0 +1,90 @@ +From defda39723058e18aea111f1c149d76e8f1dfba2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 28 Sep 2023 20:20:18 +0200 +Subject: drm/i915: Register engines early to avoid type confusion + +From: Mathias Krause + +[ Upstream commit 6007265ad70a87aa9b4eea79b5e5828da452cfd8 ] + +Commit 1ec23ed7126e ("drm/i915: Use uabi engines for the default engine +map") switched from using for_each_engine() to for_each_uabi_engine() to +iterate over the user engines. While this seems to be a sensible change, +it's only safe to do when the engines are actually chained using the +rb-tree structure which is not the case during early driver +initialization where it can be either a lock-less list or regular +double-linked list. + +In fact, the modesetting initialization code may end up calling +default_engines() through the fb helper code while the engines list +is still llist_node-based: + + i915_driver_probe() -> + intel_display_driver_probe() -> + intel_fbdev_init() -> + drm_fb_helper_init() -> + drm_client_init() -> + drm_client_open() -> + drm_file_alloc() -> + i915_driver_open() -> + i915_gem_open() -> + i915_gem_context_open() -> + i915_gem_create_context() -> + default_engines() + +Using for_each_uabi_engine() in default_engines() is therefore wrong, as +it would try to interpret the llist as rb-tree, making it find no engine +at all, as the rb_left and rb_right members will still be NULL, as they +haven't been initialized yet. + +To fix this type confusion register the engines earlier and at the same +time reduce the amount of code that has to deal with the intermediate +llist state. + +Reported-by: sanity checks in grsecurity +Suggested-by: Tvrtko Ursulin +Fixes: 1ec23ed7126e ("drm/i915: Use uabi engines for the default engine map") +Signed-off-by: Mathias Krause +Cc: Jonathan Cavitt +Cc: Tvrtko Ursulin +Reviewed-by: Tvrtko Ursulin +Signed-off-by: Tvrtko Ursulin +Link: https://patchwork.freedesktop.org/patch/msgid/20230928182019.10256-2-minipli@grsecurity.net +[tursulin: fixed commit tag typo] +(cherry picked from commit 2b562f032fc2594fb3fac22b7a2eb3c1969a7ba3) +Signed-off-by: Rodrigo Vivi +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/i915/i915_gem.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c +index 1f65bb33dd212..a8551ce322de2 100644 +--- a/drivers/gpu/drm/i915/i915_gem.c ++++ b/drivers/gpu/drm/i915/i915_gem.c +@@ -1199,6 +1199,13 @@ int i915_gem_init(struct drm_i915_private *dev_priv) + goto err_unlock; + } + ++ /* ++ * Register engines early to ensure the engine list is in its final ++ * rb-tree form, lowering the amount of code that has to deal with ++ * the intermediate llist state. ++ */ ++ intel_engines_driver_register(dev_priv); ++ + return 0; + + /* +@@ -1246,8 +1253,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) + void i915_gem_driver_register(struct drm_i915_private *i915) + { + i915_gem_driver_register__shrinker(i915); +- +- intel_engines_driver_register(i915); + } + + void i915_gem_driver_unregister(struct drm_i915_private *i915) +-- +2.40.1 + diff --git a/queue-6.5/media-dt-bindings-imx7-csi-make-power-domains-not-re.patch b/queue-6.5/media-dt-bindings-imx7-csi-make-power-domains-not-re.patch new file mode 100644 index 00000000000..28f8bf94e4d --- /dev/null +++ b/queue-6.5/media-dt-bindings-imx7-csi-make-power-domains-not-re.patch @@ -0,0 +1,45 @@ +From 6d09d2579d353e979974288e94291a747ef05ac9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Oct 2023 17:11:05 -0300 +Subject: media: dt-bindings: imx7-csi: Make power-domains not required for + imx8mq + +From: Fabio Estevam + +[ Upstream commit d7614a2733f5e354c075be178b068a241d5d8b11 ] + +On i.MX8MQ the MIPI CSI block does have an associated power-domain, but +the CSI bridge does not. + +Remove the power-domains requirement from the i.MX8MQ CSI bridge +to fix the following schema warning: + +imx8mq-librem5-r4.dtb: csi@30a90000: 'power-domains' is a required property +from schema $id: http://devicetree.org/schemas/media/nxp,imx7-csi.yaml# + +Fixes: de655386845a ("media: dt-bindings: media: imx7-csi: Document i.MX8M power-domains property") +Signed-off-by: Fabio Estevam +Acked-by: Conor Dooley +Reviewed-by: Marek Vasut +Link: https://lore.kernel.org/r/20231004201105.2323758-1-festevam@gmail.com +Signed-off-by: Rob Herring +Signed-off-by: Sasha Levin +--- + Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml b/Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml +index 358019e85d907..326284e151f66 100644 +--- a/Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml ++++ b/Documentation/devicetree/bindings/media/nxp,imx7-csi.yaml +@@ -59,7 +59,6 @@ allOf: + compatible: + contains: + enum: +- - fsl,imx8mq-csi + - fsl,imx8mm-csi + then: + required: +-- +2.40.1 + diff --git a/queue-6.5/net-stmmac-remove-unneeded-stmmac_poll_controller.patch b/queue-6.5/net-stmmac-remove-unneeded-stmmac_poll_controller.patch new file mode 100644 index 00000000000..6eb88073314 --- /dev/null +++ b/queue-6.5/net-stmmac-remove-unneeded-stmmac_poll_controller.patch @@ -0,0 +1,116 @@ +From 2b165b2ae2512b57f117bdfe0cafb1e034a0b03a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Oct 2023 16:33:56 +0200 +Subject: net: stmmac: remove unneeded stmmac_poll_controller + +From: Remi Pommarel + +[ Upstream commit 3eef8555891026628aa1cc6dbc01db86df88aa26 ] + +Using netconsole netpoll_poll_dev could be called from interrupt +context, thus using disable_irq() would cause the following kernel +warning with CONFIG_DEBUG_ATOMIC_SLEEP enabled: + + BUG: sleeping function called from invalid context at kernel/irq/manage.c:137 + in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 10, name: ksoftirqd/0 + CPU: 0 PID: 10 Comm: ksoftirqd/0 Tainted: G W 5.15.42-00075-g816b502b2298-dirty #117 + Hardware name: aml (r1) (DT) + Call trace: + dump_backtrace+0x0/0x270 + show_stack+0x14/0x20 + dump_stack_lvl+0x8c/0xac + dump_stack+0x18/0x30 + ___might_sleep+0x150/0x194 + __might_sleep+0x64/0xbc + synchronize_irq+0x8c/0x150 + disable_irq+0x2c/0x40 + stmmac_poll_controller+0x140/0x1a0 + netpoll_poll_dev+0x6c/0x220 + netpoll_send_skb+0x308/0x390 + netpoll_send_udp+0x418/0x760 + write_msg+0x118/0x140 [netconsole] + console_unlock+0x404/0x500 + vprintk_emit+0x118/0x250 + dev_vprintk_emit+0x19c/0x1cc + dev_printk_emit+0x90/0xa8 + __dev_printk+0x78/0x9c + _dev_warn+0xa4/0xbc + ath10k_warn+0xe8/0xf0 [ath10k_core] + ath10k_htt_txrx_compl_task+0x790/0x7fc [ath10k_core] + ath10k_pci_napi_poll+0x98/0x1f4 [ath10k_pci] + __napi_poll+0x58/0x1f4 + net_rx_action+0x504/0x590 + _stext+0x1b8/0x418 + run_ksoftirqd+0x74/0xa4 + smpboot_thread_fn+0x210/0x3c0 + kthread+0x1fc/0x210 + ret_from_fork+0x10/0x20 + +Since [0] .ndo_poll_controller is only needed if driver doesn't or +partially use NAPI. Because stmmac does so, stmmac_poll_controller +can be removed fixing the above warning. + +[0] commit ac3d9dd034e5 ("netpoll: make ndo_poll_controller() optional") + +Cc: # 5.15.x +Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers") +Signed-off-by: Remi Pommarel +Reviewed-by: Simon Horman +Link: https://lore.kernel.org/r/1c156a6d8c9170bd6a17825f2277115525b4d50f.1696429960.git.repk@triplefau.lt +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 30 ------------------- + 1 file changed, 30 deletions(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +index 6931973028aef..e840cadb2d75a 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -5940,33 +5940,6 @@ static irqreturn_t stmmac_msi_intr_rx(int irq, void *data) + return IRQ_HANDLED; + } + +-#ifdef CONFIG_NET_POLL_CONTROLLER +-/* Polling receive - used by NETCONSOLE and other diagnostic tools +- * to allow network I/O with interrupts disabled. +- */ +-static void stmmac_poll_controller(struct net_device *dev) +-{ +- struct stmmac_priv *priv = netdev_priv(dev); +- int i; +- +- /* If adapter is down, do nothing */ +- if (test_bit(STMMAC_DOWN, &priv->state)) +- return; +- +- if (priv->plat->multi_msi_en) { +- for (i = 0; i < priv->plat->rx_queues_to_use; i++) +- stmmac_msi_intr_rx(0, &priv->dma_conf.rx_queue[i]); +- +- for (i = 0; i < priv->plat->tx_queues_to_use; i++) +- stmmac_msi_intr_tx(0, &priv->dma_conf.tx_queue[i]); +- } else { +- disable_irq(dev->irq); +- stmmac_interrupt(dev->irq, dev); +- enable_irq(dev->irq); +- } +-} +-#endif +- + /** + * stmmac_ioctl - Entry point for the Ioctl + * @dev: Device pointer. +@@ -6802,9 +6775,6 @@ static const struct net_device_ops stmmac_netdev_ops = { + .ndo_eth_ioctl = stmmac_ioctl, + .ndo_setup_tc = stmmac_setup_tc, + .ndo_select_queue = stmmac_select_queue, +-#ifdef CONFIG_NET_POLL_CONTROLLER +- .ndo_poll_controller = stmmac_poll_controller, +-#endif + .ndo_set_mac_address = stmmac_set_mac_address, + .ndo_vlan_rx_add_vid = stmmac_vlan_rx_add_vid, + .ndo_vlan_rx_kill_vid = stmmac_vlan_rx_kill_vid, +-- +2.40.1 + diff --git a/queue-6.5/perf-arm-cmn-fix-the-unhandled-overflow-status-of-co.patch b/queue-6.5/perf-arm-cmn-fix-the-unhandled-overflow-status-of-co.patch new file mode 100644 index 00000000000..fedd5285d7a --- /dev/null +++ b/queue-6.5/perf-arm-cmn-fix-the-unhandled-overflow-status-of-co.patch @@ -0,0 +1,41 @@ +From d6ac5c5ec17476ddd0340077bd6bb4bd190b34c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Sep 2023 11:22:32 +0800 +Subject: perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7 + +From: Jing Zhang + +[ Upstream commit 7f949f6f54ff593123ab95b6247bfa4542a65580 ] + +The register por_dt_pmovsr Bits[7:0] indicates overflow from counters 7 +to 0. But in arm_cmn_handle_irq(), only handled the overflow status of +Bits[3:0] which results in unhandled overflow status of counters 4 to 7. + +So let the overflow status of DTC counters 4 to 7 to be handled. + +Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") +Signed-off-by: Jing Zhang +Reviewed-by: Robin Murphy +Link: https://lore.kernel.org/r/1695612152-123633-1-git-send-email-renyu.zj@linux.alibaba.com +Signed-off-by: Will Deacon +Signed-off-by: Sasha Levin +--- + drivers/perf/arm-cmn.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c +index b8c15878bc86d..43aba01399bef 100644 +--- a/drivers/perf/arm-cmn.c ++++ b/drivers/perf/arm-cmn.c +@@ -1862,7 +1862,7 @@ static irqreturn_t arm_cmn_handle_irq(int irq, void *dev_id) + u64 delta; + int i; + +- for (i = 0; i < CMN_DTM_NUM_COUNTERS; i++) { ++ for (i = 0; i < CMN_DT_NUM_COUNTERS; i++) { + if (status & (1U << i)) { + ret = IRQ_HANDLED; + if (WARN_ON(!dtc->counters[i])) +-- +2.40.1 + diff --git a/queue-6.5/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch b/queue-6.5/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch new file mode 100644 index 00000000000..2c2c7834961 --- /dev/null +++ b/queue-6.5/platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch @@ -0,0 +1,51 @@ +From 3a3493301fcba04c1a1301007886f5ebbc6f6ae0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 4 Oct 2023 13:16:24 +0200 +Subject: platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent + section mismatch warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit 5b44abbc39ca15df80d0da4756078c98c831090f ] + +As described in the added code comment, a reference to .exit.text is ok +for drivers registered via module_platform_driver_probe(). Make this +explicit to prevent a section mismatch warning: + + WARNING: modpost: drivers/platform/x86/hp/hp-wmi: section mismatch in reference: hp_wmi_driver+0x8 (section: .data) -> hp_wmi_bios_remove (section: .exit.text) + +Fixes: c165b80cfecc ("hp-wmi: fix handling of platform device") +Signed-off-by: Uwe Kleine-König +Link: https://lore.kernel.org/r/20231004111624.2667753-1-u.kleine-koenig@pengutronix.de +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/hp/hp-wmi.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c +index e76e5458db350..8ebb7be52ee72 100644 +--- a/drivers/platform/x86/hp/hp-wmi.c ++++ b/drivers/platform/x86/hp/hp-wmi.c +@@ -1548,7 +1548,13 @@ static const struct dev_pm_ops hp_wmi_pm_ops = { + .restore = hp_wmi_resume_handler, + }; + +-static struct platform_driver hp_wmi_driver = { ++/* ++ * hp_wmi_bios_remove() lives in .exit.text. For drivers registered via ++ * module_platform_driver_probe() this is ok because they cannot get unbound at ++ * runtime. So mark the driver struct with __refdata to prevent modpost ++ * triggering a section mismatch warning. ++ */ ++static struct platform_driver hp_wmi_driver __refdata = { + .driver = { + .name = "hp-wmi", + .pm = &hp_wmi_pm_ops, +-- +2.40.1 + diff --git a/queue-6.5/platform-x86-think-lmi-fix-reference-leak.patch b/queue-6.5/platform-x86-think-lmi-fix-reference-leak.patch new file mode 100644 index 00000000000..5502f8d6fc5 --- /dev/null +++ b/queue-6.5/platform-x86-think-lmi-fix-reference-leak.patch @@ -0,0 +1,80 @@ +From 0625555de5c1521c8127f8556c2373ce4df45762 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 25 Sep 2023 16:28:18 +0200 +Subject: platform/x86: think-lmi: Fix reference leak +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Armin Wolf + +[ Upstream commit 528ab3e605cabf2f9c9bd5944d3bfe15f6e94f81 ] + +If a duplicate attribute is found using kset_find_obj(), a reference +to that attribute is returned which needs to be disposed accordingly +using kobject_put(). Move the setting name validation into a separate +function to allow for this change without having to duplicate the +cleanup code for this setting. +As a side note, a very similar bug was fixed in +commit 7295a996fdab ("platform/x86: dell-sysman: Fix reference leak"), +so it seems that the bug was copied from that driver. + +Compile-tested only. + +Fixes: 1bcad8e510b2 ("platform/x86: think-lmi: Fix issues with duplicate attributes") +Reviewed-by: Mark Pearson +Reviewed-by: Ilpo Järvinen +Signed-off-by: Armin Wolf +Link: https://lore.kernel.org/r/20230925142819.74525-2-W_Armin@gmx.de +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/think-lmi.c | 24 ++++++++++++++++++++---- + 1 file changed, 20 insertions(+), 4 deletions(-) + +diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c +index 79346881cadb1..aee869769843f 100644 +--- a/drivers/platform/x86/think-lmi.c ++++ b/drivers/platform/x86/think-lmi.c +@@ -1248,6 +1248,24 @@ static void tlmi_release_attr(void) + kset_unregister(tlmi_priv.authentication_kset); + } + ++static int tlmi_validate_setting_name(struct kset *attribute_kset, char *name) ++{ ++ struct kobject *duplicate; ++ ++ if (!strcmp(name, "Reserved")) ++ return -EINVAL; ++ ++ duplicate = kset_find_obj(attribute_kset, name); ++ if (duplicate) { ++ pr_debug("Duplicate attribute name found - %s\n", name); ++ /* kset_find_obj() returns a reference */ ++ kobject_put(duplicate); ++ return -EBUSY; ++ } ++ ++ return 0; ++} ++ + static int tlmi_sysfs_init(void) + { + int i, ret; +@@ -1276,10 +1294,8 @@ static int tlmi_sysfs_init(void) + continue; + + /* check for duplicate or reserved values */ +- if (kset_find_obj(tlmi_priv.attribute_kset, tlmi_priv.setting[i]->display_name) || +- !strcmp(tlmi_priv.setting[i]->display_name, "Reserved")) { +- pr_debug("duplicate or reserved attribute name found - %s\n", +- tlmi_priv.setting[i]->display_name); ++ if (tlmi_validate_setting_name(tlmi_priv.attribute_kset, ++ tlmi_priv.setting[i]->display_name) < 0) { + kfree(tlmi_priv.setting[i]->possible_values); + kfree(tlmi_priv.setting[i]); + tlmi_priv.setting[i] = NULL; +-- +2.40.1 + diff --git a/queue-6.5/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch b/queue-6.5/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch new file mode 100644 index 00000000000..580d6c9c873 --- /dev/null +++ b/queue-6.5/rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch @@ -0,0 +1,39 @@ +From a54af8de622295d31c839c274a41d3f8ce4c222a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 5 Sep 2023 15:40:48 +0300 +Subject: RDMA/cxgb4: Check skb value for failure to allocate + +From: Artem Chernyshev + +[ Upstream commit 8fb8a82086f5bda6893ea6557c5a458e4549c6d7 ] + +get_skb() can fail to allocate skb, so check it. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Fixes: 5be78ee924ae ("RDMA/cxgb4: Fix LE hash collision bug for active open connection") +Signed-off-by: Artem Chernyshev +Link: https://lore.kernel.org/r/20230905124048.284165-1-artem.chernyshev@red-soft.ru +Signed-off-by: Leon Romanovsky +Signed-off-by: Sasha Levin +--- + drivers/infiniband/hw/cxgb4/cm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c +index ced615b5ea096..040ba2224f9ff 100644 +--- a/drivers/infiniband/hw/cxgb4/cm.c ++++ b/drivers/infiniband/hw/cxgb4/cm.c +@@ -1965,6 +1965,9 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid) + int win; + + skb = get_skb(NULL, sizeof(*req), GFP_KERNEL); ++ if (!skb) ++ return -ENOMEM; ++ + req = __skb_put_zero(skb, sizeof(*req)); + req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR)); + req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16))); +-- +2.40.1 + diff --git a/queue-6.5/series b/queue-6.5/series new file mode 100644 index 00000000000..c857bfb6421 --- /dev/null +++ b/queue-6.5/series @@ -0,0 +1,10 @@ +net-stmmac-remove-unneeded-stmmac_poll_controller.patch +rdma-cxgb4-check-skb-value-for-failure-to-allocate.patch +perf-arm-cmn-fix-the-unhandled-overflow-status-of-co.patch +platform-x86-think-lmi-fix-reference-leak.patch +drm-i915-register-engines-early-to-avoid-type-confus.patch +arm_pmu-acpi-add-a-representative-platform-device-fo.patch +cpuidle-acpi-evaluate-lpi-arch_flags-for-broadcast-t.patch +drm-amdgpu-fix-a-memory-leak.patch +platform-x86-hp-wmi-mark-driver-struct-with-__refdat.patch +media-dt-bindings-imx7-csi-make-power-domains-not-re.patch