]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
firmware: imx: scu-irq: Init workqueue before request mbox channel
authorPeng Fan <peng.fan@nxp.com>
Fri, 17 Oct 2025 01:56:26 +0000 (09:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:09:46 +0000 (13:09 +0100)
[ Upstream commit 81fb53feb66a3aefbf6fcab73bb8d06f5b0c54ad ]

With mailbox channel requested, there is possibility that interrupts may
come in, so need to make sure the workqueue is initialized before
the queue is scheduled by mailbox rx callback.

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/firmware/imx/imx-scu-irq.c

index 32b1ca4e10508a85c4f8d50ed937314675ec2491..06c49a61a07901e2e034d76333987567016e385f 100644 (file)
@@ -148,6 +148,8 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
        cl->dev = dev;
        cl->rx_callback = imx_scu_irq_callback;
 
+       INIT_WORK(&imx_sc_irq_work, imx_scu_irq_work_handler);
+
        /* SCU general IRQ uses general interrupt channel 3 */
        ch = mbox_request_channel_byname(cl, "gip3");
        if (IS_ERR(ch)) {
@@ -157,8 +159,6 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
                return ret;
        }
 
-       INIT_WORK(&imx_sc_irq_work, imx_scu_irq_work_handler);
-
        if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
                                       "#mbox-cells", 0, &spec)) {
                i = of_alias_get_id(spec.np, "mu");