firmware: imx: scu-irq: Init workqueue before request mbox channel
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>
This commit is contained in:
@@ -214,6 +214,8 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
|
|||||||
cl->dev = dev;
|
cl->dev = dev;
|
||||||
cl->rx_callback = imx_scu_irq_callback;
|
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 */
|
/* SCU general IRQ uses general interrupt channel 3 */
|
||||||
ch = mbox_request_channel_byname(cl, "gip3");
|
ch = mbox_request_channel_byname(cl, "gip3");
|
||||||
if (IS_ERR(ch)) {
|
if (IS_ERR(ch)) {
|
||||||
@@ -222,8 +224,6 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
|
|||||||
goto free_cl;
|
goto free_cl;
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_WORK(&imx_sc_irq_work, imx_scu_irq_work_handler);
|
|
||||||
|
|
||||||
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
|
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
|
||||||
"#mbox-cells", 0, &spec)) {
|
"#mbox-cells", 0, &spec)) {
|
||||||
i = of_alias_get_id(spec.np, "mu");
|
i = of_alias_get_id(spec.np, "mu");
|
||||||
|
|||||||
Reference in New Issue
Block a user