FAILED: patch "[PATCH] media: venus: protect against spurious interrupts during" failed to apply to 5.15-stable tree
Subsystems (5)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 3200144a2fa4209dc084a19941b9b203b43580f0
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2025082150-feminize-barterer-4a0f@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 3200144a2fa4209dc084a19941b9b203b43580f0 Mon Sep 17 00:00:00 2001
From: Jorge Ramirez-Ortiz <[email protected]>
Date: Fri, 6 Jun 2025 17:25:22 +0200
Subject: [PATCH] media: venus: protect against spurious interrupts during
probe
Make sure the interrupt handler is initialized before the interrupt is registered.
If the IRQ is registered before hfi_create(), it's possible that an interrupt fires before the handler setup is complete, leading to a NULL dereference.
This error condition has been observed during system boot on Rb3Gen2.
drivers/media/platform/qcom/venus/core.c +4 -4
@@ -424,13 +424,13 @@ static int venus_probe(struct platform_device *pdev)INIT_DELAYED_WORK (&core->work, venus_sys_error_handler);init_waitqueue_head (&core->sys_err_done); - ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, venus_isr_thread, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , -"venus" , core); + ret =hfi_create (core, &venus_core_ops);if (ret) goto err_core_put; - ret =hfi_create (core, &venus_core_ops); + ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, venus_isr_thread, +IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +"venus" , core);if (ret) goto err_core_put;
Sasha Levin
maintainerPATCH 1/2 media: venus: Add support for SSR trigger using fault injection
From: Dikshita Agarwal <[email protected]>
[ Upstream commit 748b080f21678f2988b0da2d2b396a6f928d9b2c ]
Here we introduce a new fault injection for SSR trigger.
To trigger the SSR:
echo 100 > /sys/kernel/debug/venus/fail_ssr/probability echo 1 > /sys/kernel/debug/venus/fail_ssr/times
Stable-dep-of: 3200144a2fa4 ("media: venus: protect against spurious interrupts during probe")
--- drivers/media/platform/qcom/venus/core.c | 15 ++++++++++++++- drivers/media/platform/qcom/venus/dbgfs.c | 9 +++++++++ drivers/media/platform/qcom/venus/dbgfs.h | 13 +++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-)
drivers/media/platform/qcom/venus/core.c +14 -1
@@ -263,6 +263,19 @@ static void venus_assign_register_offsets(struct venus_core *core) } } +static irqreturn_t venus_isr_thread (int irq,void *dev_id) +{ +struct venus_core *core = dev_id; +irqreturn_t ret; + + ret =hfi_isr_thread (irq, dev_id); + +if (ret ==IRQ_HANDLED &&venus_fault_inject_ssr ()) +hfi_core_trigger_ssr (core,HFI_TEST_SSR_SW_ERR_FATAL ); + +return ret; +} +static int venus_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
@@ -319,7 +332,7 @@ static int venus_probe(struct platform_device *pdev)mutex_init (&core->lock);INIT_DELAYED_WORK (&core->work, venus_sys_error_handler); - ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, hfi_isr_thread, + ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, venus_isr_thread,IRQF_TRIGGER_HIGH |IRQF_ONESHOT ,"venus" , core);if (ret)
drivers/media/platform/qcom/venus/dbgfs.c +9 -0
@@ -4,13 +4,22 @@*/ #include <linux/debugfs.h> +#include <linux/fault-inject.h> #include "core.h" +#ifdef CONFIG_FAULT_INJECTION +DECLARE_FAULT_ATTR (venus_ssr_attr); +#endif +void venus_dbgfs_init (struct venus_core *core) { core->root =debugfs_create_dir ("venus" ,NULL );debugfs_create_x32 ("fw_level" ,0644 , core->root, &venus_fw_debug); + +#ifdef CONFIG_FAULT_INJECTION +fault_create_debugfs_attr ("fail_ssr" , core->root, &venus_ssr_attr); +#endif }void venus_dbgfs_deinit (struct venus_core *core)
drivers/media/platform/qcom/venus/dbgfs.h +13 -0
@@ -4,8 +4,21 @@#ifndef __VENUS_DBGFS_H__#define __VENUS_DBGFS_H__ +#include <linux/fault-inject.h> +struct venus_core ; +#ifdef CONFIG_FAULT_INJECTION +extern struct fault_attr venus_ssr_attr; +static inline bool venus_fault_inject_ssr (void ) +{ +return should_fail (&venus_ssr_attr,1 ); +} +#else +static inline bool venus_fault_inject_ssr (void ) {return false; } +#endif + +void venus_dbgfs_init (struct venus_core *core);void venus_dbgfs_deinit (struct venus_core *core);
Signature · 1 line
2.50.1
Sasha Levin
maintainerPATCH 2/2 media: venus: protect against spurious interrupts during probe
From: Jorge Ramirez-Ortiz <[email protected]>
[ Upstream commit 3200144a2fa4209dc084a19941b9b203b43580f0 ]
Make sure the interrupt handler is initialized before the interrupt is registered.
If the IRQ is registered before hfi_create(), it's possible that an interrupt fires before the handler setup is complete, leading to a NULL dereference.
This error condition has been observed during system boot on Rb3Gen2.
--- drivers/media/platform/qcom/venus/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/core.c +4 -4
@@ -332,13 +332,13 @@ static int venus_probe(struct platform_device *pdev)mutex_init (&core->lock);INIT_DELAYED_WORK (&core->work, venus_sys_error_handler); - ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, venus_isr_thread, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , -"venus" , core); + ret =hfi_create (core, &venus_core_ops);if (ret) goto err_core_put; - ret =hfi_create (core, &venus_core_ops); + ret =devm_request_threaded_irq (dev, core->irq, hfi_isr, venus_isr_thread, +IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +"venus" , core);if (ret) goto err_core_put;
Signature · 1 line
2.50.1