Skip to content

Commit 1f81939

Browse files
MrVangregkh
authored andcommitted
firmware: imx: scu-irq: Set mu_resource_id before get handle
commit ff3f991 upstream. mu_resource_id is referenced in imx_scu_irq_get_status() and imx_scu_irq_group_enable() which could be used by other modules, so need to set correct value before using imx_sc_irq_ipc_handle in SCU API call. 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> Fixes: 81fb53f ("firmware: imx: scu-irq: Init workqueue before request mbox channel") Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f6044d1 commit 1f81939

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

drivers/firmware/imx/imx-scu-irq.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,18 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
203203
struct mbox_chan *ch;
204204
int ret = 0, i = 0;
205205

206+
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
207+
"#mbox-cells", 0, &spec)) {
208+
i = of_alias_get_id(spec.np, "mu");
209+
of_node_put(spec.np);
210+
}
211+
212+
/* use mu1 as general mu irq channel if failed */
213+
if (i < 0)
214+
i = 1;
215+
216+
mu_resource_id = IMX_SC_R_MU_0A + i;
217+
206218
ret = imx_scu_get_handle(&imx_sc_irq_ipc_handle);
207219
if (ret)
208220
return ret;
@@ -225,18 +237,6 @@ int imx_scu_enable_general_irq_channel(struct device *dev)
225237
return ret;
226238
}
227239

228-
if (!of_parse_phandle_with_args(dev->of_node, "mboxes",
229-
"#mbox-cells", 0, &spec)) {
230-
i = of_alias_get_id(spec.np, "mu");
231-
of_node_put(spec.np);
232-
}
233-
234-
/* use mu1 as general mu irq channel if failed */
235-
if (i < 0)
236-
i = 1;
237-
238-
mu_resource_id = IMX_SC_R_MU_0A + i;
239-
240240
/* Create directory under /sysfs/firmware */
241241
wakeup_obj = kobject_create_and_add("scu_wakeup_source", firmware_kobj);
242242
if (!wakeup_obj) {

0 commit comments

Comments
 (0)